Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Unified Diff: media/formats/webm/tracks_builder.h

Issue 213153008: MSE: Parse WebM TrackEntry DefaultDuration field (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/formats/webm/tracks_builder.cc » ('j') | media/formats/webm/tracks_builder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/tracks_builder.h
diff --git a/media/formats/webm/tracks_builder.h b/media/formats/webm/tracks_builder.h
index ecd0fe5ce0a2740fe9dec8f5eb43db54b98c83d2..60ecc6be2e71728e5b3bca9faf4f0a0c4cc64aa5 100644
--- a/media/formats/webm/tracks_builder.h
+++ b/media/formats/webm/tracks_builder.h
@@ -18,9 +18,16 @@ class TracksBuilder {
TracksBuilder();
~TracksBuilder();
+ // Only a non-negative |default_duration| will result in a serialized
+ // kWebMIdDefaultDuration element. Note, 0 is allowed here for testing, but it
+ // is an illegal value for DefaultDuration. Similar applies to
+ // |audio_channels|, |audio_sampling_frequency|, |video_pixel_width| and
+ // |video_pixel_height|.
void AddTrack(int track_num, int track_type, int track_uid,
const std::string& codec_id, const std::string& name,
- const std::string& language);
+ const std::string& language, int default_duration,
+ int video_pixel_width, int video_pixel_height,
+ int audio_channels, double audio_sampling_frequency);
std::vector<uint8> Finish();
@@ -33,12 +40,16 @@ class TracksBuilder {
public:
Track(int track_num, int track_type, int track_uid,
const std::string& codec_id, const std::string& name,
- const std::string& language);
+ const std::string& language, int default_duration,
+ int video_pixel_width, int video_pixel_height,
+ int audio_channels, double audio_sampling_frequency);
int GetSize() const;
void Write(uint8** buf, int* buf_size) const;
private:
int GetPayloadSize() const;
+ int GetVideoPayloadSize() const;
+ int GetAudioPayloadSize() const;
int track_num_;
int track_type_;
@@ -46,6 +57,11 @@ class TracksBuilder {
std::string codec_id_;
std::string name_;
std::string language_;
+ int default_duration_;
+ int video_pixel_width_;
+ int video_pixel_height_;
+ int audio_channels_;
+ double audio_sampling_frequency_;
};
typedef std::list<Track> TrackList;
« no previous file with comments | « no previous file | media/formats/webm/tracks_builder.cc » ('j') | media/formats/webm/tracks_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698