summaryrefslogblamecommitdiff
path: root/www-client/chromium/files/chromium-vaapi-79.patch
blob: dc2c1eeb3fc37b304f5a1fea6ca3f66caa963179 (plain) (tree)



























































































































































































































                                                                                              
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 2a4ca2365..a657df74d 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1747,7 +1747,7 @@ const FeatureEntry kFeatureEntries[] = {
         "disable-accelerated-video-decode",
         flag_descriptions::kAcceleratedVideoDecodeName,
         flag_descriptions::kAcceleratedVideoDecodeDescription,
-        kOsMac | kOsWin | kOsCrOS | kOsAndroid,
+        kOsMac | kOsWin | kOsCrOS | kOsAndroid | kOsLinux,
         SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
     },
     {
@@ -2219,12 +2219,12 @@ const FeatureEntry kFeatureEntries[] = {
      FEATURE_VALUE_TYPE(service_manager::features::kXRSandbox)},
 #endif  // !defined(OS_ANDROID)
 #endif  // ENABLE_VR
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
     {"disable-accelerated-mjpeg-decode",
      flag_descriptions::kAcceleratedMjpegDecodeName,
-     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux,
      SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
-#endif  // OS_CHROMEOS
+#endif  // OS_CHROMEOS OS_LINUX
     {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName,
      flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop,
      FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)},
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 929544e4f..be0884a73 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -3080,7 +3080,7 @@ const char kMacSystemMediaPermissionsInfoUiDescription[] =
 
 // Chrome OS -------------------------------------------------------------------
 
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
 
 const char kAcceleratedMjpegDecodeName[] =
     "Hardware-accelerated mjpeg decode for captured frame";
@@ -3088,6 +3088,21 @@ const char kAcceleratedMjpegDecodeDescription[] =
     "Enable hardware-accelerated mjpeg decode for captured frame where "
     "available.";
 
+const char kVaapiJpegImageDecodeAccelerationName[] =
+    "VA-API JPEG decode acceleration for images";
+const char kVaapiJpegImageDecodeAccelerationDescription[] =
+    "Enable or disable decode acceleration of JPEG images (as opposed to camera"
+    " captures) using the VA-API.";
+
+const char kVaapiWebPImageDecodeAccelerationName[] =
+    "VA-API WebP decode acceleration for images";
+const char kVaapiWebPImageDecodeAccelerationDescription[] =
+    "Enable or disable decode acceleration of WebP images using the VA-API.";
+
+#endif
+
+#if defined(OS_CHROMEOS)
+
 const char kAggregatedMlAppRankingName[] = "Rank suggested apps with ML.";
 const char kAggregatedMlAppRankingDescription[] =
     "Use the aggregated ML model to rank the suggested apps.";
@@ -3618,17 +3633,6 @@ const char kUsbguardDescription[] =
     " until Chrome OS is unlocked to protect against malicious USB devices."
     " Already connected USB devices will continue to function.";
 
-const char kVaapiJpegImageDecodeAccelerationName[] =
-    "VA-API JPEG decode acceleration for images";
-const char kVaapiJpegImageDecodeAccelerationDescription[] =
-    "Enable or disable decode acceleration of JPEG images (as opposed to camera"
-    " captures) using the VA-API.";
-
-const char kVaapiWebPImageDecodeAccelerationName[] =
-    "VA-API WebP decode acceleration for images";
-const char kVaapiWebPImageDecodeAccelerationDescription[] =
-    "Enable or disable decode acceleration of WebP images using the VA-API.";
-
 const char kVirtualKeyboardName[] = "Virtual Keyboard";
 const char kVirtualKeyboardDescription[] = "Enable virtual keyboard support.";
 
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index dc9450374..93fc6f14f 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1822,11 +1822,21 @@ extern const char kPermissionPromptPersistenceToggleDescription[];
 
 // Chrome OS ------------------------------------------------------------------
 
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
 
 extern const char kAcceleratedMjpegDecodeName[];
 extern const char kAcceleratedMjpegDecodeDescription[];
 
+extern const char kVaapiJpegImageDecodeAccelerationName[];
+extern const char kVaapiJpegImageDecodeAccelerationDescription[];
+
+extern const char kVaapiWebPImageDecodeAccelerationName[];
+extern const char kVaapiWebPImageDecodeAccelerationDescription[];
+
+#endif
+
+#if defined(OS_CHROMEOS)
+
 extern const char kAggregatedMlAppRankingName[];
 extern const char kAggregatedMlAppRankingDescription[];
 
@@ -2160,12 +2170,6 @@ extern const char kUseFakeDeviceForMediaStreamDescription[];
 extern const char kUseMonitorColorSpaceName[];
 extern const char kUseMonitorColorSpaceDescription[];
 
-extern const char kVaapiJpegImageDecodeAccelerationName[];
-extern const char kVaapiJpegImageDecodeAccelerationDescription[];
-
-extern const char kVaapiWebPImageDecodeAccelerationName[];
-extern const char kVaapiWebPImageDecodeAccelerationDescription[];
-
 extern const char kVirtualKeyboardName[];
 extern const char kVirtualKeyboardDescription[];
 
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
index 0939d25cc..69f31c724 100644
--- a/content/gpu/BUILD.gn
+++ b/content/gpu/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/jumbo.gni")
 import("//build/config/ui.gni")
 import("//gpu/vulkan/features.gni")
 import("//media/media_options.gni")
+import("//media/gpu/args.gni")
 import("//ui/ozone/ozone.gni")
 
 # See //content/BUILD.gn for how this works.
@@ -128,4 +129,8 @@ target(link_target_type, "gpu_sources") {
       (!is_chromecast || is_cast_desktop_build)) {
     configs += [ "//build/config/linux/dri" ]
   }
+  # Use vaapi on desktop Linux builds when use_vaapi is set
+  if (is_desktop_linux && use_vaapi) {
+    public_configs = [ "//media/gpu:libva_config" ]
+  }
 }
diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json
index ea1294e4c..5ba052ec6 100644
--- a/gpu/config/software_rendering_list.json
+++ b/gpu/config/software_rendering_list.json
@@ -332,17 +332,6 @@
         "all"
       ]
     },
-    {
-      "id": 48,
-      "description": "Accelerated video decode is unavailable on Linux",
-      "cr_bugs": [137247],
-      "os": {
-        "type": "linux"
-      },
-      "features": [
-        "accelerated_video_decode"
-      ]
-    },
     {
       "id": 50,
       "description": "Disable VMware software renderer on older Mesa",
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index e7b6efa18..2a3ad90ae 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -612,7 +612,7 @@ bool IsVideoCaptureAcceleratedJpegDecodingEnabled() {
           switches::kUseFakeMjpegDecodeAccelerator)) {
     return true;
   }
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
   return true;
 #endif
   return false;
diff --git a/media/filters/BUILD.gn b/media/filters/BUILD.gn
index 481216a18..bde7319e6 100644
--- a/media/filters/BUILD.gn
+++ b/media/filters/BUILD.gn
@@ -5,6 +5,7 @@
 import("//build/config/jumbo.gni")
 import("//media/media_options.gni")
 import("//third_party/libaom/options.gni")
+import("//media/gpu/args.gni")
 
 jumbo_source_set("filters") {
   # Do not expand the visibility here without double-checking with OWNERS, this
@@ -196,7 +197,7 @@ jumbo_source_set("filters") {
     deps += [ "//media/base/android" ]
   }
 
-  if (current_cpu != "arm" && is_linux) {
+  if (use_vaapi && is_linux) {
     sources += [
       "h264_bitstream_buffer.cc",
       "h264_bitstream_buffer.h",
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
index c290ec2ef..1c06865b8 100644
--- a/media/gpu/BUILD.gn
+++ b/media/gpu/BUILD.gn
@@ -530,9 +530,16 @@ if (use_v4l2_codec || use_vaapi || is_mac || is_win) {
     if (use_ozone) {
       deps += [ "//ui/ozone" ]
     }
+    public_configs = [ ":libva_config" ]
   }
 }
 
+import("//build/config/linux/pkg_config.gni")
+
+pkg_config("libva_config") {
+  packages = [ "libva" ]
+}
+
 static_library("test_support") {
   visibility = [ "//media/gpu/*" ]
   testonly = true