| Index: content/common/gpu/media/v4l2_video_device.cc
|
| diff --git a/content/common/gpu/media/v4l2_video_device.cc b/content/common/gpu/media/v4l2_video_device.cc
|
| index e9c54229c787e7a4d59e04ec08a6564d8855a335..0a094ba6e47d143bb36b7b602094cfb4d73fff44 100644
|
| --- a/content/common/gpu/media/v4l2_video_device.cc
|
| +++ b/content/common/gpu/media/v4l2_video_device.cc
|
| @@ -106,6 +106,11 @@ gfx::Size V4L2Device::CodedSizeFromV4L2Format(struct v4l2_format format) {
|
|
|
| int horiz_bpp =
|
| media::VideoFrame::PlaneHorizontalBitsPerPixel(frame_format, 0);
|
| + DVLOG(3) << __func__ << ": bytesperline=" << bytesperline
|
| + << ", sizeimage=" << sizeimage
|
| + << ", visible_size=" << visible_size.ToString() << ", frame_format="
|
| + << media::VideoFrame::FormatToString(frame_format)
|
| + << ", horiz_bpp=" << horiz_bpp;
|
| if (sizeimage == 0 || bytesperline == 0 || horiz_bpp == 0 ||
|
| (bytesperline * 8) % horiz_bpp != 0) {
|
| DLOG(ERROR) << "Invalid format provided";
|
| @@ -118,6 +123,7 @@ gfx::Size V4L2Device::CodedSizeFromV4L2Format(struct v4l2_format format) {
|
| sizeimage = ((sizeimage + bytesperline - 1) / bytesperline) * bytesperline;
|
|
|
| coded_size.SetSize(bytesperline * 8 / horiz_bpp, sizeimage / bytesperline);
|
| + DVLOG(3) << "coded_size=" << coded_size.ToString();
|
|
|
| // Sanity checks. Calculated coded size has to contain given visible size
|
| // and fulfill buffer byte size requirements for each plane.
|
| @@ -125,11 +131,9 @@ gfx::Size V4L2Device::CodedSizeFromV4L2Format(struct v4l2_format format) {
|
|
|
| if (V4L2_TYPE_IS_MULTIPLANAR(format.type)) {
|
| for (size_t i = 0; i < format.fmt.pix_mp.num_planes; ++i) {
|
| - DCHECK_LE(
|
| - format.fmt.pix_mp.plane_fmt[i].sizeimage,
|
| - media::VideoFrame::PlaneAllocationSize(frame_format, i, coded_size));
|
| - DCHECK_LE(format.fmt.pix_mp.plane_fmt[i].bytesperline,
|
| - base::checked_cast<__u32>(coded_size.width()));
|
| + DCHECK_EQ(format.fmt.pix_mp.plane_fmt[i].bytesperline,
|
| + base::checked_cast<__u32>(media::VideoFrame::RowBytes(
|
| + i, frame_format, coded_size.width())));
|
| }
|
| }
|
|
|
|
|