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

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

Issue 1125263005: MJPEG acceleration for V4L2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address kcwu's comments Created 5 years, 6 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/gpu_jpeg_decode_accelerator.cc
diff --git a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
index 741870f83d11488a290946d68bbd2272f6439d2a..eaafd7ae14caca1ce078d3fcd594173a3d58c5be 100644
--- a/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_jpeg_decode_accelerator.cc
@@ -21,9 +21,15 @@
#include "media/filters/jpeg_parser.h"
#include "ui/gfx/geometry/size.h"
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
+#if defined(OS_CHROMEOS)
+#if defined(ARCH_CPU_X86_FAMILY)
#include "content/common/gpu/media/vaapi_jpeg_decode_accelerator.h"
#endif
+#if defined(USE_V4L2_CODEC)
+#include "content/common/gpu/media/v4l2_device.h"
+#include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h"
+#endif
+#endif
namespace {
@@ -290,6 +296,13 @@ void GpuJpegDecodeAccelerator::AddClient(int32 route_id,
// update as well.
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
accelerator.reset(new VaapiJpegDecodeAccelerator(io_task_runner_));
+#elif defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
+ scoped_refptr<V4L2Device> device = V4L2Device::Create(
+ V4L2Device::kJpegDecoder);
+ if (device.get()) {
+ accelerator.reset(new V4L2JpegDecodeAccelerator(
+ device, io_task_runner_));
+ }
#else
DVLOG(1) << "HW JPEG decode acceleration not available.";
#endif

Powered by Google App Engine
This is Rietveld 408576698