OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <linux/videodev2.h> | 5 #include <linux/videodev2.h> |
6 | 6 |
7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
8 #include "content/common/gpu/media/exynos_v4l2_video_device.h" | 8 #include "content/common/gpu/media/exynos_v4l2_video_device.h" |
9 #include "content/common/gpu/media/tegra_v4l2_video_device.h" | 9 #include "content/common/gpu/media/tegra_v4l2_video_device.h" |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 | 124 |
125 coded_size.SetSize(bytesperline * 8 / horiz_bpp, sizeimage / bytesperline); | 125 coded_size.SetSize(bytesperline * 8 / horiz_bpp, sizeimage / bytesperline); |
126 DVLOG(3) << "coded_size=" << coded_size.ToString(); | 126 DVLOG(3) << "coded_size=" << coded_size.ToString(); |
127 | 127 |
128 // Sanity checks. Calculated coded size has to contain given visible size | 128 // Sanity checks. Calculated coded size has to contain given visible size |
129 // and fulfill buffer byte size requirements for each plane. | 129 // and fulfill buffer byte size requirements for each plane. |
130 DCHECK(gfx::Rect(coded_size).Contains(gfx::Rect(visible_size))); | 130 DCHECK(gfx::Rect(coded_size).Contains(gfx::Rect(visible_size))); |
131 | 131 |
132 if (V4L2_TYPE_IS_MULTIPLANAR(format.type)) { | 132 if (V4L2_TYPE_IS_MULTIPLANAR(format.type)) { |
133 for (size_t i = 0; i < format.fmt.pix_mp.num_planes; ++i) { | 133 for (size_t i = 0; i < format.fmt.pix_mp.num_planes; ++i) { |
134 DCHECK_EQ(format.fmt.pix_mp.plane_fmt[i].bytesperline, | 134 DCHECK_LE(format.fmt.pix_mp.plane_fmt[i].bytesperline, |
wuchengli
2014/08/26 09:20:53
Remove. This is a kernel bug.
henryhsu
2014/08/27 02:59:05
Done.
| |
135 base::checked_cast<__u32>(media::VideoFrame::RowBytes( | 135 base::checked_cast<__u32>(media::VideoFrame::RowBytes( |
136 i, frame_format, coded_size.width()))); | 136 i, frame_format, coded_size.width()))); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 return coded_size; | 140 return coded_size; |
141 } | 141 } |
142 | 142 |
143 } // namespace content | 143 } // namespace content |
OLD | NEW |