Shaka Packager SDK
Public Member Functions | List of all members
shaka::media::mp4::MP4MediaParser Class Reference
Inheritance diagram for shaka::media::mp4::MP4MediaParser:
shaka::media::MediaParser

Public Member Functions

bool LoadMoov (const std::string &file_path)
 
MediaParser implementation overrides.
void Init (const InitCB &init_cb, const NewMediaSampleCB &new_media_sample_cb, const NewTextSampleCB &new_text_sample_cb, KeySource *decryption_key_source) override
 
bool Flush () override
 
bool Parse (const uint8_t *buf, int size) override
 

Additional Inherited Members

- Public Types inherited from shaka::media::MediaParser
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
 

Detailed Description

Definition at line 34 of file mp4_media_parser.h.

Member Function Documentation

◆ Flush()

bool shaka::media::mp4::MP4MediaParser::Flush ( )
overridevirtual

Flush data currently in the parser and put the parser in a state where it can receive data for a new seek point.

Returns
true if successful, false otherwise.

Implements shaka::media::MediaParser.

Definition at line 274 of file mp4_media_parser.cc.

◆ Init()

void shaka::media::mp4::MP4MediaParser::Init ( const InitCB init_cb,
const NewMediaSampleCB new_media_sample_cb,
const NewTextSampleCB new_text_sample_cb,
KeySource decryption_key_source 
)
overridevirtual

Initialize the parser with necessary callbacks. Must be called before any data is passed to Parse().

Parameters
init_cbwill be called once enough data has been parsed to determine the initial stream configurations.
new_media_sample_cbwill be called each time a new media sample is available from the parser.
new_text_sample_cbwill be called each time a new text sample is available from the parser.
decryption_key_sourcethe key source to decrypt the frames. May be NULL, and caller retains ownership.

Implements shaka::media::MediaParser.

Definition at line 250 of file mp4_media_parser.cc.

◆ LoadMoov()

bool shaka::media::mp4::MP4MediaParser::LoadMoov ( const std::string &  file_path)

Handles ISO-BMFF containers which have the 'moov' box trailing the movie data ('mdat'). It does this by doing a sparse parse of the file to locate the 'moov' box, and parsing its contents if it is found to be located after the 'mdat' box(es).

Parameters
file_pathis the path to the media file to be parsed.
Returns
true if successful, false otherwise.

Definition at line 315 of file mp4_media_parser.cc.

◆ Parse()

bool shaka::media::mp4::MP4MediaParser::Parse ( const uint8_t *  buf,
int  size 
)
overridevirtual

Should be called when there is new data to parse.

Returns
true if successful.

Implements shaka::media::MediaParser.

Definition at line 281 of file mp4_media_parser.cc.


The documentation for this class was generated from the following files: