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

Issue 246853005: Fix SPS/PPS insertion logic in MP4StreamParser. (Closed)

Created:
6 years, 8 months ago by acolwell GONE FROM CHROMIUM
Modified:
6 years, 8 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Fix SPS/PPS insertion logic in MP4StreamParser. The code that inserts SPS & PPS NAL units into keyframes wasn't properly handling frames that start with AUD NAL units. This patch adds code to make sure the configuration data is inserted after the AUD NAL units as the H.264 spec mandates. I've also added AVC::IsValidAnnexB() DCHECKS to verify that our code generates proper Annex B data that conforms to the NAL unit ordering rules outlined in the spec. These DCHECKS caught the old bad behavior and should help prevent future regressions. BUG=364925 TEST=AVCConversionTest.NALUSizeTooLarge, AVCConversionTest.NALUSizeIsZero, AVCConversionTest.ValidAnnexBConstructs, AVCConversionTest.InvalidAnnexBConstructs, AVCConversionTest.InsertParamSetsAnnexB Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266316

Patch Set 1 #

Patch Set 2 : Add a bunch of tests #

Total comments: 1

Patch Set 3 : Make IsValidAnnexB() more permissive #

Patch Set 4 : Move typedef in test to try to make the Android bot happy. #

Total comments: 18

Patch Set 5 : Rebase #

Patch Set 6 : Address CR comments #

Total comments: 29

Patch Set 7 : Address CR comments. #

Total comments: 4

Patch Set 8 : Address CR comments #

Patch Set 9 : Fix Android compiler error. #

Patch Set 10 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+541 lines, -16 lines) Patch
M media/filters/h264_parser.h View 2 chunks +11 lines, -0 lines 0 comments Download
M media/formats/mp4/avc.h View 1 2 3 4 5 6 2 chunks +20 lines, -1 line 0 comments Download
M media/formats/mp4/avc.cc View 1 2 3 4 5 6 7 8 6 chunks +216 lines, -2 lines 0 comments Download
M media/formats/mp4/avc_unittest.cc View 1 2 3 4 5 6 3 chunks +285 lines, -7 lines 0 comments Download
M media/formats/mp4/mp4_stream_parser.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -6 lines 0 comments Download
M media/formats/mp4/mp4_stream_parser_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
acolwell GONE FROM CHROMIUM
6 years, 8 months ago (2014-04-22 23:06:10 UTC) #1
damienv1
https://codereview.chromium.org/246853005/diff/20001/media/formats/mp4/mp4_stream_parser.cc File media/formats/mp4/mp4_stream_parser.cc (right): https://codereview.chromium.org/246853005/diff/20001/media/formats/mp4/mp4_stream_parser.cc#newcode370 media/formats/mp4/mp4_stream_parser.cc:370: if (!subsamples->empty()) Would be nice if InsertParamSetsAnnexB returns the ...
6 years, 8 months ago (2014-04-23 00:20:46 UTC) #2
acolwell GONE FROM CHROMIUM
After chatting w/ Damien and rereading the relevant parts of the spec, I believe the ...
6 years, 8 months ago (2014-04-23 16:38:13 UTC) #3
acolwell GONE FROM CHROMIUM
PTAL. The verification state machine is much simpler now and only enforces the constraints explicitly ...
6 years, 8 months ago (2014-04-23 17:37:27 UTC) #4
damienv1
https://codereview.chromium.org/246853005/diff/60001/media/formats/mp4/avc.cc File media/formats/mp4/avc.cc (right): https://codereview.chromium.org/246853005/diff/60001/media/formats/mp4/avc.cc#newcode31 media/formats/mp4/avc.cc:31: DVLOG(1) << __FUNCTION__ << " nal_size is 0"; nit: ...
6 years, 8 months ago (2014-04-23 19:07:28 UTC) #5
damienv1
https://codereview.chromium.org/246853005/diff/60001/media/formats/mp4/avc.cc File media/formats/mp4/avc.cc (right): https://codereview.chromium.org/246853005/diff/60001/media/formats/mp4/avc.cc#newcode31 media/formats/mp4/avc.cc:31: DVLOG(1) << __FUNCTION__ << " nal_size is 0"; nit: ...
6 years, 8 months ago (2014-04-23 19:07:28 UTC) #6
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/246853005/diff/60001/media/formats/mp4/avc.cc File media/formats/mp4/avc.cc (right): https://codereview.chromium.org/246853005/diff/60001/media/formats/mp4/avc.cc#newcode31 media/formats/mp4/avc.cc:31: DVLOG(1) << __FUNCTION__ << " nal_size is 0"; On ...
6 years, 8 months ago (2014-04-23 23:06:52 UTC) #7
damienv1
https://codereview.chromium.org/246853005/diff/120001/media/formats/mp4/avc.cc File media/formats/mp4/avc.cc (right): https://codereview.chromium.org/246853005/diff/120001/media/formats/mp4/avc.cc#newcode97 media/formats/mp4/avc.cc:97: subsamples_insert_point++; I don't think the logic is correct here ...
6 years, 8 months ago (2014-04-24 00:03:57 UTC) #8
scherkus (not reviewing)
lgtm w/ nits I'll leave it up to damien to verify the detailed h264 bitstream ...
6 years, 8 months ago (2014-04-24 17:16:35 UTC) #9
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/246853005/diff/120001/media/formats/mp4/avc.cc File media/formats/mp4/avc.cc (right): https://codereview.chromium.org/246853005/diff/120001/media/formats/mp4/avc.cc#newcode31 media/formats/mp4/avc.cc:31: DVLOG(1) << " nal_size is 0"; On 2014/04/24 17:16:35, ...
6 years, 8 months ago (2014-04-24 23:52:14 UTC) #10
damienv1
lgtm https://codereview.chromium.org/246853005/diff/140001/media/formats/mp4/avc.cc File media/formats/mp4/avc.cc (right): https://codereview.chromium.org/246853005/diff/140001/media/formats/mp4/avc.cc#newcode99 media/formats/mp4/avc.cc:99: config_insert_point - buffer->begin()); I first suggested a DCHECK. ...
6 years, 8 months ago (2014-04-25 00:11:39 UTC) #11
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/246853005/diff/140001/media/formats/mp4/avc.cc File media/formats/mp4/avc.cc (right): https://codereview.chromium.org/246853005/diff/140001/media/formats/mp4/avc.cc#newcode99 media/formats/mp4/avc.cc:99: config_insert_point - buffer->begin()); On 2014/04/25 00:11:39, damienv1 wrote: > ...
6 years, 8 months ago (2014-04-25 00:29:15 UTC) #12
acolwell GONE FROM CHROMIUM
The CQ bit was checked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 00:29:25 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/acolwell@chromium.org/246853005/160001
6 years, 8 months ago (2014-04-25 00:29:58 UTC) #14
acolwell GONE FROM CHROMIUM
The CQ bit was unchecked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 01:27:46 UTC) #15
acolwell GONE FROM CHROMIUM
The CQ bit was checked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 01:28:44 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/acolwell@chromium.org/246853005/180001
6 years, 8 months ago (2014-04-25 01:40:34 UTC) #17
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-25 02:56:44 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
6 years, 8 months ago (2014-04-25 02:56:45 UTC) #19
acolwell GONE FROM CHROMIUM
The CQ bit was checked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 04:21:48 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/acolwell@chromium.org/246853005/180001
6 years, 8 months ago (2014-04-25 08:23:12 UTC) #21
acolwell GONE FROM CHROMIUM
The CQ bit was unchecked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 16:30:26 UTC) #22
acolwell GONE FROM CHROMIUM
The CQ bit was checked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 16:30:31 UTC) #23
acolwell GONE FROM CHROMIUM
The CQ bit was unchecked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 17:59:44 UTC) #24
acolwell GONE FROM CHROMIUM
The CQ bit was checked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 17:59:47 UTC) #25
acolwell GONE FROM CHROMIUM
The CQ bit was checked by acolwell@chromium.org
6 years, 8 months ago (2014-04-25 18:20:45 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/acolwell@chromium.org/246853005/200001
6 years, 8 months ago (2014-04-25 21:51:53 UTC) #27
commit-bot: I haz the power
6 years, 8 months ago (2014-04-26 02:08:53 UTC) #28
Message was sent while issue was closed.
Change committed as 266316

Powered by Google App Engine
This is Rietveld 408576698