2020-04-08 08:38:34 +00:00
|
|
|
Index: chromium-81.0.4040.5/media/gpu/vaapi/vaapi_wrapper.cc
|
2019-04-30 09:13:16 +00:00
|
|
|
===================================================================
|
2020-04-08 08:38:34 +00:00
|
|
|
--- chromium-81.0.4040.5.orig/media/gpu/vaapi/vaapi_wrapper.cc
|
|
|
|
|
+++ chromium-81.0.4040.5/media/gpu/vaapi/vaapi_wrapper.cc
|
2019-12-11 09:26:30 +00:00
|
|
|
@@ -65,6 +65,10 @@
|
2019-09-12 11:04:47 +00:00
|
|
|
#include "ui/ozone/public/surface_factory_ozone.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#ifndef VA_FOURCC_I420
|
|
|
|
|
+#define VA_FOURCC_I420 0x30323449
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
using media_gpu_vaapi::kModuleVa;
|
|
|
|
|
using media_gpu_vaapi::kModuleVa_drm;
|
|
|
|
|
#if defined(USE_X11)
|
2020-04-08 08:38:34 +00:00
|
|
|
@@ -369,10 +373,6 @@ bool VADisplayState::Initialize() {
|
2019-09-12 11:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool VADisplayState::InitializeOnce() {
|
|
|
|
|
- static_assert(
|
|
|
|
|
- VA_MAJOR_VERSION >= 2 || (VA_MAJOR_VERSION == 1 && VA_MINOR_VERSION >= 1),
|
|
|
|
|
- "Requires VA-API >= 1.1.0");
|
|
|
|
|
-
|
|
|
|
|
switch (gl::GetGLImplementation()) {
|
|
|
|
|
case gl::kGLImplementationEGLGLES2:
|
|
|
|
|
va_display_ = vaGetDisplayDRM(drm_fd_.get());
|
2020-04-08 08:38:34 +00:00
|
|
|
@@ -1508,7 +1508,7 @@ VaapiWrapper::ExportVASurfaceAsNativePix
|
2019-12-11 09:26:30 +00:00
|
|
|
LOG(ERROR) << "Cannot export an invalid surface";
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
-
|
|
|
|
|
+#if VA_MAJOR_VERSION >= 2 || (VA_MAJOR_VERSION == 1 && VA_MINOR_VERSION >= 2)
|
|
|
|
|
VADRMPRIMESurfaceDescriptor descriptor;
|
|
|
|
|
{
|
|
|
|
|
base::AutoLock auto_lock(*va_lock_);
|
2020-04-08 08:38:34 +00:00
|
|
|
@@ -1601,6 +1601,10 @@ VaapiWrapper::ExportVASurfaceAsNativePix
|
2019-12-11 09:26:30 +00:00
|
|
|
exported_pixmap->pixmap = base::MakeRefCounted<gfx::NativePixmapDmaBuf>(
|
|
|
|
|
scoped_va_surface.size(), buffer_format, std::move(handle));
|
|
|
|
|
return exported_pixmap;
|
|
|
|
|
+#else
|
|
|
|
|
+ LOG(ERROR) << "Exporting a surface with FOURCC has been disabled on old libva";
|
|
|
|
|
+ return nullptr;
|
|
|
|
|
+#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool VaapiWrapper::SyncSurface(VASurfaceID va_surface_id) {
|
2020-04-08 08:38:34 +00:00
|
|
|
Index: chromium-81.0.4040.5/media/gpu/vaapi/vaapi_jpeg_decoder.cc
|
2019-04-30 09:46:18 +00:00
|
|
|
===================================================================
|
2020-04-08 08:38:34 +00:00
|
|
|
--- chromium-81.0.4040.5.orig/media/gpu/vaapi/vaapi_jpeg_decoder.cc
|
|
|
|
|
+++ chromium-81.0.4040.5/media/gpu/vaapi/vaapi_jpeg_decoder.cc
|
2019-09-12 07:25:11 +00:00
|
|
|
@@ -20,6 +20,10 @@
|
2019-08-02 08:37:13 +00:00
|
|
|
#include "media/parsers/jpeg_parser.h"
|
2019-09-12 07:25:11 +00:00
|
|
|
#include "ui/gfx/geometry/size.h"
|
2019-04-30 10:42:27 +00:00
|
|
|
|
|
|
|
|
+#ifndef VA_FOURCC_I420
|
|
|
|
|
+#define VA_FOURCC_I420 0x30323449
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
namespace media {
|
|
|
|
|
|
|
|
|
|
namespace {
|
2020-04-08 08:38:34 +00:00
|
|
|
Index: chromium-81.0.4040.5/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc
|
2019-06-08 06:54:47 +00:00
|
|
|
===================================================================
|
2020-04-08 08:38:34 +00:00
|
|
|
--- chromium-81.0.4040.5.orig/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc
|
|
|
|
|
+++ chromium-81.0.4040.5/media/gpu/vaapi/vaapi_mjpeg_decode_accelerator.cc
|
2019-10-23 13:00:30 +00:00
|
|
|
@@ -44,6 +44,10 @@
|
2019-12-11 09:26:30 +00:00
|
|
|
#include "ui/gfx/geometry/size.h"
|
|
|
|
|
#include "ui/gfx/gpu_memory_buffer.h"
|
2019-06-08 06:54:47 +00:00
|
|
|
|
|
|
|
|
+#ifndef VA_FOURCC_I420
|
|
|
|
|
+#define VA_FOURCC_I420 0x30323449
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
namespace media {
|
|
|
|
|
|
|
|
|
|
namespace {
|
2020-04-08 08:38:34 +00:00
|
|
|
Index: chromium-81.0.4040.5/media/gpu/chromeos/fourcc.cc
|
2019-12-11 09:26:30 +00:00
|
|
|
===================================================================
|
2020-04-08 08:38:34 +00:00
|
|
|
--- chromium-81.0.4040.5.orig/media/gpu/chromeos/fourcc.cc
|
|
|
|
|
+++ chromium-81.0.4040.5/media/gpu/chromeos/fourcc.cc
|
|
|
|
|
@@ -16,6 +16,13 @@
|
2019-12-11 09:26:30 +00:00
|
|
|
#include <va/va.h>
|
|
|
|
|
#endif // BUILDFLAG(USE_VAAPI)
|
|
|
|
|
|
|
|
|
|
+#ifndef VA_FOURCC_I420
|
|
|
|
|
+#define VA_FOURCC_I420 0x30323449
|
2019-10-23 13:00:30 +00:00
|
|
|
+#endif
|
2019-12-11 09:26:30 +00:00
|
|
|
+#ifndef VA_FOURCC_NV21
|
|
|
|
|
+#define VA_FOURCC_NV21 0x3132564E
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
namespace media {
|
2019-10-23 13:00:30 +00:00
|
|
|
|
2020-04-08 08:38:34 +00:00
|
|
|
Fourcc::Fourcc(Fourcc::Value fourcc) : value_(fourcc) {}
|