Chromium Code Reviews| Index: media/filters/frame_processor.cc |
| diff --git a/media/filters/frame_processor.cc b/media/filters/frame_processor.cc |
| index 6b6c8c34519268c8d59ab668aa1e64307f05df6b..ae33a48d9064f816d2adc3ee48e9e032c3a8494a 100644 |
| --- a/media/filters/frame_processor.cc |
| +++ b/media/filters/frame_processor.cc |
| @@ -23,10 +23,10 @@ class MseTrackBuffer { |
| ~MseTrackBuffer(); |
| // Get/set |last_decode_timestamp_|. |
| - base::TimeDelta last_decode_timestamp() const { |
| + DecodeTimestamp last_decode_timestamp() const { |
| return last_decode_timestamp_; |
| } |
| - void set_last_decode_timestamp(base::TimeDelta timestamp) { |
| + void set_last_decode_timestamp(DecodeTimestamp timestamp) { |
| last_decode_timestamp_ = timestamp; |
| } |
| @@ -78,7 +78,7 @@ class MseTrackBuffer { |
| private: |
| // The decode timestamp of the last coded frame appended in the current coded |
| // frame group. Initially kNoTimestamp(), meaning "unset". |
| - base::TimeDelta last_decode_timestamp_; |
| + DecodeTimestamp last_decode_timestamp_; |
| // The coded frame duration of the last coded frame appended in the current |
| // coded frame group. Initially kNoTimestamp(), meaning "unset". |
| @@ -108,7 +108,7 @@ class MseTrackBuffer { |
| }; |
| MseTrackBuffer::MseTrackBuffer(ChunkDemuxerStream* stream) |
| - : last_decode_timestamp_(kNoTimestamp()), |
| + : last_decode_timestamp_(kNoDecodeTimestamp()), |
| last_frame_duration_(kNoTimestamp()), |
| highest_presentation_timestamp_(kNoTimestamp()), |
| needs_random_access_point_(true), |
| @@ -123,7 +123,7 @@ MseTrackBuffer::~MseTrackBuffer() { |
| void MseTrackBuffer::Reset() { |
| DVLOG(2) << __FUNCTION__ << "()"; |
| - last_decode_timestamp_ = kNoTimestamp(); |
| + last_decode_timestamp_ = kNoDecodeTimestamp(); |
| last_frame_duration_ = kNoTimestamp(); |
| highest_presentation_timestamp_ = kNoTimestamp(); |
| needs_random_access_point_ = true; |
| @@ -302,7 +302,7 @@ MseTrackBuffer* FrameProcessor::FindTrack(StreamParser::TrackId id) { |
| } |
| void FrameProcessor::NotifyNewMediaSegmentStarting( |
| - base::TimeDelta segment_timestamp) { |
| + DecodeTimestamp segment_timestamp) { |
| DVLOG(2) << __FUNCTION__ << "(" << segment_timestamp.InSecondsF() << ")"; |
| for (TrackBufferMap::iterator itr = track_buffers_.begin(); |
| @@ -390,7 +390,8 @@ bool FrameProcessor::HandlePartialAppendWindowTrimming( |
| // Adjust the timestamp of this buffer forward to |append_window_start| and |
| // decrease the duration to compensate. |
| buffer->set_timestamp(append_window_start); |
| - buffer->SetDecodeTimestamp(append_window_start); |
| + buffer->SetDecodeTimestamp( |
| + DecodeTimestamp::FromPresentationTime(append_window_start)); |
| buffer->set_duration(frame_end_timestamp - append_window_start); |
| processed_buffer = true; |
| } |
| @@ -436,7 +437,7 @@ bool FrameProcessor::ProcessFrame( |
| // of the coded frame's duration in seconds. |
| // We use base::TimeDelta instead of double. |
|
wolenetz
2014/08/08 21:30:04
nit: s/instead/and DecodeTimestamp instead/
acolwell GONE FROM CHROMIUM
2014/08/11 17:05:05
Done.
|
| base::TimeDelta presentation_timestamp = frame->timestamp(); |
| - base::TimeDelta decode_timestamp = frame->GetDecodeTimestamp(); |
| + DecodeTimestamp decode_timestamp = frame->GetDecodeTimestamp(); |
| base::TimeDelta frame_duration = frame->duration(); |
| DVLOG(3) << __FUNCTION__ << ": Processing frame " |
| @@ -452,11 +453,11 @@ bool FrameProcessor::ProcessFrame( |
| DVLOG(2) << __FUNCTION__ << ": Unknown frame PTS"; |
| return false; |
| } |
| - if (decode_timestamp == kNoTimestamp()) { |
| + if (decode_timestamp == kNoDecodeTimestamp()) { |
| DVLOG(2) << __FUNCTION__ << ": Unknown frame DTS"; |
| return false; |
| } |
| - if (decode_timestamp > presentation_timestamp) { |
| + if (decode_timestamp.ToPresentationTime() > presentation_timestamp) { |
| // TODO(wolenetz): Determine whether DTS>PTS should really be allowed. See |
| // http://crbug.com/354518. |
| DVLOG(2) << __FUNCTION__ << ": WARNING: Frame DTS(" |
| @@ -544,9 +545,9 @@ bool FrameProcessor::ProcessFrame( |
| // If last decode timestamp for track buffer is set and the difference |
| // between decode timestamp and last decode timestamp is greater than 2 |
| // times last frame duration: |
| - base::TimeDelta last_decode_timestamp = |
| + DecodeTimestamp last_decode_timestamp = |
| track_buffer->last_decode_timestamp(); |
| - if (last_decode_timestamp != kNoTimestamp()) { |
| + if (last_decode_timestamp != kNoDecodeTimestamp()) { |
| base::TimeDelta dts_delta = decode_timestamp - last_decode_timestamp; |
| if (dts_delta < base::TimeDelta() || |
| dts_delta > 2 * track_buffer->last_frame_duration()) { |
| @@ -626,7 +627,7 @@ bool FrameProcessor::ProcessFrame( |
| // presentation start time, then run the end of stream algorithm with the |
| // error parameter set to "decode", and abort these steps. |
| DCHECK(presentation_timestamp >= base::TimeDelta()); |
| - if (decode_timestamp < base::TimeDelta()) { |
| + if (decode_timestamp < DecodeTimestamp()) { |
| // B-frames may still result in negative DTS here after being shifted by |
| // |timestamp_offset_|. |
| DVLOG(2) << __FUNCTION__ |