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

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

Issue 813693006: Add accelerated video decoder interface, VP8 and H.264 implementations and hook up to V4L2SVDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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 dbd3d1ece09a463627b79407f459b196f9606ef6..92fc885a0692a956183b314acc74175ab1a98374 100644
--- a/content/common/gpu/media/v4l2_video_device.cc
+++ b/content/common/gpu/media/v4l2_video_device.cc
@@ -13,27 +13,30 @@
// TODO(posciak): remove this once V4L2 headers are updated.
#define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0')
+#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4')
+#define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F')
namespace content {
-V4L2Device::~V4L2Device() {}
+V4L2Device::~V4L2Device() {
+}
// static
-scoped_ptr<V4L2Device> V4L2Device::Create(Type type) {
+scoped_refptr<V4L2Device> V4L2Device::Create(Type type) {
DVLOG(3) << __PRETTY_FUNCTION__;
- scoped_ptr<GenericV4L2Device> generic_device(new GenericV4L2Device(type));
+ scoped_refptr<GenericV4L2Device> generic_device(new GenericV4L2Device(type));
if (generic_device->Initialize())
- return generic_device.Pass();
+ return generic_device;
#if defined(ARCH_CPU_ARMEL)
- scoped_ptr<TegraV4L2Device> tegra_device(new TegraV4L2Device(type));
+ scoped_refptr<TegraV4L2Device> tegra_device(new TegraV4L2Device(type));
if (tegra_device->Initialize())
- return tegra_device.Pass();
+ return tegra_device;
#endif
LOG(ERROR) << "Failed to create V4L2Device";
- return scoped_ptr<V4L2Device>();
+ return scoped_refptr<V4L2Device>();
}
// static
@@ -75,13 +78,20 @@ uint32 V4L2Device::VideoFrameFormatToV4L2PixFmt(
// static
uint32 V4L2Device::VideoCodecProfileToV4L2PixFmt(
- media::VideoCodecProfile profile) {
+ media::VideoCodecProfile profile,
+ bool slice_based) {
if (profile >= media::H264PROFILE_MIN &&
profile <= media::H264PROFILE_MAX) {
- return V4L2_PIX_FMT_H264;
+ if (slice_based)
+ return V4L2_PIX_FMT_H264_SLICE;
+ else
+ return V4L2_PIX_FMT_H264;
} else if (profile >= media::VP8PROFILE_MIN &&
profile <= media::VP8PROFILE_MAX) {
- return V4L2_PIX_FMT_VP8;
+ if (slice_based)
+ return V4L2_PIX_FMT_VP8_FRAME;
+ else
+ return V4L2_PIX_FMT_VP8;
} else if (profile >= media::VP9PROFILE_MIN &&
profile <= media::VP9PROFILE_MAX) {
return V4L2_PIX_FMT_VP9;
« no previous file with comments | « content/common/gpu/media/v4l2_video_device.h ('k') | content/common/gpu/media/v4l2_video_encode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698