DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
media_parser.h
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef MEDIA_BASE_MEDIA_PARSER_H_
8 #define MEDIA_BASE_MEDIA_PARSER_H_
9 
10 #include <string>
11 #include <vector>
12 
13 #include "packager/base/callback.h"
14 #include "packager/base/compiler_specific.h"
15 #include "packager/base/memory/ref_counted.h"
16 #include "packager/base/memory/scoped_ptr.h"
17 #include "packager/media/base/container_names.h"
18 
19 namespace edash_packager {
20 namespace media {
21 
22 class KeySource;
23 class MediaSample;
24 class StreamInfo;
25 
26 class MediaParser {
27  public:
28  MediaParser() {}
29  virtual ~MediaParser() {}
30 
34  typedef base::Callback<
35  void(const std::vector<scoped_refptr<StreamInfo> >& stream_info)> InitCB;
36 
42  typedef base::Callback<bool(uint32_t track_id,
43  const scoped_refptr<MediaSample>& media_sample)>
45 
53  virtual void Init(const InitCB& init_cb,
54  const NewSampleCB& new_sample_cb,
55  KeySource* decryption_key_source) = 0;
56 
60  virtual bool Flush() WARN_UNUSED_RESULT = 0;
61 
64  virtual bool Parse(const uint8_t* buf, int size) WARN_UNUSED_RESULT = 0;
65 
66  private:
67  DISALLOW_COPY_AND_ASSIGN(MediaParser);
68 };
69 
70 } // namespace media
71 } // namespace edash_packager
72 
73 #endif // MEDIA_BASE_MEDIA_PARSER_H_
base::Callback< bool(uint32_t track_id, const scoped_refptr< MediaSample > &media_sample)> NewSampleCB
Definition: media_parser.h:44
KeySource is responsible for encryption key acquisition.
Definition: key_source.h:35
virtual bool Flush() WARN_UNUSED_RESULT=0
base::Callback< void(const std::vector< scoped_refptr< StreamInfo > > &stream_info)> InitCB
Definition: media_parser.h:35
virtual void Init(const InitCB &init_cb, const NewSampleCB &new_sample_cb, KeySource *decryption_key_source)=0
virtual bool Parse(const uint8_t *buf, int size) WARN_UNUSED_RESULT=0