|
| | 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::NewMediaSampleCB &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 () |
| |
| int | Parse (const uint8_t *buf, int size) |
| |
| int64_t | cluster_start_time () const |
| |
| bool | cluster_ended () const |
| |
| virtual bool | OnFloat (int id, double val) |
| |
| virtual bool | OnString (int id, const std::string &str) |
| |
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.
| Enumerator |
|---|
| kDefaultAudioBufferDurationInMs | Common 1k samples @44.1kHz.
|
| kDefaultVideoBufferDurationInMs | Chosen to represent 16fps duration, which will prevent MSE stalls in videos with frame-rates as low as 8fps.
|
Definition at line 28 of file webm_cluster_parser.h.
◆ WebMClusterParser()
| 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::NewMediaSampleCB & |
new_sample_cb, |
|
|
const MediaParser::InitCB & |
init_cb, |
|
|
KeySource * |
decryption_key_source |
|
) |
| |
Create a WebMClusterParser from given parameters.
- 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 31 of file webm_cluster_parser.cc.
◆ ~WebMClusterParser()
| shaka::media::WebMClusterParser::~WebMClusterParser |
( |
| ) |
|
|
override |
◆ cluster_ended()
| bool shaka::media::WebMClusterParser::cluster_ended |
( |
| ) |
const |
|
inline |
◆ cluster_start_time()
| int64_t shaka::media::WebMClusterParser::cluster_start_time |
( |
| ) |
const |
|
inline |
◆ Flush()
| bool shaka::media::WebMClusterParser::Flush |
( |
| ) |
|
Flush data currently in the parser and reset the parser so it can accept a new cluster.
- Returns
- true on success, false otherwise.
Definition at line 93 of file webm_cluster_parser.cc.
◆ Parse()
| int shaka::media::WebMClusterParser::Parse |
( |
const uint8_t * |
buf, |
|
|
int |
size |
|
) |
| |
Parses a WebM cluster element in |buf|.
- Returns
- -1 if the parse fails.
-
0 if more data is needed.
-
The number of bytes parsed on success.
Definition at line 101 of file webm_cluster_parser.cc.
◆ Reset()
| void shaka::media::WebMClusterParser::Reset |
( |
| ) |
|
The documentation for this class was generated from the following files: