DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations 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 <memory>
11 #include <string>
12 #include <vector>
13 #include "packager/base/callback.h"
14 #include "packager/base/compiler_specific.h"
15 #include "packager/base/memory/ref_counted.h"
16 #include "packager/media/base/container_names.h"
17 
18 namespace shaka {
19 namespace media {
20 
21 class KeySource;
22 class MediaSample;
23 class StreamInfo;
24 
25 class MediaParser {
26  public:
27  MediaParser() {}
28  virtual ~MediaParser() {}
29 
33  typedef base::Callback<
34  void(const std::vector<scoped_refptr<StreamInfo> >& stream_info)> InitCB;
35 
41  typedef base::Callback<bool(uint32_t track_id,
42  const scoped_refptr<MediaSample>& media_sample)>
44 
52  virtual void Init(const InitCB& init_cb,
53  const NewSampleCB& new_sample_cb,
54  KeySource* decryption_key_source) = 0;
55 
59  virtual bool Flush() WARN_UNUSED_RESULT = 0;
60 
63  virtual bool Parse(const uint8_t* buf, int size) WARN_UNUSED_RESULT = 0;
64 
65  private:
66  DISALLOW_COPY_AND_ASSIGN(MediaParser);
67 };
68 
69 } // namespace media
70 } // namespace shaka
71 
72 #endif // MEDIA_BASE_MEDIA_PARSER_H_
base::Callback< void(const std::vector< scoped_refptr< StreamInfo > > &stream_info)> InitCB
Definition: media_parser.h:34
virtual bool Parse(const uint8_t *buf, int size) WARN_UNUSED_RESULT=0
virtual void Init(const InitCB &init_cb, const NewSampleCB &new_sample_cb, KeySource *decryption_key_source)=0
virtual bool Flush() WARN_UNUSED_RESULT=0
base::Callback< bool(uint32_t track_id, const scoped_refptr< MediaSample > &media_sample)> NewSampleCB
Definition: media_parser.h:43
KeySource is responsible for encryption key acquisition.
Definition: key_source.h:30