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

Unified Diff: media/formats/mp2t/mp2t_stream_parser.cc

Issue 364823008: Mpeg2TS - estimate duration for video frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/formats/mp2t/mp2t_stream_parser.cc
diff --git a/media/formats/mp2t/mp2t_stream_parser.cc b/media/formats/mp2t/mp2t_stream_parser.cc
index 48497559d6a4bd502e9a72dba56eb29e71da2caf..ade9eb52b8bf9f66679059843909126e9dc92a8a 100644
--- a/media/formats/mp2t/mp2t_stream_parser.cc
+++ b/media/formats/mp2t/mp2t_stream_parser.cc
@@ -505,7 +505,9 @@ void Mp2tStreamParser::OnEmitAudioBuffer(
<< " dts="
<< stream_parser_buffer->GetDecodeTimestamp().InMilliseconds()
<< " pts="
- << stream_parser_buffer->timestamp().InMilliseconds();
+ << stream_parser_buffer->timestamp().InMilliseconds()
+ << " dur="
+ << stream_parser_buffer->duration().InMilliseconds();
stream_parser_buffer->set_timestamp(
stream_parser_buffer->timestamp() - time_offset_);
stream_parser_buffer->SetDecodeTimestamp(
@@ -533,6 +535,8 @@ void Mp2tStreamParser::OnEmitVideoBuffer(
<< stream_parser_buffer->GetDecodeTimestamp().InMilliseconds()
<< " pts="
<< stream_parser_buffer->timestamp().InMilliseconds()
+ << " dur="
+ << stream_parser_buffer->duration().InMilliseconds()
<< " IsKeyframe="
<< stream_parser_buffer->IsKeyframe();
stream_parser_buffer->set_timestamp(
@@ -652,6 +656,7 @@ void Mp2tStreamParser::FillVideoGap(
stream_parser_buffer->track_id());
frame->SetDecodeTimestamp(discarded_frames_dts_.front());
frame->set_timestamp(pts);
+ frame->set_duration(pts_delta);
buffer_queue_chain_.back().video_queue.push_back(frame);
pts += pts_delta;
discarded_frames_dts_.pop_front();
« media/formats/mp2t/es_parser_h264.cc ('K') | « media/formats/mp2t/es_parser_h264.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698