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

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

Issue 230173002: Fix WebM parser not to wait for a next frame when DefaultDuration is specified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/webm_cluster_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_cluster_parser.h
diff --git a/media/formats/webm/webm_cluster_parser.h b/media/formats/webm/webm_cluster_parser.h
index 749b6bdb48b8fd96a92d0aea3de37356fb9df484..5657e9054701e3115be3025f9e7a1511e5496dee 100644
--- a/media/formats/webm/webm_cluster_parser.h
+++ b/media/formats/webm/webm_cluster_parser.h
@@ -43,13 +43,12 @@ class MEDIA_EXPORT WebMClusterParser : public WebMParserClient {
// otherwise adds |buffer| to |buffers_|.
bool AddBuffer(const scoped_refptr<StreamParserBuffer>& buffer);
- // If |last_added_buffer_missing_duration_| is set, updates its duration
- // to be the first non-kNoTimestamp() value of |default_duration_|,
- // |estimated_next_frame_duration_|, or an arbitrary default, then adds it
- // to |buffers_| and unsets |last_added_buffer_missing_duration_|. (This
- // method helps stream parser emit all buffers in a media segment before
- // signaling end of segment.)
- void ApplyDurationDefaultOrEstimateIfNeeded();
+ // If |last_added_buffer_missing_duration_| is set, updates its duration to
+ // be non-kNoTimestamp() value of |estimated_next_frame_duration_| or an
+ // arbitrary default, then adds it to |buffers_| and unsets
+ // |last_added_buffer_missing_duration_|. (This method helps stream parser
+ // emit all buffers in a media segment before signaling end of segment.)
+ void ApplyDurationEstimateIfNeeded();
// Clears all buffer state, except a possibly held-aside buffer that is
// missing duration.
@@ -65,6 +64,8 @@ class MEDIA_EXPORT WebMClusterParser : public WebMParserClient {
// |size| indicates the number of bytes in |data|.
bool IsKeyframe(const uint8* data, int size) const;
+ base::TimeDelta default_duration() const { return default_duration_; }
+
private:
// Helper that sanity-checks |buffer| duration, updates
// |estimated_next_frame_duration_|, and adds |buffer| to |buffers_|.
@@ -73,8 +74,8 @@ class MEDIA_EXPORT WebMClusterParser : public WebMParserClient {
bool QueueBuffer(const scoped_refptr<StreamParserBuffer>& buffer);
// Helper that calculates the buffer duration to use in
- // ApplyDurationDefaultOrEstimateIfNeeded().
- base::TimeDelta GetDurationDefaultOrEstimate();
+ // ApplyDurationEstimateIfNeeded().
+ base::TimeDelta GetDurationEstimate();
int track_num_;
std::deque<scoped_refptr<StreamParserBuffer> > buffers_;
@@ -86,6 +87,9 @@ class MEDIA_EXPORT WebMClusterParser : public WebMParserClient {
// If kNoTimestamp(), then a default value will be used. This estimate is
// the maximum duration seen or derived so far for this track, and is valid
// only if |default_duration_| is kNoTimestamp().
+ //
+ // TODO(wolenetz): Add unittests for duration estimation and default
+ // duration handling. http://crbug.com/361786 .
base::TimeDelta estimated_next_frame_duration_;
};
« no previous file with comments | « no previous file | media/formats/webm/webm_cluster_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698