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

Unified Diff: media/base/stream_parser_buffer.cc

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: Address CR comments 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 side-by-side diff with in-line comments
Download patch
Index: media/base/stream_parser_buffer.cc
diff --git a/media/base/stream_parser_buffer.cc b/media/base/stream_parser_buffer.cc
index ae826594d5e09504f11b69ffb14f6f4ac2403a92..a9a12e397823c3f0a9dc56bc36eaaaea4591bce5 100644
--- a/media/base/stream_parser_buffer.cc
+++ b/media/base/stream_parser_buffer.cc
@@ -61,13 +61,13 @@ scoped_refptr<StreamParserBuffer> StreamParserBuffer::CopyFrom(
is_keyframe, type, track_id));
}
-base::TimeDelta StreamParserBuffer::GetDecodeTimestamp() const {
- if (decode_timestamp_ == kNoTimestamp())
- return timestamp();
+DecodeTimestamp StreamParserBuffer::GetDecodeTimestamp() const {
+ if (decode_timestamp_ == kNoDecodeTimestamp())
+ return DecodeTimestamp::FromPresentationTime(timestamp());
return decode_timestamp_;
}
-void StreamParserBuffer::SetDecodeTimestamp(base::TimeDelta timestamp) {
+void StreamParserBuffer::SetDecodeTimestamp(DecodeTimestamp timestamp) {
decode_timestamp_ = timestamp;
if (preroll_buffer_)
preroll_buffer_->SetDecodeTimestamp(timestamp);
@@ -79,7 +79,7 @@ StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size,
Type type, TrackId track_id)
: DecoderBuffer(data, data_size, side_data, side_data_size),
is_keyframe_(is_keyframe),
- decode_timestamp_(kNoTimestamp()),
+ decode_timestamp_(kNoDecodeTimestamp()),
config_id_(kInvalidConfigId),
type_(type),
track_id_(track_id) {

Powered by Google App Engine
This is Rietveld 408576698