1From e4da759b9a3c52babece10938689c649c3f16835 Mon Sep 17 00:00:00 2001 2From: Jeffy Chen <jeffy.chen@rock-chips.com> 3Date: Mon, 28 Sep 2020 20:02:00 +0800 4Subject: [PATCH 08/18] media: gpu: v4l2: Fix compile error when ozone not 5 enabled 6 7Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 8--- 9 media/gpu/v4l2/BUILD.gn | 5 ++++- 10 media/gpu/v4l2/generic_v4l2_device.cc | 7 +++++++ 11 2 files changed, 11 insertions(+), 1 deletion(-) 12 13diff --git a/media/gpu/v4l2/BUILD.gn b/media/gpu/v4l2/BUILD.gn 14index e4e05249b..c2b3ce87f 100644 15--- a/media/gpu/v4l2/BUILD.gn 16+++ b/media/gpu/v4l2/BUILD.gn 17@@ -116,9 +116,12 @@ source_set("v4l2") { 18 "//media/parsers", 19 "//third_party/libyuv", 20 "//ui/gfx/geometry", 21- "//ui/ozone", 22 ] 23 24+ if (use_ozone) { 25+ deps += [ "//ui/ozone" ] 26+ } 27+ 28 if (is_chromeos_ash) { 29 sources += [ 30 "v4l2_jpeg_encode_accelerator.cc", 31diff --git a/media/gpu/v4l2/generic_v4l2_device.cc b/media/gpu/v4l2/generic_v4l2_device.cc 32index abbf2e574..c623f5380 100644 33--- a/media/gpu/v4l2/generic_v4l2_device.cc 34+++ b/media/gpu/v4l2/generic_v4l2_device.cc 35@@ -33,8 +33,11 @@ 36 #include "ui/gl/egl_util.h" 37 #include "ui/gl/gl_bindings.h" 38 #include "ui/gl/gl_image_native_pixmap.h" 39+ 40+#if defined(USE_OZONE) 41 #include "ui/ozone/public/ozone_platform.h" 42 #include "ui/ozone/public/surface_factory_ozone.h" 43+#endif 44 45 // Auto-generated for dlopen libv4l2 libraries 46 #include "media/gpu/v4l2/v4l2_stubs.h" 47@@ -295,6 +298,9 @@ scoped_refptr<gl::GLImage> GenericV4L2Device::CreateGLImage( 48 const gfx::Size& size, 49 const Fourcc fourcc, 50 gfx::NativePixmapHandle handle) const { 51+#if !defined(USE_OZONE) 52+ return nullptr; 53+#else 54 DVLOGF(3); 55 DCHECK(CanCreateEGLImageFrom(fourcc)); 56 57@@ -329,6 +335,7 @@ scoped_refptr<gl::GLImage> GenericV4L2Device::CreateGLImage( 58 gl::GLImageNativePixmap::Create(size, buffer_format, std::move(pixmap)); 59 DCHECK(image); 60 return image; 61+#endif 62 } 63 64 EGLBoolean GenericV4L2Device::DestroyEGLImage(EGLDisplay egl_display, 65-- 662.20.1 67 68