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

Issue 539343002: Make the timestamp unroll offset consistent accross PES pids. (Closed)

Created:
6 years, 3 months ago by damienv1
Modified:
6 years, 3 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Make the timestamp unroll offset consistent accross PES pids. BUG=411015 Committed: https://crrev.com/97fd1b87e604ff82db4f6dc84d1cf945e9854094 Cr-Commit-Position: refs/heads/master@{#295129}

Patch Set 1 #

Patch Set 2 : Missing timestamp unroller. #

Total comments: 1

Patch Set 3 : Prevent negative timestamps. #

Total comments: 4

Patch Set 4 : Remove the global timestamp offset from this CL. #

Total comments: 2

Patch Set 5 : Add unit test and cleanup timestamp unroller. #

Total comments: 13

Patch Set 6 : Rebase. #

Patch Set 7 : Another rebase. #

Patch Set 8 : Fix CR comments from patch set #5. #

Total comments: 1

Patch Set 9 : Fix CR comments from patch set #8. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -84 lines) Patch
M media/BUILD.gn View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M media/formats/mp2t/es_parser_adts.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M media/formats/mp2t/mp2t_stream_parser.h View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M media/formats/mp2t/mp2t_stream_parser.cc View 1 2 3 4 5 6 7 4 chunks +4 lines, -9 lines 0 comments Download
A media/formats/mp2t/timestamp_unroller.h View 1 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A media/formats/mp2t/timestamp_unroller.cc View 1 2 3 4 5 6 7 8 1 chunk +93 lines, -0 lines 0 comments Download
A media/formats/mp2t/timestamp_unroller_unittest.cc View 1 2 3 4 1 chunk +58 lines, -0 lines 0 comments Download
M media/formats/mp2t/ts_section_pes.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -5 lines 0 comments Download
M media/formats/mp2t/ts_section_pes.cc View 4 chunks +9 lines, -69 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (6 generated)
damienv1
Note: will add a timestamp_unroller_unittest in an upcoming patch. Thanks for the review.
6 years, 3 months ago (2014-09-04 21:37:23 UTC) #2
wolenetz
I mostly have questions related to "what exact problem are we trying to solve here?" ...
6 years, 3 months ago (2014-09-05 21:18:50 UTC) #3
damienv1
There was 2 possible problems: 1) first, in the previous implementation, the MPEG2 TS timestamp ...
6 years, 3 months ago (2014-09-05 21:52:03 UTC) #4
damienv1
https://codereview.chromium.org/539343002/diff/60001/media/formats/mp2t/mp2t_stream_parser.cc File media/formats/mp2t/mp2t_stream_parser.cc (right): https://codereview.chromium.org/539343002/diff/60001/media/formats/mp2t/mp2t_stream_parser.cc#newcode586 media/formats/mp2t/mp2t_stream_parser.cc:586: Remove line. https://codereview.chromium.org/539343002/diff/60001/media/formats/mp2t/ts_section_pes.h File media/formats/mp2t/ts_section_pes.h (right): https://codereview.chromium.org/539343002/diff/60001/media/formats/mp2t/ts_section_pes.h#newcode22 media/formats/mp2t/ts_section_pes.h:22: explicit ...
6 years, 3 months ago (2014-09-05 23:02:20 UTC) #5
damienv1
Please take another look. Thanks ! This CL now only addresses the problem of consistent ...
6 years, 3 months ago (2014-09-06 00:25:21 UTC) #6
wolenetz
Looking pretty good. By 'global offset', I assume you mean hooking up FrameProcessor's discontinuity detection ...
6 years, 3 months ago (2014-09-15 22:15:40 UTC) #7
damienv1
Thanks for the review. Please see my comments. https://codereview.chromium.org/539343002/diff/80001/media/formats/mp2t/mp2t_stream_parser.cc File media/formats/mp2t/mp2t_stream_parser.cc (right): https://codereview.chromium.org/539343002/diff/80001/media/formats/mp2t/mp2t_stream_parser.cc#newcode586 media/formats/mp2t/mp2t_stream_parser.cc:586: Remove ...
6 years, 3 months ago (2014-09-15 22:27:36 UTC) #8
wolenetz
lgtm % my previous nits and the comment being updated. From chat, we need to ...
6 years, 3 months ago (2014-09-15 23:24:36 UTC) #9
damienv1
Thanks for the review ! If no other comments, I'll merge the CL around noon.
6 years, 3 months ago (2014-09-16 16:29:15 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/539343002/140001
6 years, 3 months ago (2014-09-16 17:55:09 UTC) #12
wolenetz
still lgtm % a further nit introduced since PS5: https://codereview.chromium.org/539343002/diff/140001/media/formats/mp2t/timestamp_unroller.cc File media/formats/mp2t/timestamp_unroller.cc (right): https://codereview.chromium.org/539343002/diff/140001/media/formats/mp2t/timestamp_unroller.cc#newcode41 media/formats/mp2t/timestamp_unroller.cc:41: ...
6 years, 3 months ago (2014-09-16 17:56:16 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/539343002/160001
6 years, 3 months ago (2014-09-16 19:04:46 UTC) #18
commit-bot: I haz the power
Committed patchset #9 (id:160001) as 1b7fe9a5d3ecd6eba947f92d50580084c180321c
6 years, 3 months ago (2014-09-16 19:47:18 UTC) #19
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/97fd1b87e604ff82db4f6dc84d1cf945e9854094 Cr-Commit-Position: refs/heads/master@{#295129}
6 years, 3 months ago (2014-09-16 19:47:59 UTC) #20
wolenetz
6 years, 3 months ago (2014-09-16 21:22:56 UTC) #21
Message was sent while issue was closed.
On 2014/09/15 23:24:36, wolenetz wrote:
> lgtm % my previous nits and the comment being updated.
> From chat, we need to nail down potential ambiguity in the MSE byte stream
> registry for mp2ts around offset management: 
> * is audio/video parsing order deterministic (streamparser api will eventually
> require non-decreasing DTS buffers across buffers across all streams within a
> media segment)?
> * how exactly do SourceBuffer's "sequence" appendMode's updating of the
> js-visible SourceBuffer.timestampOffset interact with the js-invisible
> mp2tsoffset?
> 
> These are orthogonal to this CL; damienv@ to follow-up separately, including
the
> possible need to make the mp2ts parser behavior compliant with non-decreasing
> DTS buffer emission within a segment.

I followed-up on these orthogonal questions with acolwell@:
1. mp2ts parser should emit buffers across streams in a non-decreasing decode
timestamp order. While the current StreamParser NewBuffersCB interface
partitions audio vs video vs text buffers, the parser internally must hold back
buffers from emission until it is sure that the buffer can be emitted without
another stream then emitting a buffer with lower DTS. The threshold for holding
back should be somewhere in mpeg2ts specifications (outside MSE), along the
lines of ~1 second. So processing (& emitting) buffers in stream order without
any such hold-back may cause unexpected coded frame processing algorithm
behavior further along the pipeline. Eventually, the interface for NewBuffersCB
will enforce this (see https://crbug.com/338484).

2. I was incorrectly conflating coded-frame-processing-algorithm's discontinuity
detection with mpeg2-ts-bytestream-mse-spec discontinuity. mp2ts stream parser
must handle the explicit TS "discontinuity flag" as well as 2^33 wraparound. The
internal mpeg2_timestampoffset should start at 0 and *only* become nonzero by
one of those two types of discontinuities. Further along in the pipeline, the
coded frame processing algorithm will do the usual discontinuity detection, too.

Powered by Google App Engine
This is Rietveld 408576698