summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsL1pKn072017-09-15 22:19:58 +0200
committersL1pKn072017-09-15 22:19:58 +0200
commit07fe259ee0909fe2258ee432d690b5ca5b374bf8 (patch)
treedeb3f2590a61bc6fec541f61e73bc33a14f6bc49
parent572752918812d45d356c19cda0e59d885612b2d9 (diff)
downloadaur-07fe259ee0909fe2258ee432d690b5ca5b374bf8.tar.gz
Update to 63.0.3213.3
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD30
-rw-r--r--chromium-intel-vaapi_r2.patch909
3 files changed, 31 insertions, 929 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b9719f5df692..8a79bbed8d18 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Wed Sep 6 17:09:41 UTC 2017
+# Fri Sep 15 20:19:41 UTC 2017
pkgbase = chromium-dev
pkgdesc = The open-source project behind Google Chrome (Dev Channel)
- pkgver = 62.0.3198.0
+ pkgver = 63.0.3213.3
pkgrel = 1
url = http://www.chromium.org
install = chromium-dev.install
@@ -32,6 +32,7 @@ pkgbase = chromium-dev
depends = snappy
depends = xdg-utils
depends = libcups
+ depends = libxml2
depends = harfbuzz-icu
depends = ffmpeg
depends = gtk3
@@ -46,34 +47,36 @@ pkgbase = chromium-dev
optdepends = libva-mesa-driver: HW video acceleration for Nouveau, R600 and RadeonSI users
optdepends = libva-intel-driver: HW video acceleration for Intel G45 and HD users
options = !strip
- source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-62.0.3198.0.tar.xz
+ source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-63.0.3213.3.tar.xz
source = git+https://github.com/foutrelis/chromium-launcher.git
source = chromium-dev.svg
source = https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-FORTIFY_SOURCE-r2.patch
- source = https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-gn-bootstrap-r17.patch
source = https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-gcc5-r2.patch
source = minizip.patch
- source = chromium-intel-vaapi_r2.patch
+ source = chromium-intel-vaapi_r14.patch.base64::https://chromium-review.googlesource.com/changes/532294/revisions/d60511c973e432b97d9929dcfbd77c9af25dbd51/patch?download
source = https://raw.githubusercontent.com/sjnewbury/gentoo-playground/master/www-client/chromium/files/chromium-intel-vaapi-fix.patch
source = https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/master/debian/patches/specify-max-resolution.patch
source = breakpad-use-ucontext_t.patch::https://git.archlinux.org/svntogit/packages.git/plain/trunk/breakpad-use-ucontext_t.patch?h=packages/chromium
source = chromium-gcc-r1.patch::https://git.archlinux.org/svntogit/packages.git/plain/trunk/chromium-gcc-r1.patch?h=packages/chromium
source = chromium-blink-gcc7-r2.patch
source = chromium-widevine-r1.patch
- sha256sums = 6e7c33bfe357554cd9400d55bfc280338a7a9474bb0a53b6c81ea84688637970
+ source = c++17.patch::https://github.com/google/crc32c/commit/d0f929a5db87cb34d03afb0d8e8bfc95b8f786e3.patch
+ source = chromium-gn-bootstrap-r18.patch.base64::https://chromium-review.googlesource.com/changes/667107/revisions/a6c6d28e705b834664c2ea6688b89c2c106204ae/patch?download
+ sha256sums = a9c680b181f18be8b39945e715b8a54640af74a4ed85c65a9de038085ad8be77
sha256sums = SKIP
sha256sums = dd2b5c4191e468972b5ea8ddb4fa2e2fa3c2c94c79fc06645d0efc0e63ce7ee1
sha256sums = fa3f703d599051135c5be24b81dfcb23190bb282db73121337ac76bc9638e8a5
- sha256sums = d81319f168dad0e411c8e810f73daa2f56ff579578771bd9c9bb1aa2d7c09a8b
sha256sums = d44b90fc7313afaa6d6f77cde72c0e9a5e4a1cc792216cbca2ed45c39658c472
sha256sums = 95ba939b9372e533ecbcc9ca034f3e9fc6621d3bddabb57c4d092ea69fa6c840
- sha256sums = 1c18149f776b38349060491fd626122e66638affa07111f3fc2f4974b4124e99
+ sha256sums = 1974fb5891b6a620113e9527026faa5af771042841ef7b8016ef74e0eaabc926
sha256sums = a688de2b3a7183ebf9eb25108b0d28a8c6228cc71c8e3519062a51224f5b3488
- sha256sums = 69958012fa3af965ce15a5d108e912e18acdb7c577ed6b53ec179624dfc4d1e3
+ sha256sums = 46eb584fc844e62a3e7bde19ac449698616c9373b23962b6d98e814ab73fe9c0
sha256sums = 6e9a345f810d36068ee74ebba4708c70ab30421dad3571b6be5e9db635078ea8
sha256sums = 11cffe305dd49027c91638261463871e9ecb0ecc6ecc02bfa37b203c5960ab58
sha256sums = fab4c65e2802e709a32d059784182be5a89bc3ca862a7e27810714ea7b86f868
sha256sums = 0d537830944814fe0854f834b5dc41dc5fc2428f77b2ad61d4a5e76b0fe99880
+ sha256sums = 35435e8dae76737baafecdc76d74a1c97281c4179e416556e033a06a31468e6d
+ sha256sums = 08a5678998a96679a02fcc1b9473e98b4563aa57b3eaa7b444ed2941ab6acd7d
pkgname = chromium-dev
diff --git a/PKGBUILD b/PKGBUILD
index 7f9e006bc105..d21e4f273e86 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,7 +17,7 @@ _debug_mode=0 # Build in debug mode.
## -- Package and components information -- ##
##############################################
pkgname=chromium-dev
-pkgver=62.0.3198.0
+pkgver=63.0.3213.3
pkgrel=1
pkgdesc="The open-source project behind Google Chrome (Dev Channel)"
arch=('i686' 'x86_64')
@@ -34,6 +34,7 @@ depends=(
'snappy'
'xdg-utils'
'libcups'
+ 'libxml2'
'harfbuzz-icu'
# 'protobuf'
# 'libevent'
@@ -75,11 +76,10 @@ source=( #"https://gsdview.appspot.com/chromium-browser-official/chromium-${pkgv
'chromium-dev.svg'
# Patch form Gentoo
'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-FORTIFY_SOURCE-r2.patch'
- 'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-gn-bootstrap-r17.patch'
'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-gcc5-r2.patch'
# Misc Patches
'minizip.patch'
- 'chromium-intel-vaapi_r2.patch' # Orig: https://chromium-review.googlesource.com/changes/532294/revisions/53b93dfe87fd10cced5d2a2a63072dfc7a2af6e4/patch?download
+ 'chromium-intel-vaapi_r14.patch.base64::https://chromium-review.googlesource.com/changes/532294/revisions/d60511c973e432b97d9929dcfbd77c9af25dbd51/patch?download'
'https://raw.githubusercontent.com/sjnewbury/gentoo-playground/master/www-client/chromium/files/chromium-intel-vaapi-fix.patch'
'https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/master/debian/patches/specify-max-resolution.patch'
# Patch from crbug (chromium bugtracker) or Arch chromium package
@@ -87,6 +87,8 @@ source=( #"https://gsdview.appspot.com/chromium-browser-official/chromium-${pkgv
'chromium-gcc-r1.patch::https://git.archlinux.org/svntogit/packages.git/plain/trunk/chromium-gcc-r1.patch?h=packages/chromium'
'chromium-blink-gcc7-r2.patch' # https://bugs.chromium.org/p/chromium/issues/detail?id=614289
'chromium-widevine-r1.patch'
+ 'c++17.patch::https://github.com/google/crc32c/commit/d0f929a5db87cb34d03afb0d8e8bfc95b8f786e3.patch'
+ 'chromium-gn-bootstrap-r18.patch.base64::https://chromium-review.googlesource.com/changes/667107/revisions/a6c6d28e705b834664c2ea6688b89c2c106204ae/patch?download'
)
sha256sums=( #"$(curl -sL https://gsdview.appspot.com/chromium-browser-official/chromium-${pkgver}.tar.xz.hashes | grep sha256 | cut -d ' ' -f3)"
"$(curl -sL https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}.tar.xz.hashes | grep sha256 | cut -d ' ' -f3)"
@@ -94,18 +96,19 @@ sha256sums=( #"$(curl -sL https://gsdview.appspot.com/chromium-browser-official/
'dd2b5c4191e468972b5ea8ddb4fa2e2fa3c2c94c79fc06645d0efc0e63ce7ee1'
# Patch form Gentoo
'fa3f703d599051135c5be24b81dfcb23190bb282db73121337ac76bc9638e8a5'
- 'd81319f168dad0e411c8e810f73daa2f56ff579578771bd9c9bb1aa2d7c09a8b'
'd44b90fc7313afaa6d6f77cde72c0e9a5e4a1cc792216cbca2ed45c39658c472'
# Misc Patches
'95ba939b9372e533ecbcc9ca034f3e9fc6621d3bddabb57c4d092ea69fa6c840'
- '1c18149f776b38349060491fd626122e66638affa07111f3fc2f4974b4124e99'
+ '1974fb5891b6a620113e9527026faa5af771042841ef7b8016ef74e0eaabc926'
'a688de2b3a7183ebf9eb25108b0d28a8c6228cc71c8e3519062a51224f5b3488'
- '69958012fa3af965ce15a5d108e912e18acdb7c577ed6b53ec179624dfc4d1e3'
+ '46eb584fc844e62a3e7bde19ac449698616c9373b23962b6d98e814ab73fe9c0'
# Patch from crbug (chromium bugtracker) or Arch chromium package
'6e9a345f810d36068ee74ebba4708c70ab30421dad3571b6be5e9db635078ea8'
'11cffe305dd49027c91638261463871e9ecb0ecc6ecc02bfa37b203c5960ab58'
'fab4c65e2802e709a32d059784182be5a89bc3ca862a7e27810714ea7b86f868'
'0d537830944814fe0854f834b5dc41dc5fc2428f77b2ad61d4a5e76b0fe99880'
+ '35435e8dae76737baafecdc76d74a1c97281c4179e416556e033a06a31468e6d'
+ '08a5678998a96679a02fcc1b9473e98b4563aa57b3eaa7b444ed2941ab6acd7d'
)
options=('!strip')
install=chromium-dev.install
@@ -180,6 +183,7 @@ _keeplibs=(
'third_party/angle/src/third_party/compiler'
'third_party/angle/src/third_party/libXNVCtrl'
'third_party/angle/src/third_party/trace_event'
+ 'third_party/blink'
'third_party/boringssl'
'third_party/brotli'
'third_party/cacheinvalidation'
@@ -196,6 +200,7 @@ _keeplibs=(
'third_party/ced'
'third_party/cld_2'
'third_party/cld_3'
+ 'third_party/crc32c'
'third_party/cros_system_api'
'third_party/devscripts'
'third_party/dom_distiller_js'
@@ -225,7 +230,7 @@ _keeplibs=(
'third_party/libvpx'
'third_party/libvpx/source/libvpx/third_party/x86inc'
'third_party/libwebm'
- 'third_party/libxml'
+ 'third_party/libxml/chromium'
'third_party/libyuv'
'third_party/lss'
'third_party/lzma_sdk'
@@ -345,7 +350,7 @@ _use_system=(
# 'libsrtp' # https://bugs.gentoo.org/459932
# 'libvpx' # Needs update
'libwebp'
-# 'libxml' # https://bugs.gentoo.org/616818
+ 'libxml'
'libxslt'
'openh264'
'opus'
@@ -394,14 +399,17 @@ prepare() {
msg2 "Patching the sources"
# Patch sources from Gentoo.
patch -p1 -i "${srcdir}/chromium-FORTIFY_SOURCE-r2.patch"
- patch -p1 -i "${srcdir}/chromium-gn-bootstrap-r17.patch"
+ base64 -d "${srcdir}/chromium-gn-bootstrap-r18.patch.base64" | patch -p1 -i -
patch -p1 -i "${srcdir}/chromium-gcc5-r2.patch"
# Misc Patches:
patch -p1 -i "${srcdir}/minizip.patch"
+ patch -d third_party/crc32c/src -p1 -i "${srcdir}/c++17.patch"
# Apply VAAPI patch
- patch -p1 -i "${srcdir}/chromium-intel-vaapi_r2.patch" # base64 -d "${srcdir}/chromium-intel-vaapi.base64" | patch -p1 -i -
+ base64 -d "${srcdir}/chromium-intel-vaapi_r14.patch.base64" > chromium-intel-vaapi_r14.patch
+ sed '39,50d' -i chromium-intel-vaapi_r14.patch
+ patch -Np1 -i chromium-intel-vaapi_r14.patch
patch -p1 -i "${srcdir}/chromium-intel-vaapi-fix.patch"
patch -p1 -i "${srcdir}/specify-max-resolution.patch"
sed 's|chromium-browser|chromium-dev|' -i media/gpu/vaapi_wrapper.h
@@ -495,7 +503,7 @@ prepare() {
_flags+=(
'is_clang=true'
'clang_use_chrome_plugins=true'
- )
+ )
_clang_path="${srcdir}/chromium-${pkgver}/third_party/llvm-build/Release+Asserts/bin"
_c_compiler="${_clang_path}/clang"
_cpp_compiler="${_clang_path}/clang++"
diff --git a/chromium-intel-vaapi_r2.patch b/chromium-intel-vaapi_r2.patch
deleted file mode 100644
index 7a22198afe42..000000000000
--- a/chromium-intel-vaapi_r2.patch
+++ /dev/null
@@ -1,909 +0,0 @@
-From 53b93dfe87fd10cced5d2a2a63072dfc7a2af6e4 Mon Sep 17 00:00:00 2001
-From: Daniel Charles <daniel.charles@intel.com>
-Date: Fri, 28 Jul 2017 16:31:47 -0700
-Subject: [PATCH] Enable VAVDA, VAVEA and VAJDA on linux with VAAPI only
-
-This patch contains all the changes necessary to use VA-API along with
-vaapi-driver to run all media use cases supported with hardware acceleration.
-
-It is intended to remain as experimental accessible from chrome://flags on linux.
-It requires libva/intel-vaapi-driver to be installed on the system path where
-chrome is executed. Other drivers could be tested if available. Flags are
-kept independent for linux, where this feature has to be enabled before
-actually using it. This should not change how other OSes use the flags
-already, the new flags will show at the buttom on the section of unavailable
-experiments
-
-The changes cover a range of compiler pre-processor flags to enable the stack.
-It moves the presandbox operations to the vaapi_wrapper class as the hook function
-is available there. vaInit will open driver on the correct installed folder.
-
-chrome flags consolidtation into only two flags for linux. Mjpeg and accelerated
-video are used. The other flags are kept for ChromeOS and other OSes.
-
-Developer testing was made on skylake hardware, ChromeOS and Ubuntu.
-
-BUG=NONE
-TEST="subjective testing with VAVDA,VAVEA and VAJDA, autotest for encoder"
-TEST="and decoder hardware accelerated"
-TEST="have libva/intel-vaapi-driver installed and not installed in the system"
-TEST="repeat on different hardware families"
-R=posciak@chromium.org
-R=kcwu@chromium.org
-
-Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
-Change-Id: Ifbbf5c9e5221a8b5733fc6d4d0cf984a1f103171
-Signed-off-by: Daniel Charles <daniel.charles@intel.com>
----
-
-diff --git a/AUTHORS b/AUTHORS
-index 79becdb..c2905ff 100644
---- a/AUTHORS
-+++ b/AUTHORS
-@@ -159,6 +159,7 @@
- Daniel Bevenius <daniel.bevenius@gmail.com>
- Daniel Bomar <dbdaniel42@gmail.com>
- Daniel Carvalho Liedke <dliedke@gmail.com>
-+Daniel Charles <daniel.charles@intel.com>
- Daniel Imms <daniimms@amazon.com>
- Daniel Johnson <danielj41@gmail.com>
- Daniel Lockyer <thisisdaniellockyer@gmail.com>
-diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
-index 4cb4ae5..19f663c 100644
---- a/chrome/browser/about_flags.cc
-+++ b/chrome/browser/about_flags.cc
-@@ -1161,12 +1161,14 @@
- flag_descriptions::kUiPartialSwapDescription, kOsAll,
- SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
- #if BUILDFLAG(ENABLE_WEBRTC)
-+#if !defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
- {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
- flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
- SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
- {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
- flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
- SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
-+#endif
- {"enable-webrtc-hw-h264-encoding",
- flag_descriptions::kWebrtcHwH264EncodingName,
- flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
-@@ -1474,6 +1476,13 @@
- flag_descriptions::kMultideviceDescription, kOsCrOS,
- FEATURE_VALUE_TYPE(features::kMultidevice)},
- #endif // OS_CHROMEOS
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ {
-+ "enable-accelerated-video", flag_descriptions::kAcceleratedVideoName,
-+ flag_descriptions::kAcceleratedVideoDescription, kOsLinux,
-+ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedVideo),
-+ },
-+#else
- {
- "disable-accelerated-video-decode",
- flag_descriptions::kAcceleratedVideoDecodeName,
-@@ -1481,6 +1490,7 @@
- kOsMac | kOsWin | kOsCrOS | kOsAndroid,
- SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
- },
-+#endif
- {"mojo-video-encode-accelerator",
- flag_descriptions::kMojoVideoEncodeAcceleratorName,
- flag_descriptions::kMojoVideoEncodeAcceleratorDescription,
-@@ -2127,12 +2137,17 @@
- FEATURE_VALUE_TYPE(chrome::android::kWebVrAutopresent)},
- #endif // OS_ANDROID
- #endif // ENABLE_VR
--#if defined(OS_CHROMEOS)
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ {"enable-accelerated-mjpeg-decode",
-+ flag_descriptions::kAcceleratedMjpegDecodeName,
-+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsLinux,
-+ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedMjpegDecode)},
-+#elif defined(OS_CHROMEOS)
- {"disable-accelerated-mjpeg-decode",
- flag_descriptions::kAcceleratedMjpegDecodeName,
- flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
- SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
--#endif // OS_CHROMEOS
-+#endif
- {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
- flag_descriptions::kV8CacheOptionsDescription, kOsAll,
- MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
-diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc
-index 7ac532c..0afa57b 100644
---- a/chrome/browser/chromeos/login/chrome_restart_request.cc
-+++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
-@@ -19,6 +19,7 @@
- #include "base/sys_info.h"
- #include "base/timer/timer.h"
- #include "base/values.h"
-+#include "build/build_config.h"
- #include "cc/base/switches.h"
- #include "chrome/browser/browser_process.h"
- #include "chrome/browser/chromeos/boot_times_recorder.h"
-@@ -79,8 +80,13 @@
- ::switches::kDisable2dCanvasImageChromium,
- ::switches::kDisableAccelerated2dCanvas,
- ::switches::kDisableAcceleratedJpegDecoding,
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ ::switches::kEnableAcceleratedMjpegDecode,
-+ ::switches::kEnableAcceleratedVideo,
-+#else
- ::switches::kDisableAcceleratedMjpegDecode,
- ::switches::kDisableAcceleratedVideoDecode,
-+#endif
- ::switches::kDisableBlinkFeatures,
- ::switches::kDisableCastStreamingHWEncoding,
- ::switches::kDisableDistanceFieldText,
-@@ -169,7 +175,7 @@
- ::switches::kDisableWebGLImageChromium,
- ::switches::kEnableWebGLImageChromium,
- ::switches::kEnableWebVR,
--#if BUILDFLAG(ENABLE_WEBRTC)
-+#if BUILDFLAG(ENABLE_WEBRTC) && (defined(OS_CHROMEOS) || defined(OS_ANDROID))
- ::switches::kDisableWebRtcHWDecoding,
- ::switches::kDisableWebRtcHWEncoding,
- #endif
-diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
-index 100f689..4e7ca96 100644
---- a/chrome/browser/flag_descriptions.cc
-+++ b/chrome/browser/flag_descriptions.cc
-@@ -11,6 +11,13 @@
- "Enables the use of the GPU to perform 2d canvas rendering instead of "
- "using software rendering.";
-
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+const char kAcceleratedVideoName[] = "Hardware-accelerated video";
-+const char kAcceleratedVideoDescription[] =
-+ "Hardware-accelerated video where VA-API driver is installed on the"
-+ "system.";
-+#endif
-+
- const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
- const char kAcceleratedVideoDecodeDescription[] =
- "Hardware-accelerated video decode where available.";
-@@ -1326,6 +1333,7 @@
- const char kWebrtcEchoCanceller3Description[] =
- "Experimental WebRTC echo canceller (AEC3).";
-
-+#if !defined(OS_LINUX) || !defined(OS_CHROMEOS)
- const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
- const char kWebrtcHwDecodingDescription[] =
- "Support in WebRTC for decoding video streams using platform hardware.";
-@@ -1333,6 +1341,7 @@
- const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
- const char kWebrtcHwEncodingDescription[] =
- "Support in WebRTC for encoding video streams using platform hardware.";
-+#endif
-
- const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
- const char kWebrtcHwH264EncodingDescription[] =
-@@ -2117,7 +2126,7 @@
-
- #endif // defined(OS_MACOSX)
-
--#if defined(OS_CHROMEOS)
-+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
-
- const char kAcceleratedMjpegDecodeName[] =
- "Hardware-accelerated mjpeg decode for captured frame";
-@@ -2126,7 +2135,7 @@
- "Enable hardware-accelerated mjpeg decode for captured frame where "
- "available.";
-
--#endif // defined(OS_CHROMEOS)
-+#endif // defined(OS_CHROMEOS) || BUILDFLAG(USE_VAAPI)
-
- #if defined(OS_WIN)
-
-diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
-index 3a99fb6..57e8c93 100644
---- a/chrome/browser/flag_descriptions.h
-+++ b/chrome/browser/flag_descriptions.h
-@@ -34,6 +34,10 @@
- extern const char kAccelerated2dCanvasName[];
- extern const char kAccelerated2dCanvasDescription[];
-
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+extern const char kAcceleratedVideoName[];
-+extern const char kAcceleratedVideoDescription[];
-+#endif
- extern const char kAcceleratedVideoDecodeName[];
- extern const char kAcceleratedVideoDecodeDescription[];
-
-@@ -1251,13 +1255,17 @@
-
- #endif // defined(OS_MACOSX)
-
--// Chrome OS ------------------------------------------------------------------
--
--#if defined(OS_CHROMEOS)
-+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
-
- extern const char kAcceleratedMjpegDecodeName[];
- extern const char kAcceleratedMjpegDecodeDescription[];
-
-+#endif
-+
-+// Chrome OS ------------------------------------------------------------------
-+
-+#if defined(OS_CHROMEOS)
-+
- extern const char kAllowTouchpadThreeFingerClickName[];
- extern const char kAllowTouchpadThreeFingerClickDescription[];
-
-diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
-index 0461556..3dc14164 100644
---- a/content/browser/gpu/compositor_util.cc
-+++ b/content/browser/gpu/compositor_util.cc
-@@ -104,7 +104,11 @@
- {"video_decode",
- manager->IsFeatureBlacklisted(
- gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
-+#else
- command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
-+#endif
- "Accelerated video decode has been disabled, either via blacklist,"
- " about:flags or the command line.",
- true},
-@@ -112,7 +116,11 @@
- {"video_encode",
- manager->IsFeatureBlacklisted(
- gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE),
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
-+#else
- command_line.HasSwitch(switches::kDisableWebRtcHWEncoding),
-+#endif
- "Accelerated video encode has been disabled, either via blacklist,"
- " about:flags or the command line.",
- true},
-diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
-index d1b78d7..92819ae 100644
---- a/content/browser/gpu/gpu_data_manager_impl_private.cc
-+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
-@@ -760,7 +760,11 @@
- DCHECK(command_line);
-
- if (ShouldDisableAcceleratedVideoDecode(command_line))
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ command_line->AppendSwitch(switches::kEnableAcceleratedVideo);
-+#else
- command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
-+#endif
-
- #if defined(USE_AURA)
- if (!CanUseGpuBrowserCompositor())
-@@ -818,7 +822,11 @@
- }
-
- if (ShouldDisableAcceleratedVideoDecode(command_line)) {
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ command_line->AppendSwitch(switches::kEnableAcceleratedVideo);
-+#else
- command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
-+#endif
- }
-
- if (gpu_driver_bugs_.find(gpu::CREATE_DEFAULT_GL_CONTEXT) !=
-@@ -912,7 +920,12 @@
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- if (!ShouldDisableAcceleratedVideoDecode(command_line) &&
-- !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ command_line->HasSwitch(switches::kEnableAcceleratedVideo)
-+#else
-+ !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)
-+#endif
-+ ) {
- prefs->pepper_accelerated_video_decode_enabled = true;
- }
- prefs->disable_2d_canvas_copy_on_write =
-@@ -1107,7 +1120,13 @@
- // to resolve crbug/442039 has been collected.
- const std::string group_name = base::FieldTrialList::FindFullName(
- "DisableAcceleratedVideoDecode");
-- if (command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
-+ if (
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ !command_line->HasSwitch(switches::kEnableAcceleratedVideo)
-+#else
-+ command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)
-+#endif
-+ ) {
- // It was already disabled on the command line.
- return false;
- }
-diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
-index 53e96f5..16379e8 100644
---- a/content/browser/gpu/gpu_process_host.cc
-+++ b/content/browser/gpu/gpu_process_host.cc
-@@ -116,7 +116,11 @@
- // Command-line switches to propagate to the GPU process.
- static const char* const kSwitchNames[] = {
- switches::kCreateDefaultGLContext,
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ switches::kEnableAcceleratedVideo,
-+#else
- switches::kDisableAcceleratedVideoDecode,
-+#endif
- switches::kDisableBreakpad,
- switches::kDisableES3GLContext,
- switches::kDisableGpuRasterization,
-@@ -126,7 +130,7 @@
- switches::kDisableLogging,
- switches::kDisableSeccompFilterSandbox,
- switches::kDisableShaderNameHashing,
--#if BUILDFLAG(ENABLE_WEBRTC)
-+#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_LINUX)
- switches::kDisableWebRtcHWEncoding,
- #endif
- #if defined(OS_WIN)
-diff --git a/content/browser/renderer_host/media/video_capture_browsertest.cc b/content/browser/renderer_host/media/video_capture_browsertest.cc
-index e4c37d1..4634e92 100644
---- a/content/browser/renderer_host/media/video_capture_browsertest.cc
-+++ b/content/browser/renderer_host/media/video_capture_browsertest.cc
-@@ -154,8 +154,13 @@
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kUseFakeJpegDecodeAccelerator);
- } else {
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
-+ switches::kEnableAcceleratedMjpegDecode);
-+#else
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kDisableAcceleratedMjpegDecode);
-+#endif
- }
- if (params_.use_mojo_service) {
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
-diff --git a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
-index 6970008..89ba93d 100644
---- a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
-+++ b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
-@@ -56,15 +56,21 @@
- bool is_platform_supported =
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUseFakeJpegDecodeAccelerator);
--#if defined(OS_CHROMEOS)
-- // Non-ChromeOS platforms do not support HW JPEG decode now. Do not establish
-- // gpu channel to avoid introducing overhead.
-+#if !defined(OS_ANDROID) && defined(OS_LINUX)
-+ // Non-ChromeOS or Non-Linux platforms do not support HW JPEG decode now. Do
-+ // not establish gpu channel to avoid introducing overhead.
- is_platform_supported = true;
- #endif
-
- if (!is_platform_supported ||
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
-+ switches::kEnableAcceleratedMjpegDecode)
-+#else
- base::CommandLine::ForCurrentProcess()->HasSwitch(
-- switches::kDisableAcceleratedMjpegDecode)) {
-+ switches::kDisableAcceleratedMjpegDecode)
-+#endif
-+ ) {
- decoder_status_ = FAILED;
- RecordInitDecodeUMA_Locked();
- return;
-diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index a750cdc..bd05641 100644
---- a/content/browser/renderer_host/render_process_host_impl.cc
-+++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -2450,7 +2450,11 @@
- switches::kDisable2dCanvasImageChromium,
- switches::kDisable3DAPIs,
- switches::kDisableAcceleratedJpegDecoding,
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ switches::kEnableAcceleratedVideo,
-+#else
- switches::kDisableAcceleratedVideoDecode,
-+#endif
- switches::kDisableBackgroundTimerThrottling,
- switches::kDisableBlinkFeatures,
- switches::kDisableBreakpad,
-@@ -2603,8 +2607,10 @@
- switches::kEnablePepperTesting,
- #endif
- #if BUILDFLAG(ENABLE_WEBRTC)
-+#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
- switches::kDisableWebRtcHWDecoding,
- switches::kDisableWebRtcHWEncoding,
-+#endif
- switches::kEnableWebRtcSrtpAesGcm,
- switches::kEnableWebRtcStunOrigin,
- switches::kEnforceWebRtcIPPermissionCheck,
-diff --git a/content/browser/webrtc/webrtc_media_recorder_browsertest.cc b/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
-index 3d815a2..2c96048 100644
---- a/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
-+++ b/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
-@@ -58,7 +58,12 @@
- return;
- // This flag is also used for encoding, https://crbug.com/616640.
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
-- switches::kDisableAcceleratedVideoDecode);
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ switches::kEnableAcceleratedVideo
-+#else
-+ switches::kDisableAcceleratedVideoDecode
-+#endif
-+ );
- }
-
- private:
-diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
-index fe2f298a..507f481 100644
---- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
-+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
-@@ -56,22 +56,6 @@
- #endif
- }
-
--inline bool IsArchitectureX86_64() {
--#if defined(__x86_64__)
-- return true;
--#else
-- return false;
--#endif
--}
--
--inline bool IsArchitectureI386() {
--#if defined(__i386__)
-- return true;
--#else
-- return false;
--#endif
--}
--
- inline bool IsArchitectureArm() {
- #if defined(__arm__) || defined(__aarch64__)
- return true;
-@@ -96,21 +80,14 @@
- #endif
- }
-
--bool IsAcceleratedVaapiVideoEncodeEnabled() {
-- bool accelerated_encode_enabled = false;
--#if defined(OS_CHROMEOS)
-- const base::CommandLine& command_line =
-- *base::CommandLine::ForCurrentProcess();
-- accelerated_encode_enabled =
-- !command_line.HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode);
--#endif
-- return accelerated_encode_enabled;
--}
--
- bool IsAcceleratedVideoDecodeEnabled() {
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ return command_line.HasSwitch(switches::kEnableAcceleratedVideo);
-+#else
- return !command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode);
-+#endif
- }
-
- intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args,
-@@ -296,33 +273,6 @@
- GpuBrokerProcessPolicy::Create,
- std::vector<BrokerFilePermission>()); // No extra files in whitelist.
-
-- if (IsArchitectureX86_64() || IsArchitectureI386()) {
-- // Accelerated video dlopen()'s some shared objects
-- // inside the sandbox, so preload them now.
-- if (IsAcceleratedVaapiVideoEncodeEnabled() ||
-- IsAcceleratedVideoDecodeEnabled()) {
-- const char* I965DrvVideoPath = NULL;
-- const char* I965HybridDrvVideoPath = NULL;
--
-- if (IsArchitectureX86_64()) {
-- I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so";
-- I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so";
-- } else if (IsArchitectureI386()) {
-- I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so";
-- }
--
-- dlopen(I965DrvVideoPath, RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
-- if (I965HybridDrvVideoPath)
-- dlopen(I965HybridDrvVideoPath, RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
-- dlopen("libva.so.1", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
--#if defined(USE_OZONE)
-- dlopen("libva-drm.so.1", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
--#elif defined(USE_X11)
-- dlopen("libva-x11.so.1", RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
--#endif
-- }
-- }
--
- return true;
- }
-
-diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
-index a5424bb..b68b802 100644
---- a/content/gpu/BUILD.gn
-+++ b/content/gpu/BUILD.gn
-@@ -45,7 +45,6 @@
- ]
-
- configs += [ "//content:content_implementation" ]
--
- deps = [
- "//base",
- "//base/third_party/dynamic_annotations",
-@@ -114,4 +113,8 @@
- if (enable_vulkan) {
- deps += [ "//gpu/vulkan" ]
- }
-+
-+ if (is_desktop_linux) {
-+ public_configs = [ "//media/gpu:libva_config" ]
-+ }
- }
-diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
-index 4b87a8c..1bbf7c8 100644
---- a/content/gpu/gpu_main.cc
-+++ b/content/gpu/gpu_main.cc
-@@ -246,7 +246,7 @@
- // Initializes StatisticsRecorder which tracks UMA histograms.
- base::StatisticsRecorder::Initialize();
-
--#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
-+#if defined(OS_LINUX)
- // Set thread priority before sandbox initialization.
- base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
- #endif
-@@ -274,7 +274,7 @@
- GetContentClient()->SetGpuInfo(gpu_init.gpu_info());
-
- base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
--#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
-+#if defined(OS_LINUX)
- io_thread_priority = base::ThreadPriority::DISPLAY;
- #endif
-
-diff --git a/content/public/browser/gpu_utils.cc b/content/public/browser/gpu_utils.cc
-index a4145ba..e9ff010 100644
---- a/content/public/browser/gpu_utils.cc
-+++ b/content/public/browser/gpu_utils.cc
-@@ -7,6 +7,7 @@
- #include "base/command_line.h"
- #include "base/single_thread_task_runner.h"
- #include "base/strings/string_number_conversions.h"
-+#include "build/build_config.h"
- #include "content/browser/gpu/gpu_process_host.h"
- #include "content/public/common/content_features.h"
- #include "content/public/common/content_switches.h"
-@@ -56,12 +57,19 @@
- gpu_preferences.ui_prioritize_in_gpu_process =
- command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess);
- gpu_preferences.disable_accelerated_video_decode =
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
-+#else
- command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
--#if defined(OS_CHROMEOS)
-+#endif
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ gpu_preferences.disable_vaapi_accelerated_video_encode =
-+ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
-+#elif defined(OS_CHROMEOS)
- gpu_preferences.disable_vaapi_accelerated_video_encode =
- command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode);
- #endif
--#if BUILDFLAG(ENABLE_WEBRTC)
-+#if BUILDFLAG(ENABLE_WEBRTC) && (!defined(OS_LINUX) || defined(OS_CHROMEOS))
- gpu_preferences.disable_web_rtc_hw_encoding =
- command_line->HasSwitch(switches::kDisableWebRtcHWEncoding);
- #endif
-diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
-index d7101f4..d81b381 100644
---- a/content/public/common/content_switches.cc
-+++ b/content/public/common/content_switches.cc
-@@ -85,12 +85,21 @@
-
- // Disable gpu-accelerated 2d canvas.
- const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas";
--
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+// Enable hardware accelerated mjpeg decode on linux
-+const char kEnableAcceleratedMjpegDecode[] = "enable-accelerated-mjpeg-decode";
-+#else
- // Disable hardware acceleration of mjpeg decode for captured frame, where
- // available.
- const char kDisableAcceleratedMjpegDecode[] =
- "disable-accelerated-mjpeg-decode";
-+#endif
-
-+#if defined(OS_LINUX)
-+// Enables hardware acceleration of video for Linux only. VA-API driver
-+// is required to be present on the system installation.
-+const char kEnableAcceleratedVideo[] = "enable-accelerated-video";
-+#endif
- // Disables hardware acceleration of video decode, where available.
- const char kDisableAcceleratedVideoDecode[] =
- "disable-accelerated-video-decode";
-@@ -915,11 +924,13 @@
- // ignores this switch on its stable and beta channels.
- const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption";
-
-+#if defined(OS_CHROMEOS)
- // Disables HW decode acceleration for WebRTC.
- const char kDisableWebRtcHWDecoding[] = "disable-webrtc-hw-decoding";
-
- // Disables HW encode acceleration for WebRTC.
- const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
-+#endif
-
- // Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
- // See https://tools.ietf.org/html/rfc7714 for further information.
-diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
-index 0227769..6d72feb 100644
---- a/content/public/common/content_switches.h
-+++ b/content/public/common/content_switches.h
-@@ -34,7 +34,11 @@
- CONTENT_EXPORT extern const char kDisable3DAPIs[];
- CONTENT_EXPORT extern const char kDisableAccelerated2dCanvas[];
- CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[];
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+CONTENT_EXPORT extern const char kEnableAcceleratedMjpegDecode[];
-+#else
- CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
-+#endif
- CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[];
- CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[];
- extern const char kDisableBackingStoreLimit[];
-@@ -107,6 +111,9 @@
- CONTENT_EXPORT extern const char kDomAutomationController[];
- extern const char kDisable2dCanvasClipAntialiasing[];
- CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
-+CONTENT_EXPORT extern const char kEnableAcceleratedVideo[];
-+#endif
- CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
- CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[];
- CONTENT_EXPORT extern const char kEnableBlinkFeatures[];
-@@ -257,8 +264,10 @@
-
- #if BUILDFLAG(ENABLE_WEBRTC)
- CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
-+#if defined(OS_CHROMEOS)
- CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
- CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
-+#endif
- CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
- CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
- CONTENT_EXPORT extern const char kEnforceWebRtcIPPermissionCheck[];
-diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
-index 38fa749..7f7bf18 100644
---- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
-+++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
-@@ -240,10 +240,19 @@
-
- const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
- if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
-+#else
- if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
-+#endif
- decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
-
-- if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
-+#else
-+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
-+#endif
-+ {
- encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
- }
- }
-diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
-index 763f2fe..603660f 100644
---- a/content/renderer/render_thread_impl.cc
-+++ b/content/renderer/render_thread_impl.cc
-@@ -1443,7 +1443,11 @@
- scoped_refptr<base::SingleThreadTaskRunner> media_task_runner =
- GetMediaThreadTaskRunner();
- const bool enable_video_accelerator =
-+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-+ cmd_line->HasSwitch(switches::kEnableAcceleratedVideo);
-+#else
- !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
-+#endif
- const bool enable_gpu_memory_buffer_video_frames =
- #if defined(OS_MACOSX) || defined(OS_LINUX)
- !cmd_line->HasSwitch(switches::kDisableGpuMemoryBufferVideoFrames) &&
-diff --git a/gpu/command_buffer/service/gpu_preferences.h b/gpu/command_buffer/service/gpu_preferences.h
-index 8dd0ff1..d6e5c59 100644
---- a/gpu/command_buffer/service/gpu_preferences.h
-+++ b/gpu/command_buffer/service/gpu_preferences.h
-@@ -50,7 +50,7 @@
- // Disables hardware acceleration of video decode, where available.
- bool disable_accelerated_video_decode = false;
-
--#if defined(OS_CHROMEOS)
-+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
- // Disables VA-API accelerated video encode.
- bool disable_vaapi_accelerated_video_encode = false;
- #endif
-diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json
-index ed5c6d6..4c45159 100644
---- a/gpu/config/software_rendering_list.json
-+++ b/gpu/config/software_rendering_list.json
-@@ -371,17 +371,6 @@
- ]
- },
- {
-- "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",
- "cr_bugs": [145531, 332596, 571899, 629434],
-diff --git a/media/filters/BUILD.gn b/media/filters/BUILD.gn
-index e8ff812..18735d2 100644
---- a/media/filters/BUILD.gn
-+++ b/media/filters/BUILD.gn
-@@ -195,7 +195,7 @@
- ]
- }
-
-- if (current_cpu != "arm" && is_chromeos) {
-+ if (current_cpu != "arm" && (is_chromeos || is_desktop_linux)) {
- sources += [
- "h264_bitstream_buffer.cc",
- "h264_bitstream_buffer.h",
-diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
-index 3a65c75..dd2d957 100644
---- a/media/gpu/BUILD.gn
-+++ b/media/gpu/BUILD.gn
-@@ -25,6 +25,14 @@
- import("//build/config/mac/mac_sdk.gni")
- }
-
-+if (is_desktop_linux && use_vaapi) {
-+ import("//build/config/linux/pkg_config.gni")
-+
-+ pkg_config("libva_config") {
-+ packages = [ "libva" ]
-+ }
-+}
-+
- if (use_vaapi) {
- action("libva_generate_stubs") {
- extra_header = "va_stub_header.fragment"
-@@ -258,7 +266,7 @@
- }
- }
-
-- if (is_chromeos) {
-+ if (is_chromeos || is_desktop_linux) {
- sources += [
- "vp8_decoder.cc",
- "vp8_decoder.h",
-@@ -341,6 +349,9 @@
- "vaapi_drm_picture.h",
- ]
- }
-+ if (is_desktop_linux) {
-+ public_configs = [ ":libva_config" ]
-+ }
- }
-
- if (is_win) {
-@@ -387,7 +398,7 @@
- }
-
- # TODO(watk): Run this on bots. http://crbug.com/461437
--if (is_win || is_android || use_v4l2_codec || use_vaapi) {
-+if (is_win || is_android || use_v4l2_codec || use_vaapi || is_desktop_linux) {
- test("video_decode_accelerator_unittest") {
- sources = [
- "video_accelerator_unittest_helpers.h",
-@@ -500,7 +511,7 @@
- }
- }
-
--if (use_v4l2_codec || use_vaapi || is_mac || is_win) {
-+if (use_v4l2_codec || use_vaapi || is_mac || is_win || is_desktop_linux) {
- test("video_encode_accelerator_unittest") {
- deps = [
- "//base",
-@@ -532,7 +543,7 @@
- }
- }
-
--if (use_v4l2_codec || use_vaapi) {
-+if (use_v4l2_codec || use_vaapi || is_desktop_linux) {
- test("jpeg_decode_accelerator_unittest") {
- deps = [
- "//base",
-diff --git a/media/gpu/gpu_video_decode_accelerator_factory.cc b/media/gpu/gpu_video_decode_accelerator_factory.cc
-index b440d26..1558796 100644
---- a/media/gpu/gpu_video_decode_accelerator_factory.cc
-+++ b/media/gpu/gpu_video_decode_accelerator_factory.cc
-@@ -18,7 +18,7 @@
- #include "media/gpu/dxva_video_decode_accelerator_win.h"
- #elif defined(OS_MACOSX)
- #include "media/gpu/vt_video_decode_accelerator_mac.h"
--#elif defined(OS_CHROMEOS)
-+#elif defined(OS_CHROMEOS) || defined(OS_LINUX)
- #if defined(USE_V4L2_CODEC)
- #include "media/gpu/v4l2_device.h"
- #include "media/gpu/v4l2_slice_video_decode_accelerator.h"
-@@ -85,6 +85,7 @@
- // profile (instead of calculating a superset).
- // TODO(posciak,henryhsu): improve this so that we choose a superset of
- // resolutions and other supported profile parameters.
-+ DVLOG(1) << "Get Supported profiles";
- #if defined(OS_WIN)
- capabilities.supported_profiles =
- DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences,
-diff --git a/media/gpu/gpu_video_encode_accelerator_factory.cc b/media/gpu/gpu_video_encode_accelerator_factory.cc
-index d1b8ff3..c3f1f03 100644
---- a/media/gpu/gpu_video_encode_accelerator_factory.cc
-+++ b/media/gpu/gpu_video_encode_accelerator_factory.cc
-@@ -9,7 +9,7 @@
- #include "media/gpu/features.h"
- #include "media/gpu/gpu_video_accelerator_util.h"
-
--#if defined(OS_CHROMEOS)
-+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
- #if defined(USE_V4L2_CODEC)
- #include "media/gpu/v4l2_video_encode_accelerator.h"
- #endif
-diff --git a/media/gpu/vaapi_wrapper.cc b/media/gpu/vaapi_wrapper.cc
-index 0739e56..b059fd4 100644
---- a/media/gpu/vaapi_wrapper.cc
-+++ b/media/gpu/vaapi_wrapper.cc
-@@ -1110,6 +1110,7 @@
- if (drm_file.IsValid())
- GetDisplayState()->SetDrmFd(drm_file.GetPlatformFile());
- #endif
-+ GetProfileInfos(); // dlopen all necessary libraries
- }
-
- // static
-diff --git a/services/ui/gpu/gpu_main.cc b/services/ui/gpu/gpu_main.cc
-index f1b8567..15cf123 100644
---- a/services/ui/gpu/gpu_main.cc
-+++ b/services/ui/gpu/gpu_main.cc
-@@ -10,6 +10,7 @@
- #include "base/power_monitor/power_monitor_device_source.h"
- #include "base/single_thread_task_runner.h"
- #include "base/threading/sequenced_task_runner_handle.h"
-+#include "build/build_config.h"
- #include "components/viz/service/display_embedder/gpu_display_provider.h"
- #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
- #include "gpu/command_buffer/common/activity_flags.h"
-@@ -79,7 +80,7 @@
- thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
- #endif
-
--#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
-+#if defined(OS_LINUX)
- thread_options.priority = base::ThreadPriority::DISPLAY;
- #endif
- CHECK(gpu_thread_.StartWithOptions(thread_options));
-@@ -89,7 +90,7 @@
- // should be possible to use |main_task_runner_| for doing IO tasks.
- thread_options = base::Thread::Options(base::MessageLoop::TYPE_IO, 0);
- thread_options.priority = base::ThreadPriority::NORMAL;
--#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
-+#if defined(OS_LINUX)
- // TODO(reveman): Remove this in favor of setting it explicitly for each type
- // of process.
- thread_options.priority = base::ThreadPriority::DISPLAY;