diff options
author | servolk <servolk@chromium.org> | 2015-07-30 14:47:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-30 21:47:55 +0000 |
commit | 27ee45cba92dd4c6297233e341580d8d6e1c5cd9 (patch) | |
tree | 4b9e6610e5acf31496eeeefdada4588e7dd0ee4f /media | |
parent | 053db6908ab5ef1b1abe404535331ac7b6ed1db0 (diff) | |
download | chromium_src-27ee45cba92dd4c6297233e341580d8d6e1c5cd9.zip chromium_src-27ee45cba92dd4c6297233e341580d8d6e1c5cd9.tar.gz chromium_src-27ee45cba92dd4c6297233e341580d8d6e1c5cd9.tar.bz2 |
Media: Nicer MSE append logging
Make MSE append logging a little nicer by not repeating
redundant information if the video stream doesn't contain
B-frames and presentation timestamps match decode
timestamps.
BUG=none
Review URL: https://codereview.chromium.org/1261423002
Cr-Commit-Position: refs/heads/master@{#341200}
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/source_buffer_stream.cc | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/media/filters/source_buffer_stream.cc b/media/filters/source_buffer_stream.cc index fa10c37..75c9c31f 100644 --- a/media/filters/source_buffer_stream.cc +++ b/media/filters/source_buffer_stream.cc @@ -89,6 +89,26 @@ std::string RangesToString(const SourceBufferStream::RangeList& ranges) { return ss.str(); } +std::string BufferQueueToLogString( + const SourceBufferStream::BufferQueue& buffers) { + std::stringstream result; + if (buffers.front()->GetDecodeTimestamp().InMicroseconds() == + buffers.front()->timestamp().InMicroseconds() && + buffers.back()->GetDecodeTimestamp().InMicroseconds() == + buffers.back()->timestamp().InMicroseconds()) { + result << "dts/pts=[" << buffers.front()->timestamp().InSecondsF() << ";" + << buffers.back()->timestamp().InSecondsF() << "(last frame dur=" + << buffers.back()->duration().InSecondsF() << ")]"; + } else { + result << "dts=[" << buffers.front()->GetDecodeTimestamp().InSecondsF() + << ";" << buffers.back()->GetDecodeTimestamp().InSecondsF() + << "] pts=[" << buffers.front()->timestamp().InSecondsF() << ";" + << buffers.back()->timestamp().InSecondsF() << "(last frame dur=" + << buffers.back()->duration().InSecondsF() << ")]"; + } + return result.str(); +} + SourceBufferRange::GapPolicy TypeToGapPolicy(SourceBufferStream::Type type) { switch (type) { case SourceBufferStream::kAudio: @@ -229,12 +249,8 @@ bool SourceBufferStream::Append(const BufferQueue& buffers) { DCHECK(media_segment_start_time_ <= buffers.front()->GetDecodeTimestamp()); DCHECK(!end_of_stream_); - DVLOG(1) << __FUNCTION__ << " " << GetStreamTypeName() << ": buffers dts=[" - << buffers.front()->GetDecodeTimestamp().InSecondsF() << ";" - << buffers.back()->GetDecodeTimestamp().InSecondsF() << "] pts=[" - << buffers.front()->timestamp().InSecondsF() << ";" - << buffers.back()->timestamp().InSecondsF() << "(last frame dur=" - << buffers.back()->duration().InSecondsF() << ")]"; + DVLOG(1) << __FUNCTION__ << " " << GetStreamTypeName() + << ": buffers " << BufferQueueToLogString(buffers); // New media segments must begin with a keyframe. // TODO(wolenetz): Relax this requirement. See http://crbug.com/229412. |