From ff61ababd4942ed61cb1566d6a54667de1a74efd Mon Sep 17 00:00:00 2001 From: Michael Froman Date: Thu, 26 May 2022 12:47:03 -0500 Subject: [PATCH] Bug 1766646 - Vendor libwebrtc from cbb4421eac Upstream commit: https://webrtc.googlesource.com/src/+/cbb4421eacb6079cb14f2a53dbe1f520c3d79089 Remove DeliverPacketAsync. This is currently unused and since we ultimately don't want the delivery of packets to be async at this stage (but rather stay on the network thread), we don't need it. Bug: webrtc:11993 Change-Id: I6809026b6901c8ecfacd961e98ddf79aaa16d0bd Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220601 Reviewed-by: Markus Handell Commit-Queue: Markus Handell Cr-Commit-Position: refs/heads/master@{#34152} --- third_party/libwebrtc/README.moz-ff-commit | 3 ++ third_party/libwebrtc/README.mozilla | 2 ++ third_party/libwebrtc/call/call.cc | 28 ----------------- third_party/libwebrtc/call/packet_receiver.h | 33 -------------------- 4 files changed, 5 insertions(+), 61 deletions(-) diff --git a/third_party/libwebrtc/README.moz-ff-commit b/third_party/libwebrtc/README.moz-ff-commit index cd7356a9259d..e4999d25944f 100644 --- a/third_party/libwebrtc/README.moz-ff-commit +++ b/third_party/libwebrtc/README.moz-ff-commit @@ -5994,3 +5994,6 @@ d5b0199959 # MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh # base of lastest vendoring 785725129a +# MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh +# base of lastest vendoring +cbb4421eac diff --git a/third_party/libwebrtc/README.mozilla b/third_party/libwebrtc/README.mozilla index 89de6cd363c7..aa6be5398b67 100644 --- a/third_party/libwebrtc/README.mozilla +++ b/third_party/libwebrtc/README.mozilla @@ -3998,3 +3998,5 @@ libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwe libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-26T17:45:35.163230. # python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-26T17:46:15.707718. +# python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc +libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-26T17:46:58.034323. diff --git a/third_party/libwebrtc/call/call.cc b/third_party/libwebrtc/call/call.cc index 8dc7a2fd27b2..db0177b1af3c 100644 --- a/third_party/libwebrtc/call/call.cc +++ b/third_party/libwebrtc/call/call.cc @@ -300,10 +300,6 @@ class Call final : public webrtc::Call, DeliveryStatus DeliverPacket(MediaType media_type, rtc::CopyOnWriteBuffer packet, int64_t packet_time_us) override; - void DeliverPacketAsync(MediaType media_type, - rtc::CopyOnWriteBuffer packet, - int64_t packet_time_us, - PacketCallback callback) override; // Implements RecoveredPacketReceiver. void OnRecoveredPacket(const uint8_t* packet, size_t length) override; @@ -1507,30 +1503,6 @@ PacketReceiver::DeliveryStatus Call::DeliverPacket( return DeliverRtp(media_type, std::move(packet), packet_time_us); } -void Call::DeliverPacketAsync(MediaType media_type, - rtc::CopyOnWriteBuffer packet, - int64_t packet_time_us, - PacketCallback callback) { - RTC_DCHECK_RUN_ON(network_thread_); - - TaskQueueBase* network_thread = rtc::Thread::Current(); - RTC_DCHECK(network_thread); - - worker_thread_->PostTask(ToQueuedTask( - task_safety_, [this, network_thread, media_type, p = std::move(packet), - packet_time_us, cb = std::move(callback)] { - RTC_DCHECK_RUN_ON(worker_thread_); - DeliveryStatus status = DeliverPacket(media_type, p, packet_time_us); - if (cb) { - network_thread->PostTask( - ToQueuedTask([cb = std::move(cb), status, media_type, - p = std::move(p), packet_time_us]() { - cb(status, media_type, std::move(p), packet_time_us); - })); - } - })); -} - void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { // TODO(bugs.webrtc.org/11993): Expect to be called on the network thread. // This method is called synchronously via |OnRtpPacket()| (see DeliverRtp) diff --git a/third_party/libwebrtc/call/packet_receiver.h b/third_party/libwebrtc/call/packet_receiver.h index f18ee65c7076..13d3b84c9049 100644 --- a/third_party/libwebrtc/call/packet_receiver.h +++ b/third_party/libwebrtc/call/packet_receiver.h @@ -10,13 +10,6 @@ #ifndef CALL_PACKET_RECEIVER_H_ #define CALL_PACKET_RECEIVER_H_ -#include -#include -#include -#include -#include -#include - #include "api/media_types.h" #include "rtc_base/copy_on_write_buffer.h" @@ -30,32 +23,6 @@ class PacketReceiver { DELIVERY_PACKET_ERROR, }; - // Definition of the callback to execute when packet delivery is complete. - // The callback will be issued on the same thread as called DeliverPacket. - typedef std::function< - void(DeliveryStatus, MediaType, rtc::CopyOnWriteBuffer, int64_t)> - PacketCallback; - - // Asynchronously handle packet delivery and report back to the caller when - // delivery of the packet has completed. - // Note that if the packet is invalid or can be processed without the need of - // asynchronous operations that the |callback| may have been called before - // the function returns. - // TODO(bugs.webrtc.org/11993): This function is meant to be called on the - // network thread exclusively but while the code is being updated to align - // with those goals, it may be called either on the worker or network threads. - // Update docs etc when the work has been completed. Once we're done with the - // updates, we might be able to go back to returning the status from this - // function instead of having to report it via a callback. - virtual void DeliverPacketAsync(MediaType media_type, - rtc::CopyOnWriteBuffer packet, - int64_t packet_time_us, - PacketCallback callback) { - DeliveryStatus status = DeliverPacket(media_type, packet, packet_time_us); - if (callback) - callback(status, media_type, std::move(packet), packet_time_us); - } - virtual DeliveryStatus DeliverPacket(MediaType media_type, rtc::CopyOnWriteBuffer packet, int64_t packet_time_us) = 0;