Shaka Packager SDK
|
Public Types | |
typedef base::Callback< void(const std::vector< std::shared_ptr< StreamInfo > > &stream_info)> | InitCB |
typedef base::Callback< bool(uint32_t track_id, std::shared_ptr< MediaSample > media_sample)> | NewMediaSampleCB |
typedef base::Callback< bool(uint32_t track_id, std::shared_ptr< TextSample > text_sample)> | NewTextSampleCB |
Public Member Functions | |
virtual void | Init (const InitCB &init_cb, const NewMediaSampleCB &new_media_sample_cb, const NewTextSampleCB &new_text_sample_cb, KeySource *decryption_key_source)=0 |
virtual bool | Flush () WARN_UNUSED_RESULT=0 |
virtual bool | Parse (const uint8_t *buf, int size) WARN_UNUSED_RESULT=0 |
Definition at line 25 of file media_parser.h.
typedef base::Callback<void( const std::vector<std::shared_ptr<StreamInfo> >& stream_info)> shaka::media::MediaParser::InitCB |
Called upon completion of parser initialization.
stream_info | contains the stream info of all the elementary streams within this file. |
Definition at line 35 of file media_parser.h.
typedef base::Callback<bool(uint32_t track_id, std::shared_ptr<MediaSample> media_sample)> shaka::media::MediaParser::NewMediaSampleCB |
Called when a new media sample has been parsed.
track_id | is the track id of the new sample. |
media_sample | is the new media sample. |
Definition at line 44 of file media_parser.h.
typedef base::Callback<bool(uint32_t track_id, std::shared_ptr<TextSample> text_sample)> shaka::media::MediaParser::NewTextSampleCB |
Called when a new text sample has been parsed.
track_id | is the track id of the new sample. |
text_sample | is the new text sample. |
Definition at line 53 of file media_parser.h.
|
pure virtual |
Flush data currently in the parser and put the parser in a state where it can receive data for a new seek point.
Implemented in shaka::media::wvm::WvmMediaParser, shaka::media::mp4::MP4MediaParser, shaka::media::mp2t::Mp2tMediaParser, shaka::media::WebMMediaParser, and shaka::media::WebVttParser.
|
pure virtual |
Initialize the parser with necessary callbacks. Must be called before any data is passed to Parse().
init_cb | will be called once enough data has been parsed to determine the initial stream configurations. |
new_media_sample_cb | will be called each time a new media sample is available from the parser. |
new_text_sample_cb | will be called each time a new text sample is available from the parser. |
decryption_key_source | the key source to decrypt the frames. May be NULL, and caller retains ownership. |
Implemented in shaka::media::wvm::WvmMediaParser, shaka::media::mp4::MP4MediaParser, shaka::media::mp2t::Mp2tMediaParser, shaka::media::WebVttParser, and shaka::media::WebMMediaParser.
|
pure virtual |
Should be called when there is new data to parse.
Implemented in shaka::media::wvm::WvmMediaParser, shaka::media::mp4::MP4MediaParser, shaka::media::mp2t::Mp2tMediaParser, shaka::media::WebMMediaParser, and shaka::media::WebVttParser.