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 <libdrm/drm_fourcc.h> | 5 #include <libdrm/drm_fourcc.h> |
6 #include <linux/videodev2.h> | 6 #include <linux/videodev2.h> |
7 | 7 |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "content/common/gpu/media/generic_v4l2_video_device.h" | 9 #include "content/common/gpu/media/generic_v4l2_device.h" |
10 #if defined(ARCH_CPU_ARMEL) | 10 #if defined(ARCH_CPU_ARMEL) |
11 #include "content/common/gpu/media/tegra_v4l2_video_device.h" | 11 #include "content/common/gpu/media/tegra_v4l2_device.h" |
12 #endif | 12 #endif |
13 | 13 |
14 // TODO(posciak): remove this once V4L2 headers are updated. | 14 // TODO(posciak): remove this once V4L2 headers are updated. |
15 #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') | 15 #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') |
16 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') | 16 #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') |
17 #define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') | 17 #define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 V4L2Device::~V4L2Device() { | 21 V4L2Device::~V4L2Device() { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Sanity checks. Calculated coded size has to contain given visible size | 196 // Sanity checks. Calculated coded size has to contain given visible size |
197 // and fulfill buffer byte size requirements. | 197 // and fulfill buffer byte size requirements. |
198 DCHECK(gfx::Rect(coded_size).Contains(gfx::Rect(visible_size))); | 198 DCHECK(gfx::Rect(coded_size).Contains(gfx::Rect(visible_size))); |
199 DCHECK_LE(sizeimage, | 199 DCHECK_LE(sizeimage, |
200 media::VideoFrame::AllocationSize(frame_format, coded_size)); | 200 media::VideoFrame::AllocationSize(frame_format, coded_size)); |
201 | 201 |
202 return coded_size; | 202 return coded_size; |
203 } | 203 } |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
OLD | NEW |