Commit graph

941 commits

Author SHA1 Message Date
Erik Språng
18c0cc2bbd Refactor PacketSequencer in preparation for deferred sequencing.
This CL is extracted from
https://webrtc-review.googlesource.com/c/src/+/208584
PacketSequencer now has its own unit tests. They are maybe somewhat
redundant with a few RtpSender unit tests, but will defer cleanup to
a later CL.

Bug: webrtc:11340, webrtc:12470
Change-Id: I1c31004b85ae075ddc696bdf1100d2a5044d4ef5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227343
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34638}
2021-08-03 20:00:39 +00:00
Erik Språng
d7ec635d82 Add unit tests for rtp state.
This CL is extracted from
https://webrtc-review.googlesource.com/c/src/+/208584

Bug: webrtc:11340, webrtc:12470
Change-Id: I322c271b02bc3577fe8aad57fe97364a76d83f4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227342
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34628}
2021-08-02 17:33:24 +00:00
Jonathan Lennox
c219a53c80 Don't try to send REMB or VideoBitrateAllocation when RTCP is off.
Bug: webrtc:12978
Change-Id: I0bd9cb239c9d74695c1408dde985c92b2834ba2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225961
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@nvidia.com>
Cr-Commit-Position: refs/heads/master@{#34610}
2021-07-30 20:28:24 +00:00
Danil Chapovalov
64a59f1bf8 Move Word32Align helper next to the only place it is used in
Bug: None
Change-Id: I99b34b78c6a560afa3638e2ba2f403e25602b12e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226862
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34583}
2021-07-28 09:19:01 +00:00
Danil Chapovalov
f7448fb882 Handle scenario when dependency descriptor fails to attach to a key frame
Bug: chromium:1232358
Change-Id: I2c8a92fb3ac4ab981782077e29179ff2bece6c6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226861
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34552}
2021-07-26 15:29:02 +00:00
Philipp Hancke
10ed32c114 do not require generic frame descriptor extension for FrameEncryptor
as there are encryption schemes that preserve the payload structure
well enough and do not require those extensions.
This improves consistency as the webrtc-encoded-transform API
(which does not use this synchronous codepath) does not require those
header extensions either.


BUG=webrtc:12995

Change-Id: If237ca5d92e8871ac71c3d48fdd05127206395e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226741
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34537}
2021-07-23 06:57:37 +00:00
Mirko Bonadei
190244bb59 Remove all #include <assert.h>/<cassert> and usage in Obj-C code.
This CL completes the removal of assert() and relative headers from
the codebase (excluded
//examples/objc/AppRTCMobile/third_party/SocketRocket which is in a
third_party sub-directory).

Bug: webrtc:6779
Change-Id: I93ed57168d2c0e011626873d66529488c5f484f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225546
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34528}
2021-07-22 14:00:26 +00:00
Danil Chapovalov
623146cfe1 Delete remaining usage of RtpHeaderParser test helper.
Bug: None
Change-Id: Ia4f8c5dc212f25b1a507e13955973ce4aa6a7ddc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225550
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34525}
2021-07-22 10:15:07 +00:00
Danil Chapovalov
6882a3f7d0 Discard over large DataRates in VideoLayersAllocation rtp header extension
Bug: b/193170077
Change-Id: I427718daa70910dbaf7f2e1f3d88d3dce4f27c7a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226561
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34520}
2021-07-21 13:35:14 +00:00
Danil Chapovalov
1ccc5a55e1 Delete helper to parse rtcp packet into rtp header
The only user of that function is only interested in the type of the
first rtcp message in the packet, which can be extracted in a simpler way

Bug: None
Change-Id: I96aeb8ed66099f94d506aa7d8d0d07378f6c952e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226543
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34515}
2021-07-20 11:44:49 +00:00
Danil Chapovalov
99a71f49c0 Move helpers to parse base rtp packet fields to rtp_rtcp module
rtp_rtcp_format is lighter build target than rtc_media_base and
a more natural place to keep rtp parsing functions.

Bug: None
Change-Id: Ibcb5661cc65edbdc89a63f3e411d7ad1218353cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226330
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34504}
2021-07-19 14:27:27 +00:00
Ivo Creusen
8c40d510c8 Make it possible to enable/disable receive-side RTT with a setter.
This will allow us to enable receive-side RTT without having to recreate all AudioReceiveStream objects.

Bug: webrtc:12951
Change-Id: I1227297ec4ebeea9ba15fe2ed904349829b2e669
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225262
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34464}
2021-07-13 14:15:46 +00:00
Mirko Bonadei
25ab3228f3 Replace assert() with RTC_DCHECK().
CL partially auto-generated with:

git grep -l "\bassert(" | grep "\.[c|h]" | \
  xargs sed -i 's/\bassert(/RTC_DCHECK(/g'

And with:

git grep -l "RTC_DCHECK(false)" |  \
  xargs sed -i 's/RTC_DCHECK(false)/RTC_NOTREACHED()/g'

With some manual changes to include "rtc_base/checks.h" where
needed.

A follow-up CL will remove assert() from Obj-C code as well
and remove the #include of <assert.h>.

The choice to replace with RTC_DCHECK is because assert()
is because RTC_DCHECK has similar behavior as assert()
based on NDEBUG.

This CL also contains manual changes to switch from
basic RTC_DCHECK to other (preferred) versions like
RTC_DCHECK_GT (and similar).

Bug: webrtc:6779
Change-Id: I00bed8886e03d685a2f42324e34aef2c9b7a63b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34442}
2021-07-09 07:49:43 +00:00
Danil Chapovalov
44450a073b Support header only parsing by RtpPacket
It is not uncommon to save rtp header of an rtp packet for later parsing
(e.g. rtc event log does that)
Such header is invalid as an rtp packet when padding bit is set.
This change suggest to treat header only packets with padding as valid.

Bug: webrtc:5261
Change-Id: If61d84fc37383d2e9cfaf9b618276983d334702e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225265
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34438}
2021-07-08 14:43:28 +00:00
Victor Boivie
f715618eee Use flat_map in RTCPReceiver
RTCPReceiver initially used a std::map, which made
RTCPReceiver::IncomingPacket's use of std::map represent ~0.45% CPU in
highly loaded media servers. Using std::unordered_map in change 216321
reduced it only slightly, to 0.39%.

This is the second attempt to reduce it even further. By using a
flat_map and taking advantage of the increased cache locality, the hope
is that it will be reduced. These maps generally have low cardinality
(indexed by SSRC), and are looked up often, but modified less often,
which make them a potential candidate for flat_map.

Bug: webrtc:12689
Change-Id: I6733ccf3484d1c54e661250fb6712971b80fa2a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225203
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34432}
2021-07-07 13:43:59 +00:00
Victor Boivie
18649971ab Use flat_map in ReceiveStatisticsImpl
std::unordered_map represents ~0.57% CPU in a loaded media server,
which is expected to be reduced by using flat_map and its increased
cache locality compared to std::unordered_map, which use quite a few
allocations and indirections.

The number of SSRCs tracked by this class is expected to be low and
infrequently updated, but as GetOrCreateStatistician is called for every
incoming RTP packet, lookups are frequent.

Bug: webrtc:12689
Change-Id: I9a2c3798dcc7822f518e8f2624e78fceacd12d27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225202
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34430}
2021-07-07 08:34:45 +00:00
Danil Chapovalov
00ca0044d4 Unify helpers IsRtpPacket and IsRtcpPacket
Bug: None
Change-Id: Ibe942de433435d256cd6827440136936d4b274d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225022
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34419}
2021-07-06 10:39:00 +00:00
Danil Chapovalov
510c94cbfb Return one report block per media ssrc, ignoring sender ssrc.
Webrtc designed to work for point-to-point topology, and thus
each rtcp_receiver handles single remote sender.

While remote sender ssrc may change, it should be ok to assume
the remote endpoint is still the same.

Bug: webrtc:12798
Change-Id: I62aebe7ac802306fc7fa17d7bf3959d6d4cca023
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224548
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34407}
2021-07-02 14:37:16 +00:00
Danil Chapovalov
53f1fe4ff6 Fail instead of crashing while writing invalid dependency descriptor
Bug: webrtc:10342
Change-Id: Ic9af7913aa9835450877940fc5cf29bebf774484
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224082
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34379}
2021-06-28 16:42:04 +00:00
philipel
4e513346ec AV1 OBU test helper.
Bug: none
Change-Id: I942319122f823e18e500c049274527b00e6feba6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223061
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34363}
2021-06-23 13:43:50 +00:00
Markus Handell
eb61b7f620 ModuleRtcRtcpImpl2: remove Module inheritance.
This change achieves an Idle Wakeup savings of 200 Hz.

ModuleRtcRtcpImpl2 had Process() logic only active if TMMBR() is
enabled in RtcpSender, which it never is. Hence the Module
inheritance could be removed. The change removes all known
dependencies of the module inheritance, and any related mentions
of ProcessThread.

Fixed: webrtc:11581
Change-Id: I440942f07187fdb9ac18186dab088633969b340e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222604
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34358}
2021-06-22 14:51:04 +00:00
Minyue Li
6e65f6a428 Deprecating AbsoluteCaptureTimeReceiver
Bug: chromium:1056230, webrtc:10739
Change-Id: I42b6a6f1c61eaaa468898a09bb7add30f0a419fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223065
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34357}
2021-06-22 14:44:04 +00:00
Markus Handell
3f7b7170cc RTCPSender: remove compatibility ctor & method.
This change removes compatibility APIs in RTCPSender now
that downstream consumers updated.

Bug: webrtc:11581, webrtc:6458
Change-Id: I82d70f1ab6b522b3884480b0b16cbdff9a1490c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222323
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34356}
2021-06-22 13:30:20 +00:00
Markus Handell
885d538cdd ModuleRtpRtcpImpl2: remove RTCP send polling.
This change migrates RTCP send polling happening in
ModuleRtpRtcpImpl2::Process to task queues.

ModuleRtpRtcpImpl2 would previously only cause RTCP sends while being
registered with a ProcessThread. This is now relaxed so that RTCP will
be sent regardless of ProcessThread registration status, and it seems
no tests cared.

Now there's only one piece of polling left in Process.

Bug: webrtc:11581
Change-Id: Ibdcffefccef7363f2089c34a9c7d694d222445c0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222603
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34350}
2021-06-22 07:49:05 +00:00
Markus Handell
049ed447b0 ModuleRtpRtcpImpl2: update test code.
This change prepares for later CLs that partly replaces
logic in the module that depends on the Module system
for logic that depends on task queues.

The change also changes SendTransport::SendRTCP
to schedule packet reception with the simulated time
controller. This fixes the problem that SendRTCP itself
updates the simulated time which makes it hard to
understand the tests.

Finally, GlobalSimulatedTimeController was updated
to support addition of custom SimulatedSequenceRunners
like SendTransport.

Bug: webrtc:11581
Change-Id: I0aa310ad0a10526479ad8c28affc38a413363ffd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222602
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34348}
2021-06-21 23:36:49 +00:00
Markus Handell
c6b9ac782a RTCPSender: migrate to Timestamp.
This change migrates RTCPSender to use webrtc::Timestamp, preparing
for later improvements regarding bugs.webrtc.org/11581.

Fixed: webrtc:12873
Change-Id: I1159701dc373883367d9b2c86823f8fb59904d55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222324
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34346}
2021-06-21 22:26:34 +00:00
Markus Handell
2e3edc1da9 RTCPSender: migrate to own configuration struct.
The class depends on RtcRtcpInterface::Configuration which adds an
unneeded dependency, and inhibits well-manored changes to the
constructor interface.

Fix this so that RTCPSender uses it's own configuration struct which
can be extended in future CLs.

Also add a legacy constructor while downstream dependencies are
updated.

Bug: webrtc:11581
Change-Id: I8d166ab8253b27c08fcbe6aa7c7adde92688b7dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222322
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34343}
2021-06-21 20:23:01 +00:00
Danil Chapovalov
7d5418233d Avoid assembling complicated but unused video rtp header extensions
Bug: chromium:1219407
Change-Id: I017de10813a1e80f4af0ba55d8d1aa73077dd131
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222615
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34326}
2021-06-17 16:09:13 +00:00
Danil Chapovalov
35b21ba8d4 In RtcpTransceiver avoid extra PostTask during construction
it is not required because during construction members can be set on
wrong thread, and in some corner cases it may even cause a crash.

Bug: none
Change-Id: I37d7f2a7772b6ab5e574077d3f53bca2529f9ae1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222651
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34315}
2021-06-17 08:36:34 +00:00
philipel
355c47309d Fix VideoRtpDepacketizerVp{8,9} copy assignment signature.
Bug: none
Change-Id: I4adca8b4cbf4ffa15172fabc1eaba8c2b65c6fb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222650
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34306}
2021-06-16 17:09:05 +00:00
Tommi
08be9baaa3 Don't recreate the audio receive stream when updating the local_ssrc.
Bug: webrtc:11993
Change-Id: Ic5d8a8a8b7c12fb1d906e0b3cbdf657fd9e8eafc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222042
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34299}
2021-06-16 10:03:31 +00:00
Erik Språng
6a0a55907b Reland "Correctly handle retransmissions/padding in early loss detection."
This is a reland of e9ae4729e0

TBR=philipel@webrtc.org,terelius@webrtc.org

Original change's description:
> Correctly handle retransmissions/padding in early loss detection.
>
> This CL makes sure we don't cull packets from the history based on
> incorrect ack mapping, just like it's predecessor:
> https://webrtc-review.googlesource.com/c/src/+/218000
>
> It also changes the logic to make sure retransmits counts towards
> history pruning - and properly ignores padding/fec.
>
> Bug: webrtc:12713
> Change-Id: I7835d10e483687e960a9cce41d4e2f1a6c3189b4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221863
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34293}

Bug: webrtc:12713
Change-Id: Iec123d71edafea98fe289acde007b57e212681f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222640
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34297}
2021-06-16 08:14:27 +00:00
Erik Språng
d6957c2eed Revert "Correctly handle retransmissions/padding in early loss detection."
This reverts commit e9ae4729e0.

Reason for revert: Internal test failure

Original change's description:
> Correctly handle retransmissions/padding in early loss detection.
>
> This CL makes sure we don't cull packets from the history based on
> incorrect ack mapping, just like it's predecessor:
> https://webrtc-review.googlesource.com/c/src/+/218000
>
> It also changes the logic to make sure retransmits counts towards
> history pruning - and properly ignores padding/fec.
>
> Bug: webrtc:12713
> Change-Id: I7835d10e483687e960a9cce41d4e2f1a6c3189b4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221863
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34293}

TBR=danilchap@webrtc.org,terelius@webrtc.org,sprang@webrtc.org,philipel@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Iaca6dc7739d953e97add5f5d516139b4819e43ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12713
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222601
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34294}
2021-06-15 15:59:10 +00:00
Erik Språng
e9ae4729e0 Correctly handle retransmissions/padding in early loss detection.
This CL makes sure we don't cull packets from the history based on
incorrect ack mapping, just like it's predecessor:
https://webrtc-review.googlesource.com/c/src/+/218000

It also changes the logic to make sure retransmits counts towards
history pruning - and properly ignores padding/fec.

Bug: webrtc:12713
Change-Id: I7835d10e483687e960a9cce41d4e2f1a6c3189b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221863
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34293}
2021-06-15 15:39:19 +00:00
Danil Chapovalov
be53049555 Reland "Avoid sending empty receiver reports with RtcpTransceiver"
This reverts commit 48420fa947.

Reason for revert: downstream unittests adjusted

Original change's description:
> Revert "Avoid sending empty receiver reports with RtcpTransceiver"
>
> This reverts commit e5f1a3992e.
>
> Reason for revert: Speculative revert due to failing downstream unittest.
>
> Original change's description:
> > Avoid sending empty receiver reports with RtcpTransceiver
> >
> > Bug: None
> > Change-Id: Ia017c2df285febefb72ba88ba43366455bde5a78
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222402
> > Reviewed-by: Per Kjellander <perkj@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34281}
>
> TBR=danilchap@webrtc.org,perkj@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I895317ad0381756e97e501a36d6440f83a68b6f8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: None
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222440
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Björn Terelius <terelius@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34284}

# Not skipping CQ checks because this is a reland.

Bug: None
Change-Id: I3481b9b12ddabaef7303ba80e9cd885930988caa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222600
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34291}
2021-06-15 12:57:56 +00:00
Tommi
d350006b70 Add rtp_config() accessor to ReceiveStream.
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}
2021-06-14 17:57:57 +00:00
Björn Terelius
48420fa947 Revert "Avoid sending empty receiver reports with RtcpTransceiver"
This reverts commit e5f1a3992e.

Reason for revert: Speculative revert due to failing downstream unittest.

Original change's description:
> Avoid sending empty receiver reports with RtcpTransceiver
>
> Bug: None
> Change-Id: Ia017c2df285febefb72ba88ba43366455bde5a78
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222402
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34281}

TBR=danilchap@webrtc.org,perkj@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I895317ad0381756e97e501a36d6440f83a68b6f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222440
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34284}
2021-06-14 17:29:09 +00:00
Danil Chapovalov
e5f1a3992e Avoid sending empty receiver reports with RtcpTransceiver
Bug: None
Change-Id: Ia017c2df285febefb72ba88ba43366455bde5a78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222402
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34281}
2021-06-14 16:19:47 +00:00
Tommi
1050fbca91 Remove synchronization from VideoSendStream construction.
* Make VideoSendStream and VideoSendStreamImpl construction non-blocking.
* Move ownership of the rtp video sender to VideoSendStream.
* Most state is constructed in initializer lists.
* More state is now const (including VideoSendStreamImpl ptr)
* Adding thread checks to classes that appear to have had a race before
  E.g. RtpTransportControllerSend. The change in threading now actually
  fixes an issue we weren't aware of.
* Moved from using weak_ptr to safety flag and made some PostTask calls
  cancellable that could potentially have been problematic. Initalizing
  the flag without thread synchronization is also simpler.

This should speed up renegotiation significantly when there are
multiple channels. A follow-up change will improve SetSend as well
which is another costly step during renegotiation.

Bug: webrtc:12840
Change-Id: If4b28da5a085643ce132c7cfcf80a62cd1a625c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221105
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34224}
2021-06-03 19:13:45 +00:00
Danil Chapovalov
47f5f8c160 Reduce usage of RtpHeaderParser::CreateForTest in favor of RtpPacket
As a step to delete the legacy rtp packet parser.

Bug: None
Change-Id: I2aae86bc8847acd76cdd89007273a99f0298fdb9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221109
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34219}
2021-06-03 12:29:09 +00:00
Andrey Logvin
943e2e6a57 Revert "Fix incorrect SSRC in RtpPacketSendInfo for RTX packets."
This reverts commit 82aa094a97.

Reason for revert: Causes regression for an upstream project

Original change's description:
> Fix incorrect SSRC in RtpPacketSendInfo for RTX packets.
>
> Bug: webrtc:12713
> Change-Id: I1b5fb947ffe4ac80e23a6b891ea1a2c2156ba81f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218000
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34177}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:12713
Change-Id: I20facf724bdb0136e7eb079c4834575184764174
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221202
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34218}
2021-06-03 11:59:39 +00:00
memetao
82aa094a97 Fix incorrect SSRC in RtpPacketSendInfo for RTX packets.
Bug: webrtc:12713
Change-Id: I1b5fb947ffe4ac80e23a6b891ea1a2c2156ba81f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218000
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34177}
2021-05-31 20:51:07 +00:00
Erik Språng
7f11067110 Clean up RtpSenderTest and remove RtpSenderEgress dependencies.
Since all test cases that used RtpSenderEgress have been refactored or
moved, we can now get rid of lot of test fixture crud:
* Remove RtpSenderContext helper, make sender normal member.
* Remove test transport helper
* Remove task queue helper (needed for thread checks in egress)
* Remove various mocks no longer used
* Remove RtpSenderWithoutPacer subclass
* Remove WithWithoutOverhead parametrization (only affect egress)

..plus some cleanup of how configs are created.

Bug: webrtc:11340
Change-Id: I5c581d60862fc6dc2b99f76058782309dc7aef4d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220280
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34135}
2021-05-26 15:25:58 +00:00
Erik Språng
8f8bf252e6 Remove usage of InjectPacket and transport_ in rtp_sender_unittest
Thus removing dependency on RtpSenderEgress, allowing simplification of
the test fixture in a follow-up.

Bug: webrtc:11340
Change-Id: I9772bab18d1f4a04e0deccc9125d4b1c16c30d7a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219627
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34132}
2021-05-26 10:44:29 +00:00
Lennart Grahl
0d0ed76ac1 Fix RTP header extension encryption
Reland of commit a743303211

Previously, RTP header extensions with encryption had been filtered
if the encryption had been activated (not the other way around) which
was likely an unintended logic inversion.

In addition, it ensures that encrypted RTP header extensions are only
negotiated if RTP header extension encryption is turned on. Formerly,
which extensions had been negotiated depended on the order in which
they were inserted, regardless of whether or not header encryption was
actually enabled, leading to no extensions being sent on the wire.

Further changes:

- If RTP header encryption enabled, prefer encrypted extensions over
  non-encrypted extensions
- Add most extensions to list of extensions supported for encryption
- Discard encrypted extensions in a session description in case encryption
  is not supported for that extension
- Mark FindHeaderExtensionByUri without filter argument as deprecated

Bug: webrtc:11713
Change-Id: I52a5ade1b94bc01d1c2a35cb56023684fcaf9982
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219081
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34129}
2021-05-26 09:42:09 +00:00
Erik Språng
770acabd5d Refactor mid/rid rtp tests to avoid using egress/transport logic.
This CL makes a number of test use the paced sender callback to verify
the output of RTPSender, instead of re-parsed data from RtpSenderEgres.

Bug: webrtc:11340
Change-Id: I13ccf5a5db4b6df128cf2fa9e8dad443fcd15cdd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220162
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34126}
2021-05-26 08:44:19 +00:00
Erik Språng
4fbc3fc59e Move SendPacketUpdates* tests to rtp_sender_egress_unittest.
These should be the last of the testis from rtp_sender_unittest.cc that
should be moved and refactored to just test RtpSenderEgress.

Bug: webrtc:11340
Change-Id: Id09d7bbade608dd7194dcd8843d4f2887842a372
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220140
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34118}
2021-05-25 15:25:30 +00:00
Erik Språng
238da9a57e Remove obsolete SendPacketMatches* tests from rtp_sender_egress_unittest.
These tests were likely made back when PacketRouter was iterating over
the RTP modules to find the correct to send on. Now that this is just
a DCHECK, it's already implicitly covered by other tests that actually
test the respective packet type functionality. Let's thus just remove
these old tests.

Bug: webrtc:11340
Change-Id: I244ca7e365378f4e48a601464b5df0e1d07732be
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219621
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34116}
2021-05-25 12:57:35 +00:00
Erik Språng
552169c7db Refactor RtpPacketCounter tests and move to rtp_sender_egress_unittest.
Bug: webrtc:11340
Change-Id: Ifdcb3d99113502fb5bebf1fc3ea5253a141d313b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219790
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34115}
2021-05-25 12:55:45 +00:00
Erik Språng
36005afeb4 Refactor and improve RtpSender packet history test.
This CL refactors RtpSenderTest.SendPacketHandlesRetransmissionHistory,
moves some testing to rtp_ender_egress_unittest and adds test coverage
for a few cases.

Bug: webrtc:11340
Change-Id: Ic225d2af43c3926f69fe3ea45f41b18c29b8b4fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219796
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34111}
2021-05-25 09:53:27 +00:00