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

Issue 406893002: Fix DCHECKs in V4l2VideoDevice. (Closed)

Created:
6 years, 5 months ago by wuchengli
Modified:
6 years, 4 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, wjia+watch_chromium.org, kcwu1, henryhsu, Owen Lin
Project:
chromium
Visibility:
Public.

Description

Fix DCHECKs in V4l2VideoDevice. - sizeimage DCHECK: The video device can adjust the buffer size to be bigger than we need as long as the data can fit. Theoretically sizeimage should be bigger than PlaneAllocationSize. But Exynos driver has a 256 byte padding for sizeimage. It is rounded up when calculating coded_size. So sizeimage can be smaller than PlaneAllocationSize. For example, say format.fmt.pix_mp.width and height are 1920x1088. format.fmt.pix_mp.plane_fmt[0].sizeimage is 2089216 (1920*1088+256). |sizeimage| is rounded up and |coded_size| becomes 1920x1089. So format.fmt.pix_mp.plane_fmt[i].sizeimage (2089216) is less than PlaneAllocationSize (1920*1090=2092800). Also, we should not round down because the coded size is passed VideoEncodeAccelerator::Client::RequireBitstreamBuffers. The client will allocate buffers according to the coded size. - bytesperline DCHECK: bytesperline of different planes should be checked against media::VideoFrame::row_bytes, not the width of coded size. BUG=387701 TEST=Run Hangout in debug builds. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291374

Patch Set 1 #

Total comments: 6

Patch Set 2 : address comments #

Total comments: 1

Patch Set 3 : rebase #

Patch Set 4 : add one DCHECK back #

Total comments: 6

Patch Set 5 : change DCHECK_LE to DCHECK_EQ #

Patch Set 6 : update comments of IsValidPlane #

Total comments: 12

Patch Set 7 : address review comments #

Total comments: 7

Patch Set 8 : address Pawel's review comments #

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -20 lines) Patch
M content/common/gpu/media/v4l2_image_processor.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M content/common/gpu/media/v4l2_video_device.cc View 1 2 3 4 5 6 3 chunks +9 lines, -5 lines 0 comments Download
M content/common/gpu/media/v4l2_video_encode_accelerator.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M media/base/video_frame.h View 1 2 3 4 5 6 7 3 chunks +9 lines, -3 lines 0 comments Download
M media/base/video_frame.cc View 1 2 3 4 chunks +17 lines, -12 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
wuchengli
PTAL
6 years, 5 months ago (2014-07-24 03:37:00 UTC) #1
Pawel Osciak
https://codereview.chromium.org/406893002/diff/1/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (left): https://codereview.chromium.org/406893002/diff/1/content/common/gpu/media/v4l2_video_device.cc#oldcode129 content/common/gpu/media/v4l2_video_device.cc:129: format.fmt.pix_mp.plane_fmt[i].sizeimage, Perhaps we could keep the checks, but make ...
6 years, 5 months ago (2014-07-24 05:24:59 UTC) #2
wuchengli
PTAL https://codereview.chromium.org/406893002/diff/1/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (left): https://codereview.chromium.org/406893002/diff/1/content/common/gpu/media/v4l2_video_device.cc#oldcode129 content/common/gpu/media/v4l2_video_device.cc:129: format.fmt.pix_mp.plane_fmt[i].sizeimage, On 2014/07/24 05:24:59, Pawel Osciak wrote: > ...
6 years, 4 months ago (2014-07-30 09:18:05 UTC) #3
kcwu
lgtm https://codereview.chromium.org/406893002/diff/20001/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (right): https://codereview.chromium.org/406893002/diff/20001/content/common/gpu/media/v4l2_video_device.cc#newcode127 content/common/gpu/media/v4l2_video_device.cc:127: DVLOG(3) << "coded_size=" << coded_size.width() << "x" << ...
6 years, 4 months ago (2014-07-30 10:07:07 UTC) #4
wuchengli
PTAL. https://codereview.chromium.org/406893002/diff/60001/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (right): https://codereview.chromium.org/406893002/diff/60001/content/common/gpu/media/v4l2_video_device.cc#newcode134 content/common/gpu/media/v4l2_video_device.cc:134: DCHECK_LE(format.fmt.pix_mp.plane_fmt[i].bytesperline, Pawel. Do you think this should be ...
6 years, 4 months ago (2014-08-15 09:56:54 UTC) #5
kcwu
https://codereview.chromium.org/406893002/diff/60001/content/common/gpu/media/v4l2_image_processor.cc File content/common/gpu/media/v4l2_image_processor.cc (right): https://codereview.chromium.org/406893002/diff/60001/content/common/gpu/media/v4l2_image_processor.cc#newcode217 content/common/gpu/media/v4l2_image_processor.cc:217: DVLOG(3) << __func__; Is this intended for future use ...
6 years, 4 months ago (2014-08-15 10:19:17 UTC) #6
wuchengli
All done. Pawel. PTAL. https://codereview.chromium.org/406893002/diff/60001/content/common/gpu/media/v4l2_image_processor.cc File content/common/gpu/media/v4l2_image_processor.cc (right): https://codereview.chromium.org/406893002/diff/60001/content/common/gpu/media/v4l2_image_processor.cc#newcode217 content/common/gpu/media/v4l2_image_processor.cc:217: DVLOG(3) << __func__; On 2014/08/15 ...
6 years, 4 months ago (2014-08-18 07:08:14 UTC) #7
Pawel Osciak
https://codereview.chromium.org/406893002/diff/100001/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (right): https://codereview.chromium.org/406893002/diff/100001/content/common/gpu/media/v4l2_video_device.cc#newcode109 content/common/gpu/media/v4l2_video_device.cc:109: DVLOG(3) << "CodedSizeFromV4L2Format: bytesperline=" << bytesperline use __func__ or ...
6 years, 4 months ago (2014-08-18 07:52:03 UTC) #8
henryhsu
https://codereview.chromium.org/406893002/diff/100001/media/base/video_frame.cc File media/base/video_frame.cc (left): https://codereview.chromium.org/406893002/diff/100001/media/base/video_frame.cc#oldcode762 media/base/video_frame.cc:762: int VideoFrame::rows(size_t plane) const { Can we make rows ...
6 years, 4 months ago (2014-08-18 08:18:57 UTC) #9
wuchengli
PTAL. https://codereview.chromium.org/406893002/diff/100001/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (right): https://codereview.chromium.org/406893002/diff/100001/content/common/gpu/media/v4l2_video_device.cc#newcode109 content/common/gpu/media/v4l2_video_device.cc:109: DVLOG(3) << "CodedSizeFromV4L2Format: bytesperline=" << bytesperline On 2014/08/18 ...
6 years, 4 months ago (2014-08-18 09:09:00 UTC) #10
wuchengli
Pawel@ PTAL. scherkus@ Owner review for video_frame.cc/h. Thanks.
6 years, 4 months ago (2014-08-19 06:23:04 UTC) #11
Pawel Osciak
lgtm % comment nits https://chromiumcodereview.appspot.com/406893002/diff/100001/media/base/video_frame.h File media/base/video_frame.h (right): https://chromiumcodereview.appspot.com/406893002/diff/100001/media/base/video_frame.h#newcode223 media/base/video_frame.h:223: // This refers to the ...
6 years, 4 months ago (2014-08-20 10:46:06 UTC) #12
scherkus (not reviewing)
https://codereview.chromium.org/406893002/diff/120001/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (right): https://codereview.chromium.org/406893002/diff/120001/content/common/gpu/media/v4l2_video_device.cc#newcode84 content/common/gpu/media/v4l2_video_device.cc:84: media::VideoFrame::Format frame_format = media::VideoFrame::UNKNOWN; are we using actual VideoFrames ...
6 years, 4 months ago (2014-08-20 17:13:53 UTC) #13
wuchengli
https://codereview.chromium.org/406893002/diff/120001/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (right): https://codereview.chromium.org/406893002/diff/120001/content/common/gpu/media/v4l2_video_device.cc#newcode84 content/common/gpu/media/v4l2_video_device.cc:84: media::VideoFrame::Format frame_format = media::VideoFrame::UNKNOWN; On 2014/08/20 17:13:53, scherkus wrote: ...
6 years, 4 months ago (2014-08-21 01:03:57 UTC) #14
scherkus (not reviewing)
lgtm w/ nits https://codereview.chromium.org/406893002/diff/120001/content/common/gpu/media/v4l2_video_device.cc File content/common/gpu/media/v4l2_video_device.cc (right): https://codereview.chromium.org/406893002/diff/120001/content/common/gpu/media/v4l2_video_device.cc#newcode84 content/common/gpu/media/v4l2_video_device.cc:84: media::VideoFrame::Format frame_format = media::VideoFrame::UNKNOWN; On 2014/08/21 ...
6 years, 4 months ago (2014-08-21 21:37:54 UTC) #15
wuchengli
On 2014/08/21 21:37:54, scherkus wrote: > lgtm w/ nits > > https://codereview.chromium.org/406893002/diff/120001/content/common/gpu/media/v4l2_video_device.cc > File content/common/gpu/media/v4l2_video_device.cc ...
6 years, 4 months ago (2014-08-22 05:31:53 UTC) #16
wuchengli
All done. Submitting. https://codereview.chromium.org/406893002/diff/100001/media/base/video_frame.h File media/base/video_frame.h (right): https://codereview.chromium.org/406893002/diff/100001/media/base/video_frame.h#newcode223 media/base/video_frame.h:223: // This refers to the bytes ...
6 years, 4 months ago (2014-08-22 05:32:05 UTC) #17
wuchengli
The CQ bit was checked by wuchengli@chromium.org
6 years, 4 months ago (2014-08-22 05:40:55 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wuchengli@chromium.org/406893002/160001
6 years, 4 months ago (2014-08-22 05:41:46 UTC) #19
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_chromium_gn_compile_rel on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-22 06:42:16 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-22 06:46:53 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/8429)
6 years, 4 months ago (2014-08-22 06:46:55 UTC) #22
wuchengli
The CQ bit was checked by wuchengli@chromium.org
6 years, 4 months ago (2014-08-22 07:52:38 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wuchengli@chromium.org/406893002/160001
6 years, 4 months ago (2014-08-22 07:53:09 UTC) #24
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_chromium_gn_compile_rel on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-22 07:58:09 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-22 08:02:04 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/8439)
6 years, 4 months ago (2014-08-22 08:02:06 UTC) #27
wuchengli
The CQ bit was checked by wuchengli@chromium.org
6 years, 4 months ago (2014-08-22 08:06:15 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wuchengli@chromium.org/406893002/160001
6 years, 4 months ago (2014-08-22 08:07:22 UTC) #29
commit-bot: I haz the power
6 years, 4 months ago (2014-08-22 10:30:08 UTC) #30
Message was sent while issue was closed.
Committed patchset #9 (160001) as 291374

Powered by Google App Engine
This is Rietveld 408576698