|
|
@ -18,9 +18,9 @@ on Linux.
|
|
|
|
Test: VDA video playback on Linux X11 and Linux Wayland
|
|
|
|
Test: VDA video playback on Linux X11 and Linux Wayland
|
|
|
|
Bug: 1326754,1116701
|
|
|
|
Bug: 1326754,1116701
|
|
|
|
Change-Id: I6d6bf781833a7752d23dafb2b63112c2fc81b17a
|
|
|
|
Change-Id: I6d6bf781833a7752d23dafb2b63112c2fc81b17a
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/args.gni.wayland-vaapi chromium-108.0.5359.124/media/gpu/args.gni
|
|
|
|
diff -up chromium-109.0.5359.124/media/gpu/args.gni.wayland-vaapi chromium-109.0.5359.124/media/gpu/args.gni
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/args.gni.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
--- chromium-109.0.5359.124/media/gpu/args.gni.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/args.gni 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
+++ chromium-109.0.5359.124/media/gpu/args.gni 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
@@ -6,10 +6,14 @@ import("//build/config/chromeos/ui_mode.
|
|
|
|
@@ -6,10 +6,14 @@ import("//build/config/chromeos/ui_mode.
|
|
|
|
import("//build/config/ozone.gni")
|
|
|
|
import("//build/config/ozone.gni")
|
|
|
|
|
|
|
|
|
|
|
@ -52,9 +52,9 @@ diff -up chromium-108.0.5359.124/media/gpu/args.gni.wayland-vaapi chromium-108.0
|
|
|
|
|
|
|
|
|
|
|
|
# Indicates if ChromeOS protected media support exists. This is used
|
|
|
|
# Indicates if ChromeOS protected media support exists. This is used
|
|
|
|
# to enable the CDM daemon in Chrome OS as well as support for
|
|
|
|
# to enable the CDM daemon in Chrome OS as well as support for
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi chromium-108.0.5359.124/media/gpu/BUILD.gn
|
|
|
|
diff -up chromium-109.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi chromium-109.0.5359.124/media/gpu/BUILD.gn
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
--- chromium-109.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
+++ chromium-109.0.5359.124/media/gpu/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
@@ -20,7 +20,7 @@ buildflag_header("buildflags") {
|
|
|
|
@@ -20,7 +20,7 @@ buildflag_header("buildflags") {
|
|
|
|
"USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
|
|
|
|
"USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
|
|
|
|
"USE_V4L2_CODEC=$use_v4l2_codec",
|
|
|
|
"USE_V4L2_CODEC=$use_v4l2_codec",
|
|
|
@ -64,9 +64,9 @@ diff -up chromium-108.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi chromium-108.0
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn
|
|
|
|
diff -up chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
--- chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
+++ chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
@@ -17,7 +17,7 @@ assert(use_vaapi)
|
|
|
|
@@ -17,7 +17,7 @@ assert(use_vaapi)
|
|
|
|
generate_stubs("libva_stubs") {
|
|
|
|
generate_stubs("libva_stubs") {
|
|
|
|
extra_header = "va_stub_header.fragment"
|
|
|
|
extra_header = "va_stub_header.fragment"
|
|
|
@ -94,13 +94,229 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi chromium
|
|
|
|
deps += [ "//ui/gfx/x" ]
|
|
|
|
deps += [ "//ui/gfx/x" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc
|
|
|
|
diff -up chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
|
|
|
|
--- chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc 2023-01-05 10:32:58.616517572 +0100
|
|
|
|
+++ chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
@@ -12,10 +12,10 @@
|
|
|
|
@@ -36,7 +36,11 @@ class MEDIA_GPU_EXPORT VaapiPictureFacto
|
|
|
|
#if defined(USE_OZONE)
|
|
|
|
kVaapiImplementationAngle,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ explicit VaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11);
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
VaapiPictureFactory();
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaapiPictureFactory(const VaapiPictureFactory&) = delete;
|
|
|
|
|
|
|
|
VaapiPictureFactory& operator=(const VaapiPictureFactory&) = delete;
|
|
|
|
|
|
|
|
@@ -85,6 +89,11 @@ class MEDIA_GPU_EXPORT VaapiPictureFacto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreatePictureCB create_picture_cb_;
|
|
|
|
|
|
|
|
bool needs_vpp_for_downloading_ = false;
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ // See comment in `VaapiWrapper::MayUseVaapiOverX11()`.
|
|
|
|
|
|
|
|
+ absl::optional<bool> may_use_vaapi_over_x11_;
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace media
|
|
|
|
|
|
|
|
diff -up chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
|
|
|
|
|
|
|
|
--- chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi 2023-01-05 10:13:08.290403251 +0100
|
|
|
|
|
|
|
|
+++ chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2023-01-05 10:13:08.292403271 +0100
|
|
|
|
|
|
|
|
@@ -184,7 +184,12 @@ bool VaapiVideoDecodeAccelerator::Initia
|
|
|
|
|
|
|
|
Client* client) {
|
|
|
|
|
|
|
|
DCHECK(task_runner_->BelongsToCurrentThread());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ vaapi_picture_factory_ =
|
|
|
|
|
|
|
|
+ std::make_unique<VaapiPictureFactory>(VaapiWrapper::MayUseVaapiOverX11());
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (config.is_encrypted()) {
|
|
|
|
|
|
|
|
NOTREACHED() << "Encrypted streams are not supported for this VDA";
|
|
|
|
|
|
|
|
@@ -1210,7 +1215,7 @@ VaapiVideoDecodeAccelerator::GetSupporte
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaapiVideoDecodeAccelerator::BufferAllocationMode
|
|
|
|
|
|
|
|
VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
// The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
|
|
|
|
|
|
|
|
// here.
|
|
|
|
|
|
|
|
DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
|
|
|
|
|
|
|
|
diff -up chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h
|
|
|
|
|
|
|
|
--- chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h 2023-01-05 10:13:08.292403271 +0100
|
|
|
|
|
|
|
|
@@ -36,9 +36,9 @@
|
|
|
|
|
|
|
|
#include "third_party/abseil-cpp/absl/types/optional.h"
|
|
|
|
|
|
|
|
#include "ui/gfx/geometry/size.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
#include "ui/gfx/x/xproto.h" // nogncheck
|
|
|
|
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace gfx {
|
|
|
|
|
|
|
|
enum class BufferFormat;
|
|
|
|
|
|
|
|
@@ -186,6 +186,16 @@ class MEDIA_GPU_EXPORT VaapiWrapper
|
|
|
|
|
|
|
|
VaapiWrapper(const VaapiWrapper&) = delete;
|
|
|
|
|
|
|
|
VaapiWrapper& operator=(const VaapiWrapper&) = delete;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ // Returns true if VaapiWrapper instances may use VA-API over X11 and false
|
|
|
|
|
|
|
|
+ // otherwise (VA-API over DRM will be used). If this returns absl::nullopt,
|
|
|
|
|
|
|
|
+ // it's because it was not possible to determine how VA-API may be used. This
|
|
|
|
|
|
|
|
+ // should only be called after PreSandboxInitialization() (which is assumed to
|
|
|
|
|
|
|
|
+ // be called only once during the GPU process startup) and is safe to call
|
|
|
|
|
|
|
|
+ // from any thread. Additionally, this should always return the same value.
|
|
|
|
|
|
|
|
+ static absl::optional<bool> MayUseVaapiOverX11();
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// Returns the supported SVC scalability modes for specified profile.
|
|
|
|
|
|
|
|
static std::vector<SVCScalabilityMode> GetSupportedScalabilityModes(
|
|
|
|
|
|
|
|
VideoCodecProfile media_profile,
|
|
|
|
|
|
|
|
@@ -439,13 +449,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
|
|
|
|
|
|
|
|
VASurfaceID va_surface_id,
|
|
|
|
|
|
|
|
const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
// Put data from |va_surface_id| into |x_pixmap| of size
|
|
|
|
|
|
|
|
// |dest_size|, converting/scaling to it.
|
|
|
|
|
|
|
|
[[nodiscard]] bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
|
|
|
|
|
|
|
|
x11::Pixmap x_pixmap,
|
|
|
|
|
|
|
|
gfx::Size dest_size);
|
|
|
|
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Creates a ScopedVAImage from a VASurface |va_surface_id| and map it into
|
|
|
|
|
|
|
|
// memory with the given |format| and |size|. If |format| is not equal to the
|
|
|
|
|
|
|
|
diff -up chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment
|
|
|
|
|
|
|
|
--- chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
|
|
|
|
@@ -7,8 +7,8 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <va/va_drm.h>
|
|
|
|
|
|
|
|
#include <va/va.h>
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
#include <va/va_x11.h>
|
|
|
|
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
diff -up chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc
|
|
|
|
|
|
|
|
--- chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc 2023-01-05 10:13:08.292403271 +0100
|
|
|
|
|
|
|
|
@@ -196,7 +196,7 @@ class OzonePlatformX11 : public OzonePla
|
|
|
|
|
|
|
|
properties->app_modal_dialogs_use_event_blocker = true;
|
|
|
|
|
|
|
|
properties->fetch_buffer_formats_for_gmb_on_gpu = true;
|
|
|
|
|
|
|
|
#if BUILDFLAG(IS_LINUX)
|
|
|
|
|
|
|
|
- properties->supports_vaapi = true;
|
|
|
|
|
|
|
|
+ properties->supports_vaapi_x11 = true;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialised = true;
|
|
|
|
|
|
|
|
diff -up chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h
|
|
|
|
|
|
|
|
--- chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h 2023-01-05 10:13:08.293403281 +0100
|
|
|
|
|
|
|
|
@@ -145,12 +145,13 @@ class COMPONENT_EXPORT(OZONE) OzonePlatf
|
|
|
|
|
|
|
|
bool fetch_buffer_formats_for_gmb_on_gpu = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if BUILDFLAG(IS_LINUX)
|
|
|
|
|
|
|
|
- // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
|
|
|
|
|
|
|
|
- // Linux. At the moment, VA-API Linux implementation supports only X11
|
|
|
|
|
|
|
|
- // backend. This implementation must be refactored to support Ozone
|
|
|
|
|
|
|
|
- // properly. As a temporary solution, VA-API on Linux checks if vaapi is
|
|
|
|
|
|
|
|
- // supported (which implicitly means that it is Ozone/X11).
|
|
|
|
|
|
|
|
- bool supports_vaapi = false;
|
|
|
|
|
|
|
|
+ // VA-API supports different display backends.
|
|
|
|
|
|
|
|
+ // See https://github.com/intel/libva/blob/master/va/va_backend.h
|
|
|
|
|
|
|
|
+ //
|
|
|
|
|
|
|
|
+ // VA/DRM and VA/X11 are used by Chromium at the moment. All Ozone platforms
|
|
|
|
|
|
|
|
+ // support VA/DRM by default. `supports_vaapi_x11` indicates if VA/X11
|
|
|
|
|
|
|
|
+ // supported; it is true only on Ozone/X11 platform.
|
|
|
|
|
|
|
|
+ bool supports_vaapi_x11 = false;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Indicates that the platform allows client applications to manipulate
|
|
|
|
|
|
|
|
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
|
|
|
|
|
|
|
|
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.orig 2023-01-04 20:20:18.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc 2023-01-11 14:31:01.033496121 +0100
|
|
|
|
|
|
|
|
@@ -39,6 +39,11 @@ struct TestParams {
|
|
|
|
|
|
|
|
bool decode_using_client_picture_buffers;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+// TODO: Add it in TestParams to cover Ozone/Wayland.
|
|
|
|
|
|
|
|
+bool kMayUseVaapiOverX11 = true;
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
constexpr int32_t kBitstreamId = 123;
|
|
|
|
|
|
|
|
constexpr size_t kInputSize = 256;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -131,7 +136,13 @@ class MockVaapiPicture : public VaapiPic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MockVaapiPictureFactory : public VaapiPictureFactory {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ explicit MockVaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11)
|
|
|
|
|
|
|
|
+ : VaapiPictureFactory(may_use_vaapi_over_x11) {}
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
MockVaapiPictureFactory() = default;
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
~MockVaapiPictureFactory() override = default;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MOCK_METHOD3(MockCreateVaapiPicture,
|
|
|
|
|
|
|
|
@@ -165,7 +176,12 @@ class VaapiVideoDecodeAcceleratorTest :
|
|
|
|
|
|
|
|
bool can_bind_to_sampler) { return true; })),
|
|
|
|
|
|
|
|
decoder_thread_("VaapiVideoDecodeAcceleratorTestThread"),
|
|
|
|
|
|
|
|
mock_decoder_(new ::testing::StrictMock<MockAcceleratedVideoDecoder>),
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ mock_vaapi_picture_factory_(
|
|
|
|
|
|
|
|
+ new MockVaapiPictureFactory(kMayUseVaapiOverX11)),
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
mock_vaapi_picture_factory_(new MockVaapiPictureFactory()),
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
mock_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
|
|
|
|
|
|
|
|
mock_vpp_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
|
|
|
|
|
|
|
|
weak_ptr_factory_(this) {
|
|
|
|
|
|
|
|
@@ -421,14 +437,16 @@ TEST_P(VaapiVideoDecodeAcceleratorTest,
|
|
|
|
|
|
|
|
mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
gl::kGLImplementationEGLGLES2));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
|
|
|
|
|
|
|
|
- mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
- gl::kGLImplementationEGLANGLE));
|
|
|
|
|
|
|
|
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
|
|
|
|
|
|
|
|
- mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
- gl::kGLImplementationDesktopGL));
|
|
|
|
|
|
|
|
-#elif BUILDFLAG(IS_OZONE)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ if (kMayUseVaapiOverX11) {
|
|
|
|
|
|
|
|
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
|
|
|
|
|
|
|
|
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
+ gl::kGLImplementationEGLANGLE));
|
|
|
|
|
|
|
|
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
|
|
|
|
|
|
|
|
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
+ gl::kGLImplementationDesktopGL));
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationDrm,
|
|
|
|
|
|
|
|
mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
gl::kGLImplementationEGLANGLE));
|
|
|
|
|
|
|
|
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc
|
|
|
|
|
|
|
|
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc.orig 2023-01-04 20:20:18.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc 2023-01-11 14:45:36.405506479 +0100
|
|
|
|
|
|
|
|
@@ -13,10 +13,10 @@
|
|
|
|
|
|
|
|
#if BUILDFLAG(IS_OZONE)
|
|
|
|
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
|
|
|
|
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
|
|
|
|
#endif // defined(USE_OZONE)
|
|
|
|
#endif // BUILDFLAG(IS_OZONE)
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
|
|
|
|
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
|
|
|
@ -110,7 +326,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.waylan
|
|
|
|
#if defined(USE_EGL)
|
|
|
|
#if defined(USE_EGL)
|
|
|
|
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
|
|
|
|
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
@@ -41,22 +41,32 @@ std::unique_ptr<VaapiPicture> CreateVaap
|
|
|
|
@@ -42,22 +42,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
|
@ -131,7 +347,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.waylan
|
|
|
|
- vaapi_impl_pairs_.insert(
|
|
|
|
- vaapi_impl_pairs_.insert(
|
|
|
|
- std::make_pair(gl::kGLImplementationDesktopGL,
|
|
|
|
- std::make_pair(gl::kGLImplementationDesktopGL,
|
|
|
|
- VaapiPictureFactory::kVaapiImplementationX11));
|
|
|
|
- VaapiPictureFactory::kVaapiImplementationX11));
|
|
|
|
-#elif defined(USE_OZONE)
|
|
|
|
-#elif BUILDFLAG(IS_OZONE)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+ CHECK(may_use_vaapi_over_x11_.has_value());
|
|
|
|
+ CHECK(may_use_vaapi_over_x11_.has_value());
|
|
|
@ -152,7 +368,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.waylan
|
|
|
|
|
|
|
|
|
|
|
|
DeterminePictureCreationAndDownloadingMechanism();
|
|
|
|
DeterminePictureCreationAndDownloadingMechanism();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -97,19 +107,19 @@ VaapiPictureFactory::GetVaapiImplementat
|
|
|
|
@@ -98,19 +108,19 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t VaapiPictureFactory::GetGLTextureTarget() {
|
|
|
|
uint32_t VaapiPictureFactory::GetGLTextureTarget() {
|
|
|
@ -180,8 +396,8 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.waylan
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
|
|
|
|
void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
|
|
|
|
@@ -117,25 +127,30 @@ void VaapiPictureFactory::DeterminePictu
|
|
|
|
@@ -118,25 +128,30 @@
|
|
|
|
#if defined(USE_OZONE)
|
|
|
|
#if BUILDFLAG(IS_OZONE)
|
|
|
|
// We can be called without GL initialized, which is valid if we use Ozone.
|
|
|
|
// We can be called without GL initialized, which is valid if we use Ozone.
|
|
|
|
case kVaapiImplementationNone:
|
|
|
|
case kVaapiImplementationNone:
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
@ -191,7 +407,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.waylan
|
|
|
|
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
|
|
|
|
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
|
|
|
|
needs_vpp_for_downloading_ = true;
|
|
|
|
needs_vpp_for_downloading_ = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
#endif // defined(USE_OZONE)
|
|
|
|
#endif // BUILDFLAG(IS_OZONE)
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
case kVaapiImplementationX11:
|
|
|
|
case kVaapiImplementationX11:
|
|
|
@ -211,131 +427,11 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.waylan
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
case kVaapiImplementationDrm:
|
|
|
|
case kVaapiImplementationDrm:
|
|
|
|
#if defined(USE_OZONE)
|
|
|
|
#if BUILDFLAG(IS_OZONE)
|
|
|
|
create_picture_cb_ = base::BindRepeating(
|
|
|
|
create_picture_cb_ = base::BindRepeating(
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h
|
|
|
|
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
|
|
|
|
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc.orig 2023-01-04 20:20:18.000000000 +0100
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc 2023-01-11 15:08:02.721768243 +0100
|
|
|
|
@@ -36,7 +36,11 @@ class MEDIA_GPU_EXPORT VaapiPictureFacto
|
|
|
|
|
|
|
|
kVaapiImplementationAngle,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ explicit VaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11);
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
VaapiPictureFactory();
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaapiPictureFactory(const VaapiPictureFactory&) = delete;
|
|
|
|
|
|
|
|
VaapiPictureFactory& operator=(const VaapiPictureFactory&) = delete;
|
|
|
|
|
|
|
|
@@ -85,6 +89,11 @@ class MEDIA_GPU_EXPORT VaapiPictureFacto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreatePictureCB create_picture_cb_;
|
|
|
|
|
|
|
|
bool needs_vpp_for_downloading_ = false;
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ // See comment in `VaapiWrapper::MayUseVaapiOverX11()`.
|
|
|
|
|
|
|
|
+ absl::optional<bool> may_use_vaapi_over_x11_;
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace media
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
|
|
|
|
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi 2023-01-05 10:13:08.290403251 +0100
|
|
|
|
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2023-01-05 10:13:08.292403271 +0100
|
|
|
|
|
|
|
|
@@ -184,7 +184,12 @@ bool VaapiVideoDecodeAccelerator::Initia
|
|
|
|
|
|
|
|
Client* client) {
|
|
|
|
|
|
|
|
DCHECK(task_runner_->BelongsToCurrentThread());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ vaapi_picture_factory_ =
|
|
|
|
|
|
|
|
+ std::make_unique<VaapiPictureFactory>(VaapiWrapper::MayUseVaapiOverX11());
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (config.is_encrypted()) {
|
|
|
|
|
|
|
|
NOTREACHED() << "Encrypted streams are not supported for this VDA";
|
|
|
|
|
|
|
|
@@ -1210,7 +1215,7 @@ VaapiVideoDecodeAccelerator::GetSupporte
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VaapiVideoDecodeAccelerator::BufferAllocationMode
|
|
|
|
|
|
|
|
VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
// The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
|
|
|
|
|
|
|
|
// here.
|
|
|
|
|
|
|
|
DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
|
|
|
|
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc 2023-01-05 10:38:15.176631507 +0100
|
|
|
|
|
|
|
|
@@ -38,6 +38,11 @@ struct TestParams {
|
|
|
|
|
|
|
|
bool decode_using_client_picture_buffers;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+// TODO: Add it in TestParams to cover Ozone/Wayland.
|
|
|
|
|
|
|
|
+bool kMayUseVaapiOverX11 = true;
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
constexpr int32_t kBitstreamId = 123;
|
|
|
|
|
|
|
|
constexpr size_t kInputSize = 256;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -130,7 +135,13 @@ class MockVaapiPicture : public VaapiPic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MockVaapiPictureFactory : public VaapiPictureFactory {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ explicit MockVaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11)
|
|
|
|
|
|
|
|
+ : VaapiPictureFactory(may_use_vaapi_over_x11) {}
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
MockVaapiPictureFactory() = default;
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
~MockVaapiPictureFactory() override = default;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MOCK_METHOD3(MockCreateVaapiPicture,
|
|
|
|
|
|
|
|
@@ -164,7 +175,12 @@ class VaapiVideoDecodeAcceleratorTest :
|
|
|
|
|
|
|
|
bool can_bind_to_sampler) { return true; })),
|
|
|
|
|
|
|
|
decoder_thread_("VaapiVideoDecodeAcceleratorTestThread"),
|
|
|
|
|
|
|
|
mock_decoder_(new ::testing::StrictMock<MockAcceleratedVideoDecoder>),
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ mock_vaapi_picture_factory_(
|
|
|
|
|
|
|
|
+ new MockVaapiPictureFactory(kMayUseVaapiOverX11)),
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
mock_vaapi_picture_factory_(new MockVaapiPictureFactory()),
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
mock_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
|
|
|
|
|
|
|
|
mock_vpp_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
|
|
|
|
|
|
|
|
weak_ptr_factory_(this) {
|
|
|
|
|
|
|
|
@@ -420,14 +436,16 @@ TEST_P(VaapiVideoDecodeAcceleratorTest,
|
|
|
|
|
|
|
|
mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
gl::kGLImplementationEGLGLES2));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
|
|
|
|
|
|
|
|
- mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
- gl::kGLImplementationEGLANGLE));
|
|
|
|
|
|
|
|
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
|
|
|
|
|
|
|
|
- mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
- gl::kGLImplementationDesktopGL));
|
|
|
|
|
|
|
|
-#elif defined(USE_OZONE)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ if (kMayUseVaapiOverX11) {
|
|
|
|
|
|
|
|
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
|
|
|
|
|
|
|
|
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
+ gl::kGLImplementationEGLANGLE));
|
|
|
|
|
|
|
|
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
|
|
|
|
|
|
|
|
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
+ gl::kGLImplementationDesktopGL));
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationDrm,
|
|
|
|
|
|
|
|
mock_vaapi_picture_factory_->GetVaapiImplementation(
|
|
|
|
|
|
|
|
gl::kGLImplementationEGLANGLE));
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc
|
|
|
|
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc 2023-01-05 10:41:41.595648227 +0100
|
|
|
|
|
|
|
|
@@ -62,7 +62,7 @@
|
|
|
|
@@ -62,7 +62,7 @@
|
|
|
|
#include "ui/gl/gl_bindings.h"
|
|
|
|
#include "ui/gl/gl_bindings.h"
|
|
|
|
#include "ui/gl/gl_implementation.h"
|
|
|
|
#include "ui/gl/gl_implementation.h"
|
|
|
@ -345,16 +441,16 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
typedef XID Drawable;
|
|
|
|
typedef XID Drawable;
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern "C" {
|
|
|
|
@@ -70,7 +70,7 @@ extern "C" {
|
|
|
|
@@ -70,7 +70,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#include "ui/gfx/x/connection.h" // nogncheck
|
|
|
|
#include "ui/gfx/x/connection.h" // nogncheck
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_OZONE)
|
|
|
|
#if BUILDFLAG(IS_OZONE)
|
|
|
|
#include "ui/ozone/public/ozone_platform.h"
|
|
|
|
#include "ui/ozone/public/ozone_platform.h"
|
|
|
|
@@ -84,14 +84,14 @@ using media_gpu_vaapi::kModuleVa_prot;
|
|
|
|
@@ -84,14 +84,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
using media_gpu_vaapi::kModuleVa;
|
|
|
|
using media_gpu_vaapi::kModuleVa;
|
|
|
|
using media_gpu_vaapi::kModuleVa_drm;
|
|
|
|
using media_gpu_vaapi::kModuleVa_drm;
|
|
|
@ -373,7 +469,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
using media_gpu_vaapi::IsVa_drmInitialized;
|
|
|
|
using media_gpu_vaapi::IsVa_drmInitialized;
|
|
|
|
using media_gpu_vaapi::StubPathMap;
|
|
|
|
using media_gpu_vaapi::StubPathMap;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -668,6 +668,12 @@ class VADisplayState {
|
|
|
|
@@ -668,6 +668,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
void SetDrmFd(base::PlatformFile fd) { drm_fd_.reset(HANDLE_EINTR(dup(fd))); }
|
|
|
|
void SetDrmFd(base::PlatformFile fd) { drm_fd_.reset(HANDLE_EINTR(dup(fd))); }
|
|
|
|
|
|
|
|
|
|
|
@ -386,7 +482,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
friend class base::NoDestructor<VADisplayState>;
|
|
|
|
friend class base::NoDestructor<VADisplayState>;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -690,6 +696,13 @@ class VADisplayState {
|
|
|
|
@@ -690,6 +696,13 @@
|
|
|
|
// Drm fd used to obtain access to the driver interface by VA.
|
|
|
|
// Drm fd used to obtain access to the driver interface by VA.
|
|
|
|
base::ScopedFD drm_fd_;
|
|
|
|
base::ScopedFD drm_fd_;
|
|
|
|
|
|
|
|
|
|
|
@ -400,7 +496,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
// The VADisplay handle. Valid between Initialize() and Deinitialize().
|
|
|
|
// The VADisplay handle. Valid between Initialize() and Deinitialize().
|
|
|
|
VADisplay va_display_;
|
|
|
|
VADisplay va_display_;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -708,6 +721,15 @@ VADisplayState* VADisplayState::Get() {
|
|
|
|
@@ -708,6 +721,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
// static
|
|
|
|
// static
|
|
|
|
void VADisplayState::PreSandboxInitialization() {
|
|
|
|
void VADisplayState::PreSandboxInitialization() {
|
|
|
@ -416,11 +512,11 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
constexpr char kRenderNodeFilePattern[] = "/dev/dri/renderD%d";
|
|
|
|
constexpr char kRenderNodeFilePattern[] = "/dev/dri/renderD%d";
|
|
|
|
// This loop ends on either the first card that does not exist or the first
|
|
|
|
// This loop ends on either the first card that does not exist or the first
|
|
|
|
// render node that is not vgem.
|
|
|
|
// render node that is not vgem.
|
|
|
|
@@ -740,20 +762,18 @@ VADisplayState::VADisplayState()
|
|
|
|
@@ -740,20 +762,18 @@
|
|
|
|
bool VADisplayState::Initialize() {
|
|
|
|
bool VADisplayState::Initialize() {
|
|
|
|
base::AutoLock auto_lock(va_lock_);
|
|
|
|
base::AutoLock auto_lock(va_lock_);
|
|
|
|
|
|
|
|
|
|
|
|
-#if defined(USE_OZONE) && BUILDFLAG(IS_LINUX)
|
|
|
|
-#if BUILDFLAG(IS_OZONE) && BUILDFLAG(IS_LINUX)
|
|
|
|
- // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
|
|
|
|
- // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
|
|
|
|
- // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi
|
|
|
|
- // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi
|
|
|
|
- // for more details. This will also require revisiting everything that's
|
|
|
|
- // for more details. This will also require revisiting everything that's
|
|
|
@ -445,7 +541,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (!libraries_initialized)
|
|
|
|
if (!libraries_initialized)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
@@ -768,7 +788,7 @@ bool VADisplayState::Initialize() {
|
|
|
|
@@ -768,7 +788,7 @@
|
|
|
|
return success;
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -454,7 +550,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
|
|
|
|
|
|
|
|
absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
|
|
|
|
absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
|
|
|
|
switch (gl::GetGLImplementation()) {
|
|
|
|
switch (gl::GetGLImplementation()) {
|
|
|
|
@@ -796,13 +816,19 @@ absl::optional<VADisplay> GetVADisplaySt
|
|
|
|
@@ -796,13 +816,19 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -475,7 +571,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
return vaGetDisplayDRM(drm_fd.get());
|
|
|
|
return vaGetDisplayDRM(drm_fd.get());
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
LOG(WARNING) << "VAAPI video acceleration not available for "
|
|
|
|
LOG(WARNING) << "VAAPI video acceleration not available for "
|
|
|
|
@@ -812,18 +838,23 @@ absl::optional<VADisplay> GetVADisplaySt
|
|
|
|
@@ -812,18 +838,23 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -509,7 +605,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
|
|
|
|
|
|
|
|
va_display_ = *display;
|
|
|
|
va_display_ = *display;
|
|
|
|
if (!vaDisplayIsValid(va_display_)) {
|
|
|
|
if (!vaDisplayIsValid(va_display_)) {
|
|
|
|
@@ -1656,6 +1687,13 @@ scoped_refptr<VaapiWrapper> VaapiWrapper
|
|
|
|
@@ -1656,6 +1687,13 @@
|
|
|
|
enforce_sequence_affinity);
|
|
|
|
enforce_sequence_affinity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -523,7 +619,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
// static
|
|
|
|
// static
|
|
|
|
std::vector<SVCScalabilityMode> VaapiWrapper::GetSupportedScalabilityModes(
|
|
|
|
std::vector<SVCScalabilityMode> VaapiWrapper::GetSupportedScalabilityModes(
|
|
|
|
VideoCodecProfile media_profile,
|
|
|
|
VideoCodecProfile media_profile,
|
|
|
|
@@ -2665,12 +2703,13 @@ bool VaapiWrapper::MapAndCopyAndExecute(
|
|
|
|
@@ -2665,12 +2703,13 @@
|
|
|
|
return Execute_Locked(va_surface_id, va_buffer_ids);
|
|
|
|
return Execute_Locked(va_surface_id, va_buffer_ids);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -538,7 +634,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
base::AutoLockMaybe auto_lock(va_lock_.get());
|
|
|
|
base::AutoLockMaybe auto_lock(va_lock_.get());
|
|
|
|
|
|
|
|
|
|
|
|
VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
|
|
|
|
VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
|
|
|
|
@@ -2684,7 +2723,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(
|
|
|
|
@@ -2684,7 +2723,7 @@
|
|
|
|
VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
|
|
|
|
VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -547,7 +643,7 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
|
|
|
|
std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
|
|
|
|
VASurfaceID va_surface_id,
|
|
|
|
VASurfaceID va_surface_id,
|
|
|
|
@@ -3086,7 +3125,7 @@ void VaapiWrapper::PreSandboxInitializat
|
|
|
|
@@ -3086,7 +3125,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
|
|
|
|
paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
|
|
|
|
paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
|
|
|
|
paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
|
|
|
@ -556,100 +652,15 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi
|
|
|
|
paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
|
|
|
|
paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h
|
|
|
|
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
|
|
|
|
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.orig 2023-01-11 20:45:17.347940426 +0100
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h 2023-01-05 10:13:08.292403271 +0100
|
|
|
|
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc 2023-01-11 20:45:58.314670752 +0100
|
|
|
|
@@ -36,9 +36,9 @@
|
|
|
|
@@ -109,7 +109,7 @@
|
|
|
|
#include "third_party/abseil-cpp/absl/types/optional.h"
|
|
|
|
ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance();
|
|
|
|
#include "ui/gfx/geometry/size.h"
|
|
|
|
ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone();
|
|
|
|
|
|
|
|
gfx::BufferUsage buffer_usage = gfx::BufferUsage::SCANOUT_VDA_WRITE;
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
#include "ui/gfx/x/xproto.h" // nogncheck
|
|
|
|
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace gfx {
|
|
|
|
|
|
|
|
enum class BufferFormat;
|
|
|
|
|
|
|
|
@@ -186,6 +186,16 @@ class MEDIA_GPU_EXPORT VaapiWrapper
|
|
|
|
|
|
|
|
VaapiWrapper(const VaapiWrapper&) = delete;
|
|
|
|
|
|
|
|
VaapiWrapper& operator=(const VaapiWrapper&) = delete;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
+ // Returns true if VaapiWrapper instances may use VA-API over X11 and false
|
|
|
|
|
|
|
|
+ // otherwise (VA-API over DRM will be used). If this returns absl::nullopt,
|
|
|
|
|
|
|
|
+ // it's because it was not possible to determine how VA-API may be used. This
|
|
|
|
|
|
|
|
+ // should only be called after PreSandboxInitialization() (which is assumed to
|
|
|
|
|
|
|
|
+ // be called only once during the GPU process startup) and is safe to call
|
|
|
|
|
|
|
|
+ // from any thread. Additionally, this should always return the same value.
|
|
|
|
|
|
|
|
+ static absl::optional<bool> MayUseVaapiOverX11();
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// Returns the supported SVC scalability modes for specified profile.
|
|
|
|
|
|
|
|
static std::vector<SVCScalabilityMode> GetSupportedScalabilityModes(
|
|
|
|
|
|
|
|
VideoCodecProfile media_profile,
|
|
|
|
|
|
|
|
@@ -439,13 +449,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
|
|
|
|
|
|
|
|
VASurfaceID va_surface_id,
|
|
|
|
|
|
|
|
const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
// Put data from |va_surface_id| into |x_pixmap| of size
|
|
|
|
|
|
|
|
// |dest_size|, converting/scaling to it.
|
|
|
|
|
|
|
|
[[nodiscard]] bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
|
|
|
|
|
|
|
|
x11::Pixmap x_pixmap,
|
|
|
|
|
|
|
|
gfx::Size dest_size);
|
|
|
|
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Creates a ScopedVAImage from a VASurface |va_surface_id| and map it into
|
|
|
|
|
|
|
|
// memory with the given |format| and |size|. If |format| is not equal to the
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment
|
|
|
|
|
|
|
|
--- chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment 2023-01-05 10:13:08.291403261 +0100
|
|
|
|
|
|
|
|
@@ -7,8 +7,8 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <va/va_drm.h>
|
|
|
|
|
|
|
|
#include <va/va.h>
|
|
|
|
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
-#if BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
#include <va/va_x11.h>
|
|
|
|
// The 'VaapiVideoDecodeAccelerator' requires the VPP to download the decoded
|
|
|
|
-#endif // BUILDFLAG(USE_VAAPI_X11)
|
|
|
|
// frame from the internal surface to the allocated native pixmap.
|
|
|
|
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
|
|
|
|
// 'SCANOUT_VDA_WRITE' is used for 'YUV_420_BIPLANAR' on ChromeOS; For Linux,
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc
|
|
|
|
|
|
|
|
--- chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc 2023-01-05 10:13:08.292403271 +0100
|
|
|
|
|
|
|
|
@@ -196,7 +196,7 @@ class OzonePlatformX11 : public OzonePla
|
|
|
|
|
|
|
|
properties->app_modal_dialogs_use_event_blocker = true;
|
|
|
|
|
|
|
|
properties->fetch_buffer_formats_for_gmb_on_gpu = true;
|
|
|
|
|
|
|
|
#if BUILDFLAG(IS_LINUX)
|
|
|
|
|
|
|
|
- properties->supports_vaapi = true;
|
|
|
|
|
|
|
|
+ properties->supports_vaapi_x11 = true;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialised = true;
|
|
|
|
|
|
|
|
diff -up chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h
|
|
|
|
|
|
|
|
--- chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
|
|
|
|
|
|
|
|
+++ chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h 2023-01-05 10:13:08.293403281 +0100
|
|
|
|
|
|
|
|
@@ -145,12 +145,13 @@ class COMPONENT_EXPORT(OZONE) OzonePlatf
|
|
|
|
|
|
|
|
bool fetch_buffer_formats_for_gmb_on_gpu = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if BUILDFLAG(IS_LINUX)
|
|
|
|
|
|
|
|
- // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
|
|
|
|
|
|
|
|
- // Linux. At the moment, VA-API Linux implementation supports only X11
|
|
|
|
|
|
|
|
- // backend. This implementation must be refactored to support Ozone
|
|
|
|
|
|
|
|
- // properly. As a temporary solution, VA-API on Linux checks if vaapi is
|
|
|
|
|
|
|
|
- // supported (which implicitly means that it is Ozone/X11).
|
|
|
|
|
|
|
|
- bool supports_vaapi = false;
|
|
|
|
|
|
|
|
+ // VA-API supports different display backends.
|
|
|
|
|
|
|
|
+ // See https://github.com/intel/libva/blob/master/va/va_backend.h
|
|
|
|
|
|
|
|
+ //
|
|
|
|
|
|
|
|
+ // VA/DRM and VA/X11 are used by Chromium at the moment. All Ozone platforms
|
|
|
|
|
|
|
|
+ // support VA/DRM by default. `supports_vaapi_x11` indicates if VA/X11
|
|
|
|
|
|
|
|
+ // supported; it is true only on Ozone/X11 platform.
|
|
|
|
|
|
|
|
+ bool supports_vaapi_x11 = false;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Indicates that the platform allows client applications to manipulate
|
|
|
|
|