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

Unified Diff: content/common/gpu/media/v4l2_video_device.cc

Issue 406893002: Fix DCHECKs in V4l2VideoDevice. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c388c0b161f5714e67fad4b44deddfd1fbe86182 100644
--- a/content/common/gpu/media/v4l2_video_device.cc
+++ b/content/common/gpu/media/v4l2_video_device.cc
@@ -106,6 +106,12 @@ gfx::Size V4L2Device::CodedSizeFromV4L2Format(struct v4l2_format format) {
int horiz_bpp =
media::VideoFrame::PlaneHorizontalBitsPerPixel(frame_format, 0);
+ DVLOG(3) << "CodedSizeFromV4L2Format: bytesperline=" << bytesperline
+ << ", sizeimage=" << sizeimage
+ << ", visible_size=" << visible_size.width()
Pawel Osciak 2014/07/24 05:24:59 Nit: visible_size.ToString()
wuchengli 2014/07/30 09:18:05 Done.
+ << "x" << visible_size.height()
+ << ", frame_format=" << frame_format
Pawel Osciak 2014/07/24 05:24:59 Nit: VideoFrame::FormatToString(frame_format)
wuchengli 2014/07/30 09:18:05 Done.
+ << ", horiz_bpp=" << horiz_bpp;
if (sizeimage == 0 || bytesperline == 0 || horiz_bpp == 0 ||
(bytesperline * 8) % horiz_bpp != 0) {
DLOG(ERROR) << "Invalid format provided";
@@ -118,21 +124,12 @@ 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.width() << "x" << coded_size.height();
// Sanity checks. Calculated coded size has to contain given visible size
// and fulfill buffer byte size requirements for each plane.
DCHECK(gfx::Rect(coded_size).Contains(gfx::Rect(visible_size)));
- 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,
Pawel Osciak 2014/07/24 05:24:59 Perhaps we could keep the checks, but make them DC
wuchengli 2014/07/30 09:18:05 As mentioned in bug 387701, the extra 256-byte pad
- 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()));
- }
- }
-
return coded_size;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698