tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit bc62285cb6d3cee7f69bc77e68f2efdb3d59427a
parent 32f6b31b480f6e84b11bd99c64b149fcd637eb9c
Author: Michael Froman <mfroman@mozilla.com>
Date:   Wed,  8 Oct 2025 16:03:13 -0500

Bug 1993083 - Vendor libwebrtc from 384325ebd7

Upstream commit: https://webrtc.googlesource.com/src/+/384325ebd7f1319b45c2d7b9abd6dd5aebe9cb4f
    Add function to create an audio decoder ahead of time.

    This can be used to avoid blocking when receiving the first audio packet.

    Bug: None
    Change-Id: I29098cd204f327db185b12e3682d68b9b42cbb7b
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397800
    Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
    Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45007}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/api/neteq/neteq.h | 7++++++-
Mthird_party/libwebrtc/modules/audio_coding/neteq/neteq_impl.cc | 5+++++
Mthird_party/libwebrtc/modules/audio_coding/neteq/neteq_impl.h | 2++
Mthird_party/libwebrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc | 9+++++++++
5 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T21:01:55.129696+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T21:03:04.178561+00:00. # base of lastest vendoring -c48e9ba24e +384325ebd7 diff --git a/third_party/libwebrtc/api/neteq/neteq.h b/third_party/libwebrtc/api/neteq/neteq.h @@ -238,10 +238,15 @@ class NetEq { virtual void SetCodecs(const std::map<int, SdpAudioFormat>& codecs) = 0; // Associates `rtp_payload_type` with the given codec, which NetEq will - // instantiate when it needs it. Returns true iff successful. + // instantiate when it needs it. Returns true if successful. virtual bool RegisterPayloadType(int rtp_payload_type, const SdpAudioFormat& audio_format) = 0; + // Creates a decoder for `rtp_payload_type`. Can be used to instantiate a + // decoder ahead of time to avoid blocking when needed. Returns true if + // successful. + virtual bool CreateDecoder(int rtp_payload_type) { return false; } + // Removes `rtp_payload_type` from the codec database. Returns 0 on success, // -1 on failure. Removing a payload type that is not registered is ok and // will not result in an error. diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/neteq_impl.cc b/third_party/libwebrtc/modules/audio_coding/neteq/neteq_impl.cc @@ -254,6 +254,11 @@ bool NetEqImpl::RegisterPayloadType(int rtp_payload_type, DecoderDatabase::kOK; } +bool NetEqImpl::CreateDecoder(int rtp_payload_type) { + MutexLock lock(&mutex_); + return decoder_database_->GetDecoder(rtp_payload_type) != nullptr; +} + int NetEqImpl::RemovePayloadType(uint8_t rtp_payload_type) { MutexLock lock(&mutex_); int ret = decoder_database_->Remove(rtp_payload_type); diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/neteq_impl.h b/third_party/libwebrtc/modules/audio_coding/neteq/neteq_impl.h @@ -157,6 +157,8 @@ class NetEqImpl : public NetEq { bool RegisterPayloadType(int rtp_payload_type, const SdpAudioFormat& audio_format) override; + bool CreateDecoder(int rtp_payload_type) override; + // Removes `rtp_payload_type` from the codec database. Returns 0 on success, // -1 on failure. int RemovePayloadType(uint8_t rtp_payload_type) override; diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc b/third_party/libwebrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc @@ -283,6 +283,15 @@ TEST_F(NetEqImplTest, RegisterPayloadType) { neteq_->RegisterPayloadType(rtp_payload_type, format); } +TEST_F(NetEqImplTest, CreateDecoder) { + UseNoMocks(); + CreateInstance(); + constexpr int rtp_payload_type = 0; + const SdpAudioFormat format("pcmu", 8000, 1); + EXPECT_TRUE(neteq_->RegisterPayloadType(rtp_payload_type, format)); + EXPECT_TRUE(neteq_->CreateDecoder(rtp_payload_type)); +} + TEST_F(NetEqImplTest, RemovePayloadType) { CreateInstance(); uint8_t rtp_payload_type = 0;