This is a consistent way to get to common config parameters for
all receive streams and avoids storing a copy of the extension
headers inside of Call. This is needed to get rid of the need of
keeping config and copies in sync, which currently is part of why
we repeatedly delete and recreate audio receive streams on config
changes.
Bug: webrtc:11993
Change-Id: Ia356b6cac1425c8c6766abd2e52fdeb73c4a4b4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222040
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34285}
Also including common Rtp config members.
Follow up changes will remove the ReceiveRtpConfig class in Call
and copy of extension headers, instead use the config directly
from the receive streams and not require stream recreation for changing
the headers.
Bug: webrtc:11993
Change-Id: I29ff3400d45d5bffddb3ad0a078403eb102afb65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221983
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34283}
This is to be consistent with how things work on the video side but
also much less drastic than the current implementation. Aim is to
remove RecreateAudioReceiveStream(), which would improve efficiency
as well as allow for specific handling of the cases that currently
trigger recreation.
Bug: webrtc:11993
Change-Id: Ia81a5e66d44e41ea4eb2bff800e0b1583821c96a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34282}
The has_internal_source feature is deprecated, and unrelated to the
tests of QP parsing.
Bug: webtc:12875
Change-Id: Ib43063ebf49e6e0bd7a5328a04ba2816f3a7ecb2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222400
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34280}
This is to prevent the video stream to get in a state where it is
allocated but there is no activity.
Bug: b/189842675
Change-Id: I0793bd4cbf2a4faed92cf811550437ae75742102
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221618
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34276}
Previous implementation assumes that though RepeatingTask is owned by
the task queue, it will stay alive until RepeatingTaskHandler stops it.
That assumption doesn't hold by one of downstream TaskQueue implementaions.
That TaskQueue implementation shortly before destruction deletes
pending delayed tasks because it doesn't plan to run them,
and then runs remaining regular tasks.
Bug: None
Change-Id: Ic95fec2e9961b3f05727ff6fbdaf0664434a995b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221984
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34274}
This entails instantly deleting the transport when it is no longer
referenced by any MID.
Also adds consistency checks to JsepTransportCollection.
Bug: webrtc:12837
Change-Id: I85775aeb676aac3a9aee74280cc72ac87a0f49b5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221982
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34273}
Making a copy of that information takes noticable amount of time
causing fuzzer timeout for larger inputs, but that extra information
is not even used.
Bug: chromium:1217944
Change-Id: Icf9d43ae4b8feddda972daf3a4743fb73f7766d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221962
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34271}
The dominant nearend detector uses the residual echo spectrum for
determining whether in nearend state. The residual echo spectrum in
computed using the ERLE. To reduce the risk of echo leaks in the
suppressor, the ERLE is capped. While minimizing echo leaks, the
capping of the ERLE can affect the dominant nearend classification
negatively as the residual echo spectrum is often over estimated.
This change enables the dominant nearend detector to use a residual
echo spectrum computed with a virtually non-capped ERLE. This ERLE
is only used for dominant nearend detection and leads to increased
transparency.
The feature is currently disabled by default and can be enabled
with the field trial "WebRTC-Aec3UseUnboundedEchoSpectrum".
Bug: webrtc:12870
Change-Id: Icb675c6f5d42ab9286e623b5fb38424d5c9cbee4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221920
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34270}
kron is an owner of UMA metrics for WebRTC in chromium,
see tools/metrics/histograms/histograms_xml/web_rtc/OWNERS
Bug: webrtc:12096
Change-Id: I9804d747fc4e52d2ed2a9d96cc4ed315639210da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221961
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34268}
This CL adds a cooldown of 0.5 seconds where if the WebRtcVideoChannel
created an unsignalled receive stream within that amount of time, if we
receive even more unknown ssrcs we simply drop those RTP packets.
This prevents getting into a state of spawning new decoders on every
single packet which could happen e.g. if PT based demuxing is enabled
and MIDs are missing from the packets.
Bug: webrtc:12815
Change-Id: Id7675fb0cbfbc72281dcfe030d1a35629df3eb9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221520
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34263}
This is part of the work to make Bundle handling understandable,
so that we can get it to work right.
Bug: webrtc:12837
Change-Id: I77f046b4bac2d9709460b3b956a2edc3df0cdaac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221745
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34261}
This is a change from the previous 100Hz frequency.
Also changing the locks slightly in AcmReceiver so that grabbing the
neteq lock right after we've let it go, isn't necessary inside of
AcmReceiver::GetAudio and also to avoid grabbing the neteq lock while
holding the AcmReceiver lock.
Bug: webrtc:12868
Change-Id: If6ee35f3dca20eb5bdbc615123aa099ccecf57c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221371
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34258}
* Removes playing_lock_, sync_info_lock_ and video_sync_lock_.
* Also remove video_capture_thread_race_checker_ which was redundant.
Only video_sync_lock_ was actually needed. The other two aren't needed
anymore because of changes made to RtpStreamsSynchronizer class last
year (see webrtc:11489).
In the one case where we had a lock, we post a task to the thread
where the state is maintained. This task is for capturing histograms
which I'm not sure we should have been capturing on the audio thread
anyway.
Also making ChannelReceiveFrameTransformerDelegate compatible with more
tests by using TaskQueueBase instead of rtc::Thread. A number of tests
that instantiate ChannelReceive (and thereby CRFTD) set the worker
thread as a TQ and not actually an rtc::Thread instance. In those cases
CRFTD would previously have gotten a nullptr for the worker thread.
Bug: webrtc:11993
Change-Id: I59f4b2afbfedb06f241d9a613f8538adc19cd6d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221364
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34257}
This was found when fuzzing. If the specified number of parameter count
was larger than std::numeric_limits<size_t>::max()/2, the comparison
would overflow and read out-of-bounds. This would only apply to 32-bit
platforms and it would lead to a crash as it would access all of the
virtual memory range, and more.
Fixed: chromium:1216758
Change-Id: I2193d3ed078120b6c3e4645c0b16b9f230055e8d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221742
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34256}
This reverts commit 8a18e5b3c9.
Reason for revert: Removing the problematic DCHECK.
Original change's description:
> Revert "Remove AudioReceiveStream::Reconfigure() method."
>
> This reverts commit e2561e17e2.
>
> Reason for revert: Speculative revert: breaks an downstream project
>
> Original change's description:
> > Remove AudioReceiveStream::Reconfigure() method.
> >
> > Instead, adding specific setters that are needed at runtime:
> > * SetDepacketizerToDecoderFrameTransformer
> > * SetDecoderMap
> > * SetUseTransportCcAndNackHistory
> >
> > The whole config struct is big and much of the state it holds, needs to
> > be considered const. For that reason the Reconfigure() method is too
> > broad of an interface since it overwrites the whole config struct
> > and doesn't actually handle all the potential config changes that might
> > occur when the config changes.
> >
> > Bug: webrtc:11993
> > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34252}
>
> TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11993
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34253}
# Not skipping CQ checks because this is a reland.
Bug: webrtc:11993
Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34255}
As a side effect, break out pc/simulcast_description.
Step 1: Don't move the {h,cc} files; just declare the targets
so that downstream projects can add dependencies on it.
Bug: webtc:11967
Change-Id: Iad3d77513af418b664c1bef46070177ed24027fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221603
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34254}
This reverts commit e2561e17e2.
Reason for revert: Speculative revert: breaks an downstream project
Original change's description:
> Remove AudioReceiveStream::Reconfigure() method.
>
> Instead, adding specific setters that are needed at runtime:
> * SetDepacketizerToDecoderFrameTransformer
> * SetDecoderMap
> * SetUseTransportCcAndNackHistory
>
> The whole config struct is big and much of the state it holds, needs to
> be considered const. For that reason the Reconfigure() method is too
> broad of an interface since it overwrites the whole config struct
> and doesn't actually handle all the potential config changes that might
> occur when the config changes.
>
> Bug: webrtc:11993
> Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34252}
TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11993
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34253}
Instead, adding specific setters that are needed at runtime:
* SetDepacketizerToDecoderFrameTransformer
* SetDecoderMap
* SetUseTransportCcAndNackHistory
The whole config struct is big and much of the state it holds, needs to
be considered const. For that reason the Reconfigure() method is too
broad of an interface since it overwrites the whole config struct
and doesn't actually handle all the potential config changes that might
occur when the config changes.
Bug: webrtc:11993
Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34252}
We want to turn off PT based demux because SSRC-based endpoints that
send media prematurely (which is a popular non-standard behavior still
heavily in use) can otherwise get incorrect mappings and unsignalled
ssrc issues because of the PT demux path.
This CL disables PT based demuxing when the MID header extension is
present on all m= sections in the SDP for that kind (audio/video), not
caring if it was in the offer or answer. However if PT demuxing has been
used in the past then it is always allowed. This ensures PT is off by
default but that either offer or answer can enable PT and once it has
been on it is also possible to get early media with PT.
- Want PT-based demux? The MID header extension has to be removed in
either the offer or the answer. Follow-up O/As allow PT demuxing if
possible.
- Want to use MID or SSRC demuxing? Great, you don't need PT-based demux
and won't mind that we turned it off for you.
The reason for disabling PT demux at offer time (if MID is present)
instead of waiting for the SDP answer is because by the time the SDP
answer arrives, early media could have triggered PT demux and caused
incorrect mappings. The safe thing is to assume a spec-compliant
endpoint until proven otherwise.
However if PT demux is ever enabled, then from that point on we always
allow PT-based demux in follow-up O/A exchanges. This ensures we don't
drop packets in follow-up exchanges. The fact that PT-based demux is
disabled during the initial offer should not matter because before the
initial O/A exchange we don't have fingerprints.
This change only affects Unified Plan and bundled groups. Existing test
coverage ensuring we do not break legacy endpoints:
[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/peer_connection_integrationtest.cc;l=1156
[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/webrtc/protocol/rtp-demuxing.html;l=59
UnsignaledStreamTest is also updated to test the interesting setups.
A kill-switch is added in case we want to disable this change.
Bug: webrtc:12814
Change-Id: I807a82a543325753633aaef698e06cb4c9dfebaa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221101
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34251}
Bilinear is faster but lesser quality, box is best quality. Our code
base has disagreed about which filter to use for quite some time,
causing aliasing bug reports. In an effort to avoid aliasing artifacts
and make our scaling filters more predictable, we're updating all uses
to kFilterBox.
WebRTC already uses kFilterBox everywhere except for these three
places. The main discrepency was between Chromium and WebRTC but that
has already been fixed. This CL fixes the last remaining bilinears.
This brings the WebRTC kFilterBox use count up from 11 to 14 and the
kFilterBilinear use count down from 3 to 0.
Bug: chromium:1212630
Change-Id: I5fe4aa92b9275d65b91ea97925533055d190d317
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221372
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34248}
This is step 1: Encapsulating the data.
Bug: webrtc:12837
Change-Id: I15df30dc294c90136a90b072608ed4c2e8925dcb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221602
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34245}
CandidateStats didn't use an initializer list which caused the
`candidate` member variable to be constructed with a random id
(calling an expensive rng method), only to be overwritten directly
thereafter.
Bug: webrtc:12840
Change-Id: I0366f674281d236896cb9539812dc2d88c1b37ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221600
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34244}
AllocationSequence uses legacy rtc::Thread message handling. In order
to cancel callbacks it uses rtc::Thread::Clear() which uses locks and
necessitates looping through all currently queued (unbounded) messages
in the thread. In particular, these Clear calls are common during
negotiation and the probability of having a lot of queued messages is
high due to a long-running network thread function invoked on the
network thread.
Fix this by migrating AllocationSequence to task queues.
Bug: webrtc:12840, webrtc:9702
Change-Id: I42bbdb59fb2c88b50e866326ba15134dcc6ce691
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221369
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34241}
Removes dependence on rtc::Thread APIs from BPAS, which removes
the need to remove callbacks via rtc::Thread::Clear().
Bug: webrtc:12840
Change-Id: I0bcc1828c5ab38f521b583f52707174961f28e8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221366
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34239}