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

Side by Side Diff: media/formats/webm/webm_cluster_parser.h

Issue 447963003: Introduce DecodeTimestamp class to make it easier to distiguish presentation and decode timestamps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ 5 #ifndef MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ 6 #define MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Track(int track_num, 42 Track(int track_num,
43 bool is_video, 43 bool is_video,
44 base::TimeDelta default_duration, 44 base::TimeDelta default_duration,
45 const LogCB& log_cb); 45 const LogCB& log_cb);
46 ~Track(); 46 ~Track();
47 47
48 int track_num() const { return track_num_; } 48 int track_num() const { return track_num_; }
49 49
50 // If a buffer is currently held aside pending duration calculation, returns 50 // If a buffer is currently held aside pending duration calculation, returns
51 // its decode timestamp. Otherwise, returns kInfiniteDuration(). 51 // its decode timestamp. Otherwise, returns kInfiniteDuration().
52 base::TimeDelta GetReadyUpperBound(); 52 DecodeTimestamp GetReadyUpperBound();
53 53
54 // Prepares |ready_buffers_| for retrieval. Prior to calling, 54 // Prepares |ready_buffers_| for retrieval. Prior to calling,
55 // |ready_buffers_| must be empty. Moves all |buffers_| with timestamp 55 // |ready_buffers_| must be empty. Moves all |buffers_| with timestamp
wolenetz 2014/08/08 21:30:05 nit: s/timestamp/decode timestamp/
acolwell GONE FROM CHROMIUM 2014/08/11 17:05:06 Done.
56 // before |before_timestamp| to |ready_buffers_|, preserving their order. 56 // before |before_timestamp| to |ready_buffers_|, preserving their order.
57 void ExtractReadyBuffers(const base::TimeDelta before_timestamp); 57 void ExtractReadyBuffers(const DecodeTimestamp before_timestamp);
58 58
59 const BufferQueue& ready_buffers() const { return ready_buffers_; } 59 const BufferQueue& ready_buffers() const { return ready_buffers_; }
60 60
61 // If |last_added_buffer_missing_duration_| is set, updates its duration 61 // If |last_added_buffer_missing_duration_| is set, updates its duration
62 // relative to |buffer|'s timestamp, and adds it to |buffers_| and unsets 62 // relative to |buffer|'s timestamp, and adds it to |buffers_| and unsets
63 // |last_added_buffer_missing_duration_|. Then, if |buffer| is missing 63 // |last_added_buffer_missing_duration_|. Then, if |buffer| is missing
64 // duration, saves |buffer| into |last_added_buffer_missing_duration_|, or 64 // duration, saves |buffer| into |last_added_buffer_missing_duration_|, or
65 // otherwise adds |buffer| to |buffers_|. 65 // otherwise adds |buffer| to |buffers_|.
66 bool AddBuffer(const scoped_refptr<StreamParserBuffer>& buffer); 66 bool AddBuffer(const scoped_refptr<StreamParserBuffer>& buffer);
67 67
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 Track audio_; 251 Track audio_;
252 Track video_; 252 Track video_;
253 TextTrackMap text_track_map_; 253 TextTrackMap text_track_map_;
254 254
255 // Subset of |text_track_map_| maintained by GetTextBuffers(), and cleared by 255 // Subset of |text_track_map_| maintained by GetTextBuffers(), and cleared by
256 // ClearTextTrackReadyBuffers(). Callers of GetTextBuffers() get a const-ref 256 // ClearTextTrackReadyBuffers(). Callers of GetTextBuffers() get a const-ref
257 // to this member. 257 // to this member.
258 TextBufferQueueMap text_buffers_map_; 258 TextBufferQueueMap text_buffers_map_;
259 259
260 // Limits the range of buffers returned by Get{Audio,Video,Text}Buffers() to 260 // Limits the range of buffers returned by Get{Audio,Video,Text}Buffers() to
261 // this exclusive upper bound. Set to kNoTimestamp(), meaning not yet 261 // this exclusive upper bound. Set to kNoTimestamp(), meaning not yet
wolenetz 2014/08/08 21:30:05 nit: s/kNoTimestamp()/kNoDecodeTimestamp()/
acolwell GONE FROM CHROMIUM 2014/08/11 17:05:06 Done.
262 // calculated, by Reset() and Parse(). If kNoTimestamp(), then 262 // calculated, by Reset() and Parse(). If kNoTimestamp(), then
wolenetz 2014/08/08 21:30:05 nit: ditto
acolwell GONE FROM CHROMIUM 2014/08/11 17:05:06 Done.
263 // Get{Audio,Video,Text}Buffers() will calculate it to be the minimum (decode) 263 // Get{Audio,Video,Text}Buffers() will calculate it to be the minimum (decode)
264 // timestamp across all tracks' |last_buffer_missing_duration_|, or 264 // timestamp across all tracks' |last_buffer_missing_duration_|, or
265 // kInfiniteDuration() if no buffers are currently missing duration. 265 // kInfiniteDuration() if no buffers are currently missing duration.
266 base::TimeDelta ready_buffer_upper_bound_; 266 DecodeTimestamp ready_buffer_upper_bound_;
267 267
268 LogCB log_cb_; 268 LogCB log_cb_;
269 269
270 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); 270 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser);
271 }; 271 };
272 272
273 } // namespace media 273 } // namespace media
274 274
275 #endif // MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_ 275 #endif // MEDIA_FORMATS_WEBM_WEBM_CLUSTER_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698