Shaka Packager SDK
|
Public Types | |
typedef std::function< void(const std::vector< std::shared_ptr< StreamInfo > > &stream_info)> | InitCB |
typedef std::function< bool(uint32_t track_id, std::shared_ptr< MediaSample > media_sample)> | NewMediaSampleCB |
typedef std::function< 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 ()=0 |
virtual bool | Parse (const uint8_t *buf, int size)=0 |
Definition at line 26 of file media_parser.h.
typedef std::function<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 36 of file media_parser.h.
typedef std::function<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 45 of file media_parser.h.
typedef std::function<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 54 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::WebVttParser, shaka::media::WebMMediaParser, shaka::media::mp4::MP4MediaParser, and shaka::media::mp2t::Mp2tMediaParser.
|
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::WebVttParser, shaka::media::WebMMediaParser, shaka::media::mp4::MP4MediaParser, and shaka::media::mp2t::Mp2tMediaParser.
|
pure virtual |
Should be called when there is new data to parse.
Implemented in shaka::media::wvm::WvmMediaParser, shaka::media::WebVttParser, shaka::media::WebMMediaParser, shaka::media::mp4::MP4MediaParser, and shaka::media::mp2t::Mp2tMediaParser.