5 #ifndef MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_
13 #include "packager/base/compiler_specific.h"
14 #include "packager/base/memory/scoped_ptr.h"
15 #include "packager/base/time/time.h"
16 #include "packager/media/base/audio_stream_info.h"
17 #include "packager/media/base/text_track_config.h"
18 #include "packager/media/base/video_stream_info.h"
19 #include "packager/media/formats/webm/webm_audio_client.h"
20 #include "packager/media/formats/webm/webm_content_encodings_client.h"
21 #include "packager/media/formats/webm/webm_parser.h"
22 #include "packager/media/formats/webm/webm_video_client.h"
24 namespace edash_packager {
38 int Parse(
const uint8_t* buf,
int size);
40 int64_t audio_track_num()
const {
return audio_track_num_; }
41 int64_t video_track_num()
const {
return video_track_num_; }
47 int64_t GetAudioDefaultDuration(
const double timecode_scale_in_us)
const;
48 int64_t GetVideoDefaultDuration(
const double timecode_scale_in_us)
const;
50 const std::set<int64_t>& ignored_tracks()
const {
return ignored_tracks_; }
52 const std::string& audio_encryption_key_id()
const {
53 return audio_encryption_key_id_;
56 scoped_refptr<AudioStreamInfo> audio_stream_info() {
57 return audio_stream_info_;
60 const std::string& video_encryption_key_id()
const {
61 return video_encryption_key_id_;
64 scoped_refptr<VideoStreamInfo> video_stream_info() {
65 return video_stream_info_;
68 typedef std::map<int, TextTrackConfig> TextTracks;
70 const TextTracks& text_tracks()
const {
77 bool OnListEnd(
int id)
override;
78 bool OnUInt(
int id, int64_t val)
override;
79 bool OnFloat(
int id,
double val)
override;
80 bool OnBinary(
int id,
const uint8_t* data,
int size)
override;
81 bool OnString(
int id,
const std::string& str)
override;
85 std::string track_name_;
86 std::string track_language_;
87 std::string codec_id_;
88 std::vector<uint8_t> codec_private_;
89 int64_t seek_preroll_;
91 int64_t default_duration_;
92 scoped_ptr<WebMContentEncodingsClient> track_content_encodings_client_;
94 int64_t audio_track_num_;
95 int64_t audio_default_duration_;
96 int64_t video_track_num_;
97 int64_t video_default_duration_;
98 bool ignore_text_tracks_;
99 TextTracks text_tracks_;
100 std::set<int64_t> ignored_tracks_;
101 std::string audio_encryption_key_id_;
102 std::string video_encryption_key_id_;
105 scoped_refptr<AudioStreamInfo> audio_stream_info_;
108 scoped_refptr<VideoStreamInfo> video_stream_info_;
116 #endif // MEDIA_FORMATS_WEBM_WEBM_TRACKS_PARSER_H_