summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0103.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0103.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0103.patch101
1 files changed, 71 insertions, 30 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0103.patch b/third_party/libwebrtc/moz-patch-stack/0103.patch
index a6da56ee72..9f518a2ac0 100644
--- a/third_party/libwebrtc/moz-patch-stack/0103.patch
+++ b/third_party/libwebrtc/moz-patch-stack/0103.patch
@@ -1,33 +1,74 @@
-From: Andreas Pehrson <apehrson@mozilla.com>
-Date: Fri, 2 Feb 2024 18:43:00 +0000
-Subject: Bug 1878010 - Fix webrtc::VideoCaptureFactory for BSD.
- r=grulja,gaston,webrtc-reviewers,mjf
+From: Dan Baker <dbaker@mozilla.com>
+Date: Thu, 14 Mar 2024 10:51:00 -0600
+Subject: Bug 1883116 - (fix-e79e722834) add enviroment_factory to libwebrtc
+ build and enforce providing clock and task_queue when creating Environment
-Differential Revision: https://phabricator.services.mozilla.com/D200427
-Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/f890637efe5abc0020fab83ff2224313cd0c8460
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2185cab977988fd4ab03b38dc67f9b06162444da
---
- modules/video_capture/video_capture_factory.cc | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ BUILD.gn | 1 +
+ api/environment/environment_factory.cc | 10 ++++++++++
+ api/task_queue/BUILD.gn | 5 +++++
+ 3 files changed, 16 insertions(+)
-diff --git a/modules/video_capture/video_capture_factory.cc b/modules/video_capture/video_capture_factory.cc
-index e085ac2df8..2790fbbe1c 100644
---- a/modules/video_capture/video_capture_factory.cc
-+++ b/modules/video_capture/video_capture_factory.cc
-@@ -24,7 +24,7 @@ rtc::scoped_refptr<VideoCaptureModule> VideoCaptureFactory::Create(
- const char* deviceUniqueIdUTF8) {
- // This is only implemented on pure Linux and WEBRTC_LINUX is defined for
- // Android as well
--#if !defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
-+#if (!defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)) || defined(WEBRTC_ANDROID)
- return nullptr;
- #else
- return videocapturemodule::VideoCaptureImpl::Create(options,
-@@ -40,7 +40,7 @@ VideoCaptureModule::DeviceInfo* VideoCaptureFactory::CreateDeviceInfo(
- VideoCaptureOptions* options) {
- // This is only implemented on pure Linux and WEBRTC_LINUX is defined for
- // Android as well
--#if !defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
-+#if (!defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)) || defined(WEBRTC_ANDROID)
- return nullptr;
- #else
- return videocapturemodule::VideoCaptureImpl::CreateDeviceInfo(options);
+diff --git a/BUILD.gn b/BUILD.gn
+index 7feca08e60..85ead4162f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -580,6 +580,7 @@ if (!build_with_chromium) {
+
+ if (build_with_mozilla) {
+ deps += [
++ "api/environment:environment_factory",
+ "api/video:video_frame",
+ "api/video:video_rtp_headers",
+ "test:rtp_test_utils",
+diff --git a/api/environment/environment_factory.cc b/api/environment/environment_factory.cc
+index c0b681aa08..6f0ec40dbe 100644
+--- a/api/environment/environment_factory.cc
++++ b/api/environment/environment_factory.cc
+@@ -97,12 +97,22 @@ Environment EnvironmentFactory::CreateWithDefaults() && {
+ if (field_trials_ == nullptr) {
+ Set(std::make_unique<FieldTrialBasedConfig>());
+ }
++#if defined(WEBRTC_MOZILLA_BUILD)
++ // We want to use our clock, not GetRealTimeClockRaw, and we avoid
++ // building the code under third_party/libwebrtc/task_queue. To
++ // ensure we're setting up things correctly, namely providing an
++ // Environment object with a preset task_queue_factory and clock,
++ // we'll do a release assert here.
++ RTC_CHECK(clock_);
++ RTC_CHECK(task_queue_factory_);
++#else
+ if (clock_ == nullptr) {
+ Set(Clock::GetRealTimeClock());
+ }
+ if (task_queue_factory_ == nullptr) {
+ Set(CreateDefaultTaskQueueFactory(field_trials_));
+ }
++#endif
+ if (event_log_ == nullptr) {
+ Set(std::make_unique<RtcEventLogNull>());
+ }
+diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn
+index b9bc81171f..c24c22a1f6 100644
+--- a/api/task_queue/BUILD.gn
++++ b/api/task_queue/BUILD.gn
+@@ -88,6 +88,10 @@ rtc_library("task_queue_test") {
+ }
+
+ rtc_library("default_task_queue_factory") {
++# Mozilla - disable this entire target to avoid inclusion of code we want
++# to avoid. Better here than trying to wack-a-mole for places that list
++# it as a dependency.
++if (!build_with_mozilla) {
+ visibility = [ "*" ]
+ if (!is_ios && !is_android) {
+ # Internally webrtc shouldn't rely on any specific TaskQueue implementation
+@@ -126,6 +130,7 @@ rtc_library("default_task_queue_factory") {
+ sources += [ "default_task_queue_factory_stdlib.cc" ]
+ deps += [ "../../rtc_base:rtc_task_queue_stdlib" ]
+ }
++} # of if (!build_with_mozilla) {
+ }
+
+ rtc_library("pending_task_safety_flag") {