Blame qtwebengine-webrtc-system-openh264.patch

fdbce72
diff --git a/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/BUILD.gn b/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/BUILD.gn
fdbce72
index 738d3d4ed..8344a19b0 100644
fdbce72
--- a/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/BUILD.gn
fdbce72
+++ b/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/BUILD.gn
fdbce72
@@ -6,6 +6,7 @@
fdbce72
 # in the file PATENTS.  All contributing project authors may
fdbce72
 # be found in the AUTHORS file in the root of the source tree.
fdbce72
 
fdbce72
+import("//build/config/linux/pkg_config.gni")
fdbce72
 import("//third_party/libaom/options.gni")
fdbce72
 import("../../webrtc.gni")
fdbce72
 
fdbce72
@@ -453,6 +454,14 @@ rtc_library("video_coding_utility") {
fdbce72
   ]
fdbce72
 }
fdbce72
 
fdbce72
+if (rtc_use_h264 && rtc_use_system_openh264) {
fdbce72
+  pkg_config("openh264") {
fdbce72
+    packages = [
fdbce72
+      "openh264",
fdbce72
+    ]
fdbce72
+  }
fdbce72
+}
fdbce72
+
fdbce72
 rtc_library("webrtc_h264") {
fdbce72
   visibility = [ "*" ]
fdbce72
   sources = [
fdbce72
@@ -501,8 +510,14 @@ rtc_library("webrtc_h264") {
fdbce72
   if (rtc_use_h264) {
fdbce72
     deps += [
fdbce72
       "//third_party/ffmpeg",
fdbce72
-      "//third_party/openh264:encoder",
fdbce72
     ]
fdbce72
+
fdbce72
+    if (rtc_use_system_openh264) {
fdbce72
+      configs += [":openh264"]
fdbce72
+    } else {
fdbce72
+      deps += [ "//third_party/openh264:encoder" ]
fdbce72
+    }
fdbce72
+
fdbce72
     if (!build_with_mozilla) {
fdbce72
       deps += [ "../../media:rtc_media_base" ]
fdbce72
     }
fdbce72
diff --git a/src/3rdparty/chromium/third_party/webrtc/webrtc.gni b/src/3rdparty/chromium/third_party/webrtc/webrtc.gni
fdbce72
index 82870d2db..12231becc 100644
fdbce72
--- a/src/3rdparty/chromium/third_party/webrtc/webrtc.gni
fdbce72
+++ b/src/3rdparty/chromium/third_party/webrtc/webrtc.gni
fdbce72
@@ -192,6 +192,9 @@ declare_args() {
fdbce72
   # Enable to use H265
fdbce72
   rtc_use_h265 = proprietary_codecs
fdbce72
 
fdbce72
+  # Allow to use system OpenH264
fdbce72
+  rtc_use_system_openh264 = false
fdbce72
+
fdbce72
   # Enable this flag to make webrtc::Mutex be implemented by absl::Mutex.
fdbce72
   rtc_use_absl_mutex = false
fdbce72
 
fdbce72
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
fdbce72
index e7432d0c7..394f05011 100644
fdbce72
--- a/src/core/CMakeLists.txt
fdbce72
+++ b/src/core/CMakeLists.txt
fdbce72
@@ -436,6 +436,9 @@ foreach(arch ${archs})
fdbce72
                 use_udev=true
fdbce72
                 is_cfi=false
fdbce72
                 use_ozone=true
fdbce72
+                media_use_openh264=true
fdbce72
+                rtc_use_h264=true
fdbce72
+                rtc_use_system_openh264=true
fdbce72
                 ozone_auto_platforms=false
fdbce72
                 ozone_platform_headless=false
fdbce72
                 ozone_platform_external=true