Blob Blame History Raw

# HG changeset patch
# User stransky <stransky@redhat.com>
# Date 1604562423 0
# Node ID d1a244822d7811575f5bb3cd024f8f324275aec2
# Parent  998e6d0b24e4a560e5664aaef87307e9c069ad87
Bug 1672989 Build PipeWire as a part of default builds, r=dminor

Differential Revision: https://phabricator.services.mozilla.com/D94590

diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn b/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn
@@ -152,22 +152,17 @@ if (rtc_include_tests) {
       "../../rtc_base:rtc_base_approved",
       "../../test:test_support",
     ]
   }
 }
 
 if (is_linux) {
   if (rtc_use_pipewire) {
-    pkg_config("pipewire") {
-      packages = [ "libpipewire-0.2" ]
-
-      defines = [ "WEBRTC_USE_PIPEWIRE" ]
-    }
-
+    defines = [ "WEBRTC_USE_PIPEWIRE" ]
     pkg_config("gio") {
       packages = [
         "gio-2.0",
         "gio-unix-2.0",
       ]
     }
   }
 }
@@ -326,16 +321,17 @@ rtc_static_library("desktop_capture_gene
   } else {
     sources += [
       "fake_desktop_capturer.cc",
       "fake_desktop_capturer.h",
     ]
   }
 
   if (use_x11 || rtc_use_pipewire) {
+    include_dirs = [ "/third_party/libwebrtc/third_party/pipewire" ]
     sources += [
       "mouse_cursor_monitor_linux.cc",
       "screen_capturer_linux.cc",
       "window_capturer_linux.cc",
     ]
   }
 
   if (use_x11) {
@@ -367,16 +363,17 @@ rtc_static_library("desktop_capture_gene
         "linux/desktop_device_info_x11.h",
         "linux/shared_x_util.cc",
         "linux/shared_x_util.h",
       ]
     }
   }
 
   if (rtc_use_pipewire) {
+    include_dirs = [ "/third_party/libwebrtc/third_party/pipewire" ]
     sources += [
       "linux/base_capturer_pipewire.cc",
       "linux/base_capturer_pipewire.h",
       "linux/screen_capturer_pipewire.cc",
       "linux/screen_capturer_pipewire.h",
       "linux/window_capturer_pipewire.cc",
       "linux/window_capturer_pipewire.h",
     ]
diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
@@ -20,17 +20,18 @@ DEFINES["WEBRTC_RESTRICT_LOGGING"] = Tru
 FINAL_LIBRARY = "webrtc"
 
 
 LOCAL_INCLUDES += [
     "!/ipc/ipdl/_ipdlheaders",
     "/ipc/chromium/src",
     "/ipc/glue",
     "/media/libyuv/libyuv/include/",
-    "/third_party/libwebrtc/webrtc/"
+    "/third_party/libwebrtc/webrtc/",
+    "/third_party/pipewire"
 ]
 
 UNIFIED_SOURCES += [
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/capture_result_desktop_capturer_wrapper.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/cropped_desktop_frame.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/cropping_window_capturer.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc",
@@ -156,16 +157,17 @@ if CONFIG["OS_TARGET"] == "FreeBSD":
 
 if CONFIG["OS_TARGET"] == "Linux":
 
     DEFINES["USE_NSS_CERTS"] = "1"
     DEFINES["USE_X11"] = "1"
     DEFINES["WEBRTC_LINUX"] = True
     DEFINES["WEBRTC_POSIX"] = True
     DEFINES["_FILE_OFFSET_BITS"] = "64"
+    DEFINES["WEBRTC_USE_PIPEWIRE"] = "1"
 
     OS_LIBS += [
         "rt",
         "X11",
         "X11-xcb",
         "xcb",
         "Xcomposite",
         "Xcursor",
@@ -188,16 +190,24 @@ if CONFIG["OS_TARGET"] == "Linux":
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/x_atom_cache.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/x_error_trap.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/x_server_pixel_buffer.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/screen_capturer_linux.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
+    CXXFLAGS += CONFIG['TK_CFLAGS']
+
+    UNIFIED_SOURCES += [
+        "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+        "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
+        "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc"
+    ]
+
 if CONFIG["OS_TARGET"] == "NetBSD":
 
     DEFINES["USE_X11"] = "1"
     DEFINES["WEBRTC_BSD"] = True
     DEFINES["WEBRTC_POSIX"] = True
     DEFINES["_FILE_OFFSET_BITS"] = "64"
 
     OS_LIBS += [
diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h
@@ -136,15 +136,15 @@ class DesktopCaptureOptions {
 #if defined(USE_X11)
   bool use_update_notifications_ = false;
 #else
   bool use_update_notifications_ = true;
 #endif
   bool disable_effects_ = true;
   bool detect_updated_region_ = false;
 #if defined(WEBRTC_USE_PIPEWIRE)
-  bool allow_pipewire_ = false;
+  bool allow_pipewire_ = true;
 #endif
 };
 
 }  // namespace webrtc
 
 #endif  // MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_
diff --git a/third_party/libwebrtc/webrtc/moz.build b/third_party/libwebrtc/webrtc/moz.build
--- a/third_party/libwebrtc/webrtc/moz.build
+++ b/third_party/libwebrtc/webrtc/moz.build
@@ -181,16 +181,19 @@ if CONFIG["OS_TARGET"] == "Linux":
 
     DIRS += [
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/webrtc/modules/video_capture/video_capture_internal_impl_gn",
         "/third_party/libwebrtc/webrtc/system_wrappers/cpu_features_linux_gn"
     ]
+    DIRS += [
+        "/third_party/pipewire/libpipewire"
+    ]
 
 if CONFIG["OS_TARGET"] == "NetBSD":
 
     DIRS += [
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/webrtc/modules/video_capture/video_capture_internal_impl_gn"