new/yocto/meta-rockchip/dynamic-layers/recipes-browser/chromium/chromium_97.0.4692/0008-media-gpu-v4l2-Fix-compile-error-when-ozone-not-enab.patch

68 lines
1.9 KiB
Diff
Raw Permalink Normal View History

2025-05-10 21:58:58 +08:00
From f7dc3dfe23a907de10143bc4327194389ecbf34e Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Mon, 28 Sep 2020 20:02:00 +0800
Subject: [PATCH 08/14] media: gpu: v4l2: Fix compile error when ozone not
enabled
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
media/gpu/v4l2/BUILD.gn | 5 ++++-
media/gpu/v4l2/generic_v4l2_device.cc | 7 +++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/media/gpu/v4l2/BUILD.gn b/media/gpu/v4l2/BUILD.gn
index 3e637653..9f83e8e3 100644
--- a/media/gpu/v4l2/BUILD.gn
+++ b/media/gpu/v4l2/BUILD.gn
@@ -108,9 +108,12 @@ source_set("v4l2") {
"//media/parsers",
"//third_party/libyuv",
"//ui/gfx/geometry",
- "//ui/ozone",
]
+ if (use_ozone) {
+ deps += [ "//ui/ozone" ]
+ }
+
if (use_v4lplugin) {
deps += [ ":libv4l2_stubs" ]
}
diff --git a/media/gpu/v4l2/generic_v4l2_device.cc b/media/gpu/v4l2/generic_v4l2_device.cc
index 64aa8c6d..11cf9c96 100644
--- a/media/gpu/v4l2/generic_v4l2_device.cc
+++ b/media/gpu/v4l2/generic_v4l2_device.cc
@@ -34,8 +34,11 @@
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_image_native_pixmap.h"
+
+#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"
+#endif
#if BUILDFLAG(USE_LIBV4L2)
// Auto-generated for dlopen libv4l2 libraries
@@ -303,6 +306,9 @@ scoped_refptr<gl::GLImage> GenericV4L2Device::CreateGLImage(
const gfx::Size& size,
const Fourcc fourcc,
gfx::NativePixmapHandle handle) const {
+#if !defined(USE_OZONE)
+ return nullptr;
+#else
DVLOGF(3);
DCHECK(CanCreateEGLImageFrom(fourcc));
@@ -337,6 +343,7 @@ scoped_refptr<gl::GLImage> GenericV4L2Device::CreateGLImage(
bool ret = image->Initialize(std::move(pixmap));
DCHECK(ret);
return image;
+#endif
}
EGLBoolean GenericV4L2Device::DestroyEGLImage(EGLDisplay egl_display,
--
2.20.1