Shaka Packager SDK
|
Public Types | |
enum | { kDefaultAudioBufferDurationInMs = 23, kDefaultVideoBufferDurationInMs = 63 } |
Public Member Functions | |
WebMClusterParser (int64_t timecode_scale, std::shared_ptr< AudioStreamInfo > audio_stream_info, std::shared_ptr< VideoStreamInfo > video_stream_info, const VPCodecConfigurationRecord &vp_config, int64_t audio_default_duration, int64_t video_default_duration, const WebMTracksParser::TextTracks &text_tracks, const std::set< int64_t > &ignored_tracks, const std::string &audio_encryption_key_id, const std::string &video_encryption_key_id, const MediaParser::NewSampleCB &new_sample_cb, const MediaParser::InitCB &init_cb, KeySource *decryption_key_source) | |
void | Reset () |
Resets the parser state so it can accept a new cluster. | |
bool | Flush () WARN_UNUSED_RESULT |
int | Parse (const uint8_t *buf, int size) |
int64_t | cluster_start_time () const |
bool | cluster_ended () const |
Public Member Functions inherited from shaka::media::WebMParserClient | |
virtual bool | OnFloat (int id, double val) |
virtual bool | OnString (int id, const std::string &str) |
Additional Inherited Members | |
Protected Member Functions inherited from shaka::media::WebMParserClient | |
DISALLOW_COPY_AND_ASSIGN (WebMParserClient) | |
Definition at line 24 of file webm_cluster_parser.h.
anonymous enum |
Numbers chosen to estimate the duration of a buffer if none is set and there is not enough information to get a better estimate.
Definition at line 28 of file webm_cluster_parser.h.
shaka::media::WebMClusterParser::WebMClusterParser | ( | int64_t | timecode_scale, |
std::shared_ptr< AudioStreamInfo > | audio_stream_info, | ||
std::shared_ptr< VideoStreamInfo > | video_stream_info, | ||
const VPCodecConfigurationRecord & | vp_config, | ||
int64_t | audio_default_duration, | ||
int64_t | video_default_duration, | ||
const WebMTracksParser::TextTracks & | text_tracks, | ||
const std::set< int64_t > & | ignored_tracks, | ||
const std::string & | audio_encryption_key_id, | ||
const std::string & | video_encryption_key_id, | ||
const MediaParser::NewSampleCB & | new_sample_cb, | ||
const MediaParser::InitCB & | init_cb, | ||
KeySource * | decryption_key_source | ||
) |
Create a WebMClusterParser from given parameters.
timecode_scale | indicates timecode scale for the clusters. |
audio_stream_info | references audio stream information. It will be NULL if there are no audio tracks available. |
video_stream_info | references video stream information. It will be NULL if there are no video tracks available. |
vp_config | references vp configuration record. Only useful for video. |
audio_default_duration | indicates default duration for audio samples. |
video_default_duration | indicates default duration for video samples. |
text_tracks | contains text track information. |
ignored_tracks | contains a list of ignored track ids. |
audio_encryption_key_id | indicates the encryption key id for audio samples if there is an audio stream and the audio stream is encrypted. It is empty otherwise. |
video_encryption_key_id | indicates the encryption key id for video samples if there is a video stream and the video stream is encrypted. It is empty otherwise. |
new_sample_cb | is the callback to emit new samples. |
init_cb | is the callback to initialize streams. |
decryption_key_source | points to a decryption key source to fetch decryption keys. Should not be NULL if the tracks are encrypted. |
Definition at line 29 of file webm_cluster_parser.cc.
|
inline |
Definition at line 154 of file webm_cluster_parser.h.
bool shaka::media::WebMClusterParser::Flush | ( | ) |
Flush data currently in the parser and reset the parser so it can accept a new cluster.
Definition at line 91 of file webm_cluster_parser.cc.
int shaka::media::WebMClusterParser::Parse | ( | const uint8_t * | buf, |
int | size | ||
) |
Parses a WebM cluster element in |buf|.
Definition at line 99 of file webm_cluster_parser.cc.