5 #ifndef MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
14 #include "packager/base/time/time.h"
15 #include "packager/media/base/audio_stream_info.h"
16 #include "packager/media/base/text_track_config.h"
17 #include "packager/media/base/video_stream_info.h"
18 #include "packager/media/formats/webm/webm_audio_client.h"
19 #include "packager/media/formats/webm/webm_content_encodings_client.h"
20 #include "packager/media/formats/webm/webm_parser.h"
21 #include "packager/media/formats/webm/webm_video_client.h"
36 int Parse(
const uint8_t* buf,
int size);
38 int64_t audio_track_num()
const {
return audio_track_num_; }
39 int64_t video_track_num()
const {
return video_track_num_; }
46 int64_t GetVideoDefaultDuration(
const double timecode_scale_in_us)
const;
48 const std::set<int64_t>& ignored_tracks()
const {
return ignored_tracks_; }
50 const std::string& audio_encryption_key_id()
const {
51 return audio_encryption_key_id_;
54 std::shared_ptr<AudioStreamInfo> audio_stream_info() {
55 return audio_stream_info_;
58 const std::string& video_encryption_key_id()
const {
59 return video_encryption_key_id_;
62 std::shared_ptr<VideoStreamInfo> video_stream_info() {
63 return video_stream_info_;
66 typedef std::map<int, TextTrackConfig> TextTracks;
68 const TextTracks& text_tracks()
const {
75 bool OnListEnd(
int id)
override;
76 bool OnUInt(
int id, int64_t val)
override;
77 bool OnFloat(
int id,
double val)
override;
78 bool OnBinary(
int id,
const uint8_t* data,
int size)
override;
79 bool OnString(
int id,
const std::string& str)
override;
83 std::string track_name_;
84 std::string track_language_;
85 std::string codec_id_;
86 std::vector<uint8_t> codec_private_;
87 int64_t seek_preroll_;
89 int64_t default_duration_;
90 std::unique_ptr<WebMContentEncodingsClient> track_content_encodings_client_;
92 int64_t audio_track_num_;
93 int64_t audio_default_duration_;
94 int64_t video_track_num_;
95 int64_t video_default_duration_;
96 bool ignore_text_tracks_;
97 TextTracks text_tracks_;
98 std::set<int64_t> ignored_tracks_;
99 std::string audio_encryption_key_id_;
100 std::string video_encryption_key_id_;
103 std::shared_ptr<AudioStreamInfo> audio_stream_info_;
106 std::shared_ptr<VideoStreamInfo> video_stream_info_;
114 #endif // MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_