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

Issue 10803019: Chrome-side implementation of media source timestamp offset (Closed)

Created:
8 years, 5 months ago by vrk (LEFT CHROMIUM)
Modified:
8 years, 4 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Chrome-side implementation of media source timestamp offset Adds functionality to signal an offset to be applied to the buffers in ChunkDemuxer. Is not triggerable from Chrome yet. BUG=139044 TEST=media_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=148810

Patch Set 1 #

Total comments: 1

Patch Set 2 : Move logic from parser to demuxer #

Total comments: 14

Patch Set 3 : rebase ToT #

Patch Set 4 : response to CR #

Patch Set 5 : add separate sources test #

Patch Set 6 : fix windows #

Total comments: 20

Patch Set 7 : Response to CR #

Patch Set 8 : fix win_rel #

Patch Set 9 : rebase ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -20 lines) Patch
M media/base/stream_parser.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M media/filters/chunk_demuxer.h View 1 2 3 4 5 6 7 3 chunks +22 lines, -0 lines 0 comments Download
M media/filters/chunk_demuxer.cc View 1 2 3 4 5 6 7 8 10 chunks +65 lines, -9 lines 0 comments Download
M media/filters/chunk_demuxer_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +66 lines, -0 lines 0 comments Download
M media/filters/source_buffer_stream.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M media/mp4/mp4_stream_parser.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -1 line 0 comments Download
M media/mp4/mp4_stream_parser.cc View 1 2 3 4 5 6 7 8 4 chunks +10 lines, -3 lines 0 comments Download
M media/mp4/mp4_stream_parser_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -1 line 0 comments Download
M media/webm/webm_cluster_parser.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M media/webm/webm_cluster_parser.cc View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -2 lines 0 comments Download
M media/webm/webm_stream_parser.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M media/webm/webm_stream_parser.cc View 1 2 3 4 5 6 7 8 5 chunks +8 lines, -1 line 0 comments Download
M webkit/media/webmediaplayer_impl.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M webkit/media/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M webkit/media/webmediaplayer_proxy.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M webkit/media/webmediaplayer_proxy.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
vrk (LEFT CHROMIUM)
Here's what I did to implement the timestamp offset. There are many other ways to ...
8 years, 5 months ago (2012-07-18 20:37:01 UTC) #1
acolwell GONE FROM CHROMIUM
How hard would this be to implement this in ChunkDemuxer only so that you wouldn't ...
8 years, 5 months ago (2012-07-18 22:54:55 UTC) #2
vrk (LEFT CHROMIUM)
On 2012/07/18 22:54:55, acolwell wrote: > How hard would this be to implement this in ...
8 years, 5 months ago (2012-07-20 01:56:36 UTC) #3
acolwell GONE FROM CHROMIUM
This looks good to me with a few minor nits. If you add a test ...
8 years, 5 months ago (2012-07-20 18:21:01 UTC) #4
vrk (LEFT CHROMIUM)
Thanks Aaron, PTAL! I added some unit tests. https://chromiumcodereview.appspot.com/10803019/diff/16/media/filters/chunk_demuxer.cc File media/filters/chunk_demuxer.cc (right): https://chromiumcodereview.appspot.com/10803019/diff/16/media/filters/chunk_demuxer.cc#newcode1002 media/filters/chunk_demuxer.cc:1002: stream_info_map_[source_id_video_].can_update_offset ...
8 years, 4 months ago (2012-07-25 17:16:48 UTC) #5
acolwell GONE FROM CHROMIUM
LGTM % nits and don't forget to change issue title & description. https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chunk_demuxer.cc File media/filters/chunk_demuxer.cc ...
8 years, 4 months ago (2012-07-25 18:22:43 UTC) #6
vrk (LEFT CHROMIUM)
8 years, 4 months ago (2012-07-25 22:56:49 UTC) #7
Thanks for reviewing!

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
File media/filters/chunk_demuxer.cc (right):

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer.cc:818: DVLOG(1) << "TimestampOffset(" << id << ", "
<< offset << ")";
On 2012/07/25 18:22:43, acolwell wrote:
> nit: Add Set

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer.cc:824: if (!source_info_map_[id].can_update_offset)
On 2012/07/25 18:22:43, acolwell wrote:
> nit: move this above time_offset since we don't need to compute this if we
can't
> update the offset.

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer.cc:1068: CHECK_GT(source_info_map_.count(source_id),
0u);
On 2012/07/25 18:22:43, acolwell wrote:
> nit: Create a bool IsValidId(source_id) helper so we don't have this count()
> construct everywhere?

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
File media/filters/chunk_demuxer.h (right):

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer.h:25: class SourceInfo;
On 2012/07/25 18:22:43, acolwell wrote:
> nit: I don't think you need this anymore since it is declared below.

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer.h:80: bool SetTimestampOffset(const std::string& id,
float offset);
On 2012/07/25 18:22:43, acolwell wrote:
> Document return value. I'm assuming returning false means the offset wasn't
set
> because we are in the middle of parsing a media segment.

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer.h:151: // Contains state belonging to a media
source.
On 2012/07/25 18:22:43, acolwell wrote:
> s/media source/source ID?

yeah that sounds a bit better, changed!

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
File media/filters/chunk_demuxer_unittest.cc (right):

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer_unittest.cc:1807:
demuxer_->SetTimestampOffset(kSourceId, 30);
On 2012/07/25 18:22:43, acolwell wrote:
> nit: ASSERT_TRUE() here and below.

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer_unittest.cc:1818:
audio->Read(base::Bind(&OnReadDone,
On 2012/07/25 18:22:43, acolwell wrote:
> nit: I think using GenerateExpectedReads(30000, 2, audio, video) would work
and
> be fewer lines.

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer_unittest.cc:1843:
audio->Read(base::Bind(&OnReadDone,
On 2012/07/25 18:22:43, acolwell wrote:
> nit: ditto w/ different timestamp

Done.

https://chromiumcodereview.appspot.com/10803019/diff/17003/media/filters/chun...
media/filters/chunk_demuxer_unittest.cc:1881: }  // namespace media
On 2012/07/25 18:22:43, acolwell wrote:
> nit: Add a test for rejecting an offset change mid-segment.

Good idea, done.

Powered by Google App Engine
This is Rietveld 408576698