diff options
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0101.patch')
-rw-r--r-- | third_party/libwebrtc/moz-patch-stack/0101.patch | 212 |
1 files changed, 99 insertions, 113 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0101.patch b/third_party/libwebrtc/moz-patch-stack/0101.patch index 07be6fc934..4955e0efef 100644 --- a/third_party/libwebrtc/moz-patch-stack/0101.patch +++ b/third_party/libwebrtc/moz-patch-stack/0101.patch @@ -1,121 +1,107 @@ -From: Jan Grulich <jgrulich@redhat.com> -Date: Thu, 30 Nov 2023 11:49:00 +0000 -Subject: Bug 1844020 - Add option to DeviceInfo::GetDeviceName() identifying a - placeholder device r=pehrsons,webrtc-reviewers +From: Michael Froman <mfroman@mozilla.com> +Date: Mon, 18 Dec 2023 15:00:00 +0000 +Subject: Bug 1867099 - revert libwebrtc 8602f604e0. r=bwc -Adds a new parameter "deviceIsPlaceholder" that will be set to true in -case the returned device is not a real device but a placeholder that is -just used to inform about camera device existence. +Upstream 8602f604e0 removed code sending BYEs which breaks some of +our wpt. They've opened a bug for a real fix here: +https://bugs.chromium.org/p/webrtc/issues/detail?id=15664 -Differential Revision: https://phabricator.services.mozilla.com/D189929 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/ed31b2acb5fbca3e2d0691a64bc52e65952070c0 +I've opened Bug 1870643 to track the real fix and upstream bug. + +Differential Revision: https://phabricator.services.mozilla.com/D196729 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d92a578327f524ec3e1c144c82492a4c76b8266f --- - modules/video_capture/linux/device_info_pipewire.cc | 4 +++- - modules/video_capture/linux/device_info_pipewire.h | 3 ++- - modules/video_capture/linux/device_info_v4l2.cc | 3 ++- - modules/video_capture/linux/device_info_v4l2.h | 3 ++- - modules/video_capture/video_capture.h | 3 ++- - modules/video_capture/windows/device_info_ds.cc | 3 ++- - modules/video_capture/windows/device_info_ds.h | 3 ++- - 7 files changed, 15 insertions(+), 7 deletions(-) + call/rtp_video_sender.cc | 1 + + modules/rtp_rtcp/source/rtcp_sender.cc | 19 +++++++++++++++++-- + .../rtp_rtcp/source/rtcp_sender_unittest.cc | 5 +++-- + modules/rtp_rtcp/source/rtp_rtcp_impl.cc | 1 + + modules/rtp_rtcp/source/rtp_rtcp_interface.h | 2 +- + 5 files changed, 23 insertions(+), 5 deletions(-) -diff --git a/modules/video_capture/linux/device_info_pipewire.cc b/modules/video_capture/linux/device_info_pipewire.cc -index fc0554f384..f9f08a9c27 100644 ---- a/modules/video_capture/linux/device_info_pipewire.cc -+++ b/modules/video_capture/linux/device_info_pipewire.cc -@@ -50,8 +50,10 @@ int32_t DeviceInfoPipeWire::GetDeviceName(uint32_t deviceNumber, - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8, - uint32_t productUniqueIdUTF8Length, -- pid_t* pid) { -+ pid_t* pid, -+ bool* deviceIsPlaceholder) { - RTC_CHECK(pipewire_session_); +diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc +index 580850359c..ac5540a7f2 100644 +--- a/call/rtp_video_sender.cc ++++ b/call/rtp_video_sender.cc +@@ -492,6 +492,7 @@ void RtpVideoSender::SetActiveModulesLocked(bool sending) { + active_ = sending; + for (size_t i = 0; i < rtp_streams_.size(); ++i) { + RtpRtcpInterface& rtp_module = *rtp_streams_[i].rtp_rtcp; ++ // Sends a kRtcpByeCode when going from true to false. + rtp_module.SetSendingStatus(sending); + rtp_module.SetSendingMediaStatus(sending); + if (sending) { +diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc +index 099b0be1a3..971f49b949 100644 +--- a/modules/rtp_rtcp/source/rtcp_sender.cc ++++ b/modules/rtp_rtcp/source/rtcp_sender.cc +@@ -212,8 +212,23 @@ bool RTCPSender::Sending() const { + + void RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, + bool sending) { +- MutexLock lock(&mutex_rtcp_sender_); +- sending_ = sending; ++ bool sendRTCPBye = false; ++ { ++ MutexLock lock(&mutex_rtcp_sender_); + - if (deviceNumber >= NumberOfDevices()) - return -1; ++ if (method_ != RtcpMode::kOff) { ++ if (sending == false && sending_ == true) { ++ // Trigger RTCP bye ++ sendRTCPBye = true; ++ } ++ } ++ sending_ = sending; ++ } ++ if (sendRTCPBye) { ++ if (SendRTCP(feedback_state, kRtcpBye) != 0) { ++ RTC_LOG(LS_WARNING) << "Failed to send RTCP BYE"; ++ } ++ } + } + + void RTCPSender::SetNonSenderRttMeasurement(bool enabled) { +diff --git a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc +index 002a5f86f1..1dcb628722 100644 +--- a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc ++++ b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc +@@ -328,12 +328,13 @@ TEST_F(RtcpSenderTest, SendBye) { + EXPECT_EQ(kSenderSsrc, parser()->bye()->sender_ssrc()); + } + +-TEST_F(RtcpSenderTest, StopSendingDoesNotTriggersBye) { ++TEST_F(RtcpSenderTest, StopSendingTriggersBye) { + auto rtcp_sender = CreateRtcpSender(GetDefaultConfig()); + rtcp_sender->SetRTCPStatus(RtcpMode::kReducedSize); + rtcp_sender->SetSendingStatus(feedback_state(), true); + rtcp_sender->SetSendingStatus(feedback_state(), false); +- EXPECT_EQ(0, parser()->bye()->num_packets()); ++ EXPECT_EQ(1, parser()->bye()->num_packets()); ++ EXPECT_EQ(kSenderSsrc, parser()->bye()->sender_ssrc()); + } + + TEST_F(RtcpSenderTest, SendFir) { +diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +index cca9a40250..a63067141d 100644 +--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc ++++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +@@ -296,6 +296,7 @@ RTCPSender::FeedbackState ModuleRtpRtcpImpl::GetFeedbackState() { -diff --git a/modules/video_capture/linux/device_info_pipewire.h b/modules/video_capture/linux/device_info_pipewire.h -index 8a33d75892..00715c94bc 100644 ---- a/modules/video_capture/linux/device_info_pipewire.h -+++ b/modules/video_capture/linux/device_info_pipewire.h -@@ -30,7 +30,8 @@ class DeviceInfoPipeWire : public DeviceInfoImpl { - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8 = nullptr, - uint32_t productUniqueIdUTF8Length = 0, -- pid_t* pid = 0) override; -+ pid_t* pid = 0, -+ bool* deviceIsPlaceholder = 0) override; - /* - * Fills the membervariable _captureCapabilities with capabilites for the - * given device name. -diff --git a/modules/video_capture/linux/device_info_v4l2.cc b/modules/video_capture/linux/device_info_v4l2.cc -index 04caaea592..401c38f9c5 100644 ---- a/modules/video_capture/linux/device_info_v4l2.cc -+++ b/modules/video_capture/linux/device_info_v4l2.cc -@@ -232,7 +232,8 @@ int32_t DeviceInfoV4l2::GetDeviceName(uint32_t deviceNumber, - uint32_t deviceUniqueIdUTF8Length, - char* /*productUniqueIdUTF8*/, - uint32_t /*productUniqueIdUTF8Length*/, -- pid_t* /*pid*/) { -+ pid_t* /*pid*/, -+ bool* /*deviceIsPlaceholder*/) { - // Travel through /dev/video [0-63] - uint32_t count = 0; - char device[20]; -diff --git a/modules/video_capture/linux/device_info_v4l2.h b/modules/video_capture/linux/device_info_v4l2.h -index 0bec3eb765..55415845ad 100644 ---- a/modules/video_capture/linux/device_info_v4l2.h -+++ b/modules/video_capture/linux/device_info_v4l2.h -@@ -36,7 +36,8 @@ class DeviceInfoV4l2 : public DeviceInfoImpl { - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8 = 0, - uint32_t productUniqueIdUTF8Length = 0, -- pid_t* pid=0) override; -+ pid_t* pid = 0, -+ bool* deviceIsPlaceholder = 0) override; - /* - * Fills the membervariable _captureCapabilities with capabilites for the - * given device name. -diff --git a/modules/video_capture/video_capture.h b/modules/video_capture/video_capture.h -index 43a6a7f832..f59c34f8b2 100644 ---- a/modules/video_capture/video_capture.h -+++ b/modules/video_capture/video_capture.h -@@ -74,7 +74,8 @@ class VideoCaptureModule : public RefCountInterface { - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8 = 0, - uint32_t productUniqueIdUTF8Length = 0, -- pid_t* pid = 0) = 0; -+ pid_t* pid = 0, -+ bool* deviceIsPlaceholder = 0) = 0; + int32_t ModuleRtpRtcpImpl::SetSendingStatus(const bool sending) { + if (rtcp_sender_.Sending() != sending) { ++ // Sends RTCP BYE when going from true to false + rtcp_sender_.SetSendingStatus(GetFeedbackState(), sending); + } + return 0; +diff --git a/modules/rtp_rtcp/source/rtp_rtcp_interface.h b/modules/rtp_rtcp/source/rtp_rtcp_interface.h +index f196d11b58..bc8da63ab6 100644 +--- a/modules/rtp_rtcp/source/rtp_rtcp_interface.h ++++ b/modules/rtp_rtcp/source/rtp_rtcp_interface.h +@@ -277,7 +277,7 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface { + // Returns the FlexFEC SSRC, if there is one. + virtual absl::optional<uint32_t> FlexfecSsrc() const = 0; - // Returns the number of capabilities this device. - virtual int32_t NumberOfCapabilities(const char* deviceUniqueIdUTF8) = 0; -diff --git a/modules/video_capture/windows/device_info_ds.cc b/modules/video_capture/windows/device_info_ds.cc -index f6927281f3..8ca741239c 100644 ---- a/modules/video_capture/windows/device_info_ds.cc -+++ b/modules/video_capture/windows/device_info_ds.cc -@@ -173,7 +173,8 @@ int32_t DeviceInfoDS::GetDeviceName(uint32_t deviceNumber, - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8, - uint32_t productUniqueIdUTF8Length, -- pid_t* pid) { -+ pid_t* pid, -+ bool* deviceIsPlaceholder) { - MutexLock lock(&_apiLock); - const int32_t result = GetDeviceInfo( - deviceNumber, deviceNameUTF8, deviceNameLength, deviceUniqueIdUTF8, -diff --git a/modules/video_capture/windows/device_info_ds.h b/modules/video_capture/windows/device_info_ds.h -index e6dfaed366..a9a1449b99 100644 ---- a/modules/video_capture/windows/device_info_ds.h -+++ b/modules/video_capture/windows/device_info_ds.h -@@ -51,7 +51,8 @@ class DeviceInfoDS : public DeviceInfoImpl { - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8, - uint32_t productUniqueIdUTF8Length, -- pid_t* pid) override; -+ pid_t* pid, -+ bool* deviceIsPlaceholder) override; +- // Sets sending status. ++ // Sets sending status. Sends kRtcpByeCode when going from true to false. + // Returns -1 on failure else 0. + virtual int32_t SetSendingStatus(bool sending) = 0; - /* - * Display OS /capture device specific settings dialog |