Commit graph

861 commits

Author SHA1 Message Date
Erik Språng
12d24113dc Move SendsPacketsWithTransportSequenceNumber to RtpRtcp level.
New tests (transport sequence number plus newly added abs send time) now
test more of production code and less of rtp_sender_unittest.cc test
fixture code.

Bug: webrtc:11340
Change-Id: I8ec0022c3d18467a4144ce984996af1a452760dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216327
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33895}
2021-05-03 12:15:19 +00:00
Guido Urdaneta
bd27adb714 [InsertableStreams] Ensure encoder queue is valid in OnTransformedFrame
In RTPSenderVideoFrameTransformerDelegate::TransformFrame(), the encoder
queue might still be null when a frame queued by a previous delegate
arrives. This could happen in the context of renegotiation that results
in a codec reset. In this case, the frame should be dropped.

Bug: webrtc:12691
Change-Id: Ib738ce31738cffc7e01053dbc82237f457fc2286
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216393
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33866}
2021-04-28 16:46:22 +00:00
Victor Boivie
b2f8c1675d Use unordered_map in ReceiveStatisticsImpl
In highly loaded media servers, ReceiveStatisticsImpl's use of std::map
attributes to ~0.32% CPU. It needs to be able to iterate through the
statisticians in order when reporting, but that is considered to be rare
compared to how often they are looked up. So this commit adds a separate
sorted set for just keeping track of the SSRCs, and letting the map of
SSRC to Statisticians, be unordered.

Bug: webrtc:12689
Change-Id: I69fe41d96bca31b2e8d669b58b5c7afabceaa6a6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216385
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33864}
2021-04-28 13:28:35 +00:00
Victor Boivie
aeff995ca8 Make RTCPSenderTest test more robust to ordering
The test assumed a certain order in report blocks, which can have
changed with tasks to use unordered collections. This commit makes
the test more robust.

Bug: webrtc:12689
Change-Id: Ie0087dcb7dc955d70aa39208848bb99fd2f1750b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216386
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33863}
2021-04-28 12:41:51 +00:00
Tommi
87f7090fd9 Replace more instances of rtc::RefCountedObject with make_ref_counted.
This is essentially replacing `new rtc::RefCountedObject` with
`rtc::make_ref_counted` in many files. In a couple of places I
made minor tweaks to make things compile such as adding parenthesis
when they were missing.

Bug: webrtc:12701
Change-Id: I3828dbf3ee0eb0232f3a47067474484ac2f4aed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215973
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33852}
2021-04-27 17:01:59 +00:00
Victor Boivie
0c563a42ec Use unordered_map in RTCPReceiver
In highly loaded media servers, RTCPReceiver's use of std::map
attributes to ~0.5% CPU. It's mostly ::find and the [] operator, and
they are all keyed by SSRC, which is an unordered data type. This makes
these maps suitable as unordered maps, as they have constant time
complexity for lookups.

Bug: webrtc:12689
Change-Id: I7b305e233fcbed0e452632946ab0de5ee66f8dda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216321
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33850}
2021-04-27 14:54:59 +00:00
Victor Boivie
306b1393cb Optimize set of registered SSRCs in RTCPReceiver
In highly loaded media servers, RTCPReceiver's use of std::set
attributes to ~0.87% CPU. It's mostly ::find and the [] operator and the
assignment operator.

 * Removed locking of a mutex in `TriggerCallbacksFromRtcpPacket``
   as it copied members that were already const.
 * Switched the use of std::set for the list of registered local SSRCs
   to an absl::InlinedVector, as the set is very small and it's not
   expected that any more complicated container would be faster than a
   linear search within a cache line.

Bug: webrtc:12689
Change-Id: I734578c22eeca2d9ba89fef77ecc689b72624567
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216322
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33849}
2021-04-27 14:05:46 +00:00
Erik Språng
dec73a8164 Add pure RtpSenderEgress unit test fixture.
The extracts and refactors some test code from rtp_sender_unittest.cc
and puts it in a new target intended to only test RtpSenderEgress, and
do it as pure unit test, rather than the unholy
not-quite-unit-not-quite-integration-test thingy we have today.

Only a first test case is actually ported with this CL, but it's a
start...

Bug: webrtc:11340
Change-Id: Ie2cdde63a00a6ff6eba7b8d443eeb76ce2a527c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216180
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33841}
2021-04-27 10:11:40 +00:00
Tomas Gunnarsson
dbcf5d3918 Change return type of SetSendingStatus to be void.
The eventual implementation of changing the status will be async so the
return value isn't that useful and was in fact only being used to log
a warning if an error occured.

This change is to facilitate upcoming changes related to media engine.

Bug: webrtc:11993
Change-Id: Ia7f85a9ea18b2648b511fa356918cf32a201461f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215975
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33825}
2021-04-25 15:27:38 +00:00
Harsh Maniar
6ef4af9546 Purge old FEC packets from receiver's queue before media sequence numbers wrap around
- Received FEC packets are purged from the queue if:
  1. All media packets protected by the FEC packet are received.
  2. All media packets protected by the FEC packet are recovered.
  3. Newer FEC packet(s) with sequence number '0x3fff' larger than an old FEC packet is received.
- When FEC packets get separated from their protected media packets by more than 48, none of the first conditions ever delete that FEC packet, no matter how old/ irrelevant it gets.
- Under specific circumstances, the new FEC packet (condition 3) is not received before the media sequence number space wraps around, and incorrectly activates the old FEC packet, resulting in FEC decode for the wrong packet.
- This change purges such old FEC packets in time before the media sequence numbers wrap around.

Bug: webrtc:12656
Change-Id: I6ddf5382638c8c7e9a65724b2544dfbbc4803342
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215100
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33795}
2021-04-21 07:33:14 +00:00
Björn Terelius
24bc419303 Revert "Fix RTP header extension encryption"
This reverts commit a743303211.

Reason for revert: Breaks downstream tests that attempt to call FindHeaderExtensionByUri with 2 arguments. Could you keep the old 2-argument method declaration and just forward the call to the new 3-argument method with a suitable no-op filter?

Original change's description:
> Fix RTP header extension encryption
>
> 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
>
> Note that this depends on https://github.com/cisco/libsrtp/pull/491 to get
> into libwebrtc (cherry-pick or bump libsrtp version). Otherwise, two-byte
> header extensions will prevent any RTP packets being sent/received.
>
> Bug: webrtc:11713
> Change-Id: Ia0779453d342fa11e06996d9bc2d3c826f3466d3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177980
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Taylor <deadbeef@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33723}

TBR=deadbeef@webrtc.org,terelius@webrtc.org,hta@webrtc.org,lennart.grahl@gmail.com

Change-Id: I7df6b0fa611c6496dccdfb09a65ff33ae4a52b26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11713
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215222
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33727}
2021-04-14 10:10:07 +00:00
Lennart Grahl
a743303211 Fix RTP header extension encryption
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

Note that this depends on https://github.com/cisco/libsrtp/pull/491 to get
into libwebrtc (cherry-pick or bump libsrtp version). Otherwise, two-byte
header extensions will prevent any RTP packets being sent/received.

Bug: webrtc:11713
Change-Id: Ia0779453d342fa11e06996d9bc2d3c826f3466d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177980
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33723}
2021-04-14 08:53:45 +00:00
Erik Språng
696cea0843 Refactor some RtpSender-level tests into RtpRtcp-level tests
This prepares for ability to defer sequence number assignment to after
the pacing stage - a scenario where the RtpRtcp module rather than than
RTPSender class has responsibility for sequence numbering.

Bug: webrtc:11340
Change-Id: Ife88f60258b9b7cfd9dbd3326f02ac34da8f7603
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214967
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33702}
2021-04-13 08:37:14 +00:00
Anton Bikineev
a3575cb848 Remove tautological 'unsigned expr < 0' comparisons
This is the result of compiling Chromium with
Wtautological-unsigned-zero-compare. For more details, see:
https://chromium-review.googlesource.com/c/chromium/src/+/2802412

Change-Id: I05cec6ae5738036a56beadeaa1dde5189edf0137
Bug: chromium:1195670
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213783
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33689}
2021-04-12 11:40:14 +00:00
Paul Hallak
6817809e26 Stop trying to compensate for the offset between the different NTP clocks.
There is only one NTP clock now.

Bug: webrtc:11327
Change-Id: I8c2808cf665f92bd251d68e32062beeffabb0f43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214132
Commit-Queue: Paul Hallak <phallak@google.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33657}
2021-04-08 14:48:20 +00:00
Paul Hallak
e9dad5f053 Add a clock to be used for getting the NTP time in RtcpTransceiverConfig.
Note: google3 needs to set this clock before we can start using it.

Bug: webrtc:11327
Change-Id: I0436c6633976afe208f28601fdfd50e0f6f54d6e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214480
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Paul Hallak <phallak@google.com>
Cr-Commit-Position: refs/heads/master@{#33653}
2021-04-08 12:43:27 +00:00
Paul Hallak
314b78d467 Remove Clock::NtpToMs.
This helper method does not belong to the Clock class. Also, it's simple enough that it's not needed.

Bug: webrtc:11327
Change-Id: I95a33f08fd568b293b591171ecaf5e7aef8d413c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214123
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Paul Hallak <phallak@google.com>
Cr-Commit-Position: refs/heads/master@{#33652}
2021-04-08 10:37:20 +00:00
Jeremy Leconte
b258c56267 Send and Receive VideoFrameTrackingid RTP header extension.
Bug: webrtc:12594
Change-Id: I2372a361e55d0fdadf9847081644b6a3359a2928
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212283
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/master@{#33570}
2021-03-25 21:57:29 +00:00
Jeremy Leconte
4f88a9d1c3 Create a VideoFrameTrackingId RTP header extension.
Bug: webrtc:12594
Change-Id: I518b549b18143f4711728b4637a4689772474c45
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212084
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/master@{#33567}
2021-03-25 17:25:18 +00:00
Jonas Oreland
90c3981773 Fix RtpVideoLayersAllocationExtension::Write of invalid allocation
This patch is a follow up to https://webrtc-review.googlesource.com/c/src/+/212743
which broke downstream fuzzer :(

prior to https://webrtc-review.googlesource.com/c/src/+/212743,
RtpVideoLayersAllocationExtension::AllocationIsValid returns
false if rtp_stream_index > max(layer.rtp_stream_index)

After https://webrtc-review.googlesource.com/c/src/+/212743,
0 spatial layers is supported, so the AllocationIsValid is
updated to allow any value if not layers are present.

Bug: webrtc:12000
Change-Id: Ib3e64ecb621f795b9126442c50969f5178c85a37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212901
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33551}
2021-03-24 13:53:13 +00:00
Alessio Bazzica
5cf8c2c501 Fix unspecified time origin for lastPacketReceivedTimestamp
`RTCInboundRtpStreamStats.lastPacketReceivedTimestamp` must be a time
value in milliseconds with Unix epoch as time origin (see
bugs.webrtc.org/12605#c4).

This change fixes both audio and video `RTCInboundRtpStreamStats` stats.

Tested: verified from chrome://webrtc-internals during an appr.tc call

Bug: webrtc:12605
Change-Id: I68157fcf01a5933f3d4e5d3918b4a9d3fbd64f16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212865
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33547}
2021-03-24 09:36:41 +00:00
Jonas Oreland
93ee168671 Allow empty video layer allocation extension
This patch adds support for sending zero video layer allocations
header extensions. This can be used to signal that a stream is
turned off.

Bug: webrtc:12000
Change-Id: Id18fbbff2216ca23179c58ef7bbe2ebea5e242af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212743
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33541}
2021-03-23 12:36:59 +00:00
Erik Språng
f19aec829b Updates ulpfec reader to accept padding on media packets.
Bug: webrtc:12530
Change-Id: I659c430d50a88d49cb4c3c21d00710fac78f1e0d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212081
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33483}
2021-03-16 19:47:09 +00:00
Danil Chapovalov
ab63350411 Delete RtpRtcp::RemoteRTCPStat in favor of GetLatestReportBlockData
Bug: webrtc:10678
Change-Id: I1cff0230208e22f56f26cf2eba976f66d9b5bafc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212020
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33479}
2021-03-16 10:31:35 +00:00
Alessio Bazzica
bc1c93dc6e Add remote-outbound stats for audio streams
Add missing members needed to surface `RTCRemoteOutboundRtpStreamStats`
via `ChannelReceive::GetRTCPStatistics()` - i.e., audio streams.

`GetSenderReportStats()` is added to both `ModuleRtpRtcpImpl` and
`ModuleRtpRtcpImpl2` and used by `ChannelReceive::GetRTCPStatistics()`.

Bug: webrtc:12529
Change-Id: Ia8f5dfe2e4cfc43e3ddd28f2f1149f5c00f9269d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211041
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33452}
2021-03-12 20:39:50 +00:00
Alessio Bazzica
048adc7136 Add missing remote-outbound stats to RTCPReceiver::NTP
In order to add `RTCRemoteOutboundRtpStreamStats` (see [1]), the
following stats must be added:
- sender's packet count (see [2])
- sender's octet count (see [2])
- total number of RTCP SR blocks sent (see [3])

[1] https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats
[2] https://tools.ietf.org/html/rfc3550#section-6.4.1
[3] https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-reportssent

Bug: webrtc:12529
Change-Id: I47ac2f79ba53631965d1cd7c1062f3d0f158d66e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/210963
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33423}
2021-03-10 16:36:48 +00:00
Alessio Bazzica
79011ef4a7 Remove ModuleRtpRtcpImpl2::LastReceivedNTP
`LastReceivedNTP()` does not need to be part of the public members of
`ModuleRtpRtcpImpl` and `ModuleRtpRtcpImpl2` since it is used only
once in the same class.

This change is requried by the child CL [1] which adds a public getter
needed to add remote-outbound stats.

[1] https://webrtc-review.googlesource.com/c/src/+/211041

Bug: webrtc:12529
Change-Id: I82cfea5ee795de37fffa3d759ce9f581ca775d55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211043
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33420}
2021-03-10 15:11:38 +00:00
Per Kjellander
ee8cd20ec5 Add a mutex free implementation of webrtc::ReceiveStatistics
The mutex is removed from the old existing implementation and instead a wrapper is implemented that ensure thread-safety.
Both the thread-safe and unsafe version share the same implementation of the logic.

There are two ways of construction:
webrtc::ReceiveStatistics::Create - thread-safe version.
webrtc::ReceiveStatistics::CreateUnLocked -thread-unsafe

Bug: none
Change-Id: Ica375919fda70180335c8f9ea666497811daf866
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211240
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33419}
2021-03-10 14:16:38 +00:00
Erik Språng
77ee8542dd Extract sequencing from RtpSender
This CL refactors RtpSender and extracts handling of sequence number
assignment and timestamping of padding packets in a separate helper
class.
This is in preparation for allowing deferred sequencing to after the
pacing stage.

Bug: webrtc:11340
Change-Id: I5f8c67f3bb90780b3bdd24afa6ae28dbe9d839a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208401
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33316}
2021-02-22 14:00:06 +00:00
Danil Chapovalov
e904161cec Replace RTC_DEPRECATED with ABSL_DEPRECATED
This remove webrtc-specific macro that has no reason to be webrtc specific
ABSL_DEPRECATED takes a message parameter encouraging to write text how class or function is deprecated.

Bug: webrtc:12484
Change-Id: I89f1398f91dacadc37f7db469dcd985e3724e444
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208282
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33314}
2021-02-22 12:53:23 +00:00
Erik Språng
0f71871cad Reland "Batch assign RTP seq# for all packets of a frame."
This is a reland of 5cc9957062

Original change's description:
> Batch assign RTP seq# for all packets of a frame.
>
> This avoids a potential race where other call sites could assign
> sequence numbers while the video frame is mid packetization - resulting
> in a non-contiguous video sequence.
>
> Avoiding the tight lock-unlock within the loop also couldn't hurt from
> a performance standpoint.
>
> Bug: webrtc:12448
> Change-Id: I6cc31c7743d2ca75caeaeffb98651a480dbe08e2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207867
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33291}

Bug: webrtc:12448
Change-Id: I7c5a5e00a5e08330ff24b58af9f090c327eeeaa2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208221
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33296}
2021-02-18 12:27:27 +00:00
Jeremy Leconte
17f914ce50 Revert "Batch assign RTP seq# for all packets of a frame."
This reverts commit 5cc9957062.

Reason for revert: Seems this CL breaks the below test when being imported in google3
https://webrtc-review.googlesource.com/c/src/+/207867

Original change's description:
> Batch assign RTP seq# for all packets of a frame.
>
> This avoids a potential race where other call sites could assign
> sequence numbers while the video frame is mid packetization - resulting
> in a non-contiguous video sequence.
>
> Avoiding the tight lock-unlock within the loop also couldn't hurt from
> a performance standpoint.
>
> Bug: webrtc:12448
> Change-Id: I6cc31c7743d2ca75caeaeffb98651a480dbe08e2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207867
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33291}

Bug: webrtc:12448
Change-Id: I2547f946a5ba75aa09cdbfd902157011425d1c30
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208220
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/master@{#33294}
2021-02-18 08:54:27 +00:00
Erik Språng
5cc9957062 Batch assign RTP seq# for all packets of a frame.
This avoids a potential race where other call sites could assign
sequence numbers while the video frame is mid packetization - resulting
in a non-contiguous video sequence.

Avoiding the tight lock-unlock within the loop also couldn't hurt from
a performance standpoint.

Bug: webrtc:12448
Change-Id: I6cc31c7743d2ca75caeaeffb98651a480dbe08e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207867
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33291}
2021-02-17 15:27:08 +00:00
Danil Chapovalov
3562318bde Delete unused functions in RtpSender, RtcpSender and RtcpReceiver
These functions are not longer used by the RtpRtcp implementations.

Bug: None
Change-Id: Ibc36433b253b264de4cdcdf380f5ec1df201b17a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207862
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33282}
2021-02-16 14:16:22 +00:00
Danil Chapovalov
067b050213 Delete deprecated unused functions from RtpRtcp interface
Bug: None
Change-Id: Iceb59d726c328974c3ccbf52a782ac9e25bd57c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205581
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33278}
2021-02-16 10:23:41 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Danil Chapovalov
9554a7b641 Account for extra capacity rtx packet might need
When calculating maximum allowed size for a media packet.
In particular take in account that rtx packet might need to
include mid and repaired-rsid extensions when media packet can omit them.

Bug: webrtc:11031
Change-Id: I3e7bc36437c23e0330316588d2a46978407c8c45
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206060
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33184}
2021-02-06 21:34:08 +00:00
Björn Terelius
65b901bbb1 Clean up previously deleted RTCP VOIP metrics block.
Bug: None
Change-Id: I6f9ddb09927200444dbccd24ed522c9b8f936b0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205623
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33169}
2021-02-04 18:34:28 +00:00
Danil Chapovalov
eee0e9e9d4 Remove passing rtp packet metadata through webrtc as array of bytes
Instead metadata is now passed via refcounted class.

Bug: b/178094662
Change-Id: I9591fb12990282b60310ca01aea2a7b73d92487a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204060
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33134}
2021-02-02 12:22:57 +00:00
Danil Chapovalov
5312a8f532 Add option to attach custom object to an rtp packet
As an alternative to attaching custom array of bytes.

Bug: b/178094662
Change-Id: I92dcbf04998d8206091125febc520ebfcc4bcebf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203264
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33069}
2021-01-25 18:31:34 +00:00
Danil Chapovalov
ded6636cf4 Cleanup RtcpSender from legacy functionality
Reduce amount of dynamic memory used to generate rtcp message
Remove option to request several types of rtcp message as unused
Deduplicated PacketContainer and PacketSender as constructs to create packets

Bug: None
Change-Id: Ib2e20a72a9bd73a441ae6b72a13e18ab5885f5c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203261
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33068}
2021-01-25 14:20:57 +00:00
Tomas Gunnarsson
1e75df26e3 Remove lock from UlpfecReceiverImpl and replace with a sequence checker.
Also making some more state const.

Instances of this class are currently constructed and used on the
"worker thread" but as part of the work for bug webrtc:11993, the
instances will be moved over to the network thread. Since the
class as is does not require synchronization, that is a good property
to make explicit now and then make sure we maintain it in the
transition.

Bug: webrtc:11993
Change-Id: Id587a746ce0a4363b9e9871ae1749549f8ef3e24
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202681
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33035}
2021-01-19 14:20:40 +00:00
Danil Chapovalov
098da17f35 Reland "Replace RTC_WARN_UNUSED_RESULT with ABSL_MUST_USE_RESULT in c++ code"
This is a reland of 8c2250eddc

Original change's description:
> Replace RTC_WARN_UNUSED_RESULT with ABSL_MUST_USE_RESULT in c++ code
>
> Bug: webrtc:12336
> Change-Id: If76f00d0883b5c8a90d3ef5554f5e22384b3fb58
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/197620
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32978}

Bug: webrtc:12336
Change-Id: I1cd017d45c1578528dec4532345950e9823f4a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201732
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33003}
2021-01-15 17:59:05 +00:00
Danil Chapovalov
884118dad1 Delete unused functions in ModuleRtpRtcpImpl
Bug: None
Change-Id: Ia475afed123abaf32df6f1f1a546f5704e2d464f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201421
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32985}
2021-01-14 19:24:37 +00:00
Danil Chapovalov
4319b1695e Revert "Replace RTC_WARN_UNUSED_RESULT with ABSL_MUST_USE_RESULT in c++ code"
This reverts commit 8c2250eddc.

Reason for revert: breaks downstream project

Original change's description:
> Replace RTC_WARN_UNUSED_RESULT with ABSL_MUST_USE_RESULT in c++ code
>
> Bug: webrtc:12336
> Change-Id: If76f00d0883b5c8a90d3ef5554f5e22384b3fb58
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/197620
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32978}

TBR=danilchap@webrtc.org,mbonadei@webrtc.org,crodbro@webrtc.org

Change-Id: I5c9d419785254878a825865808b56841cd30b9b5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12336
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201731
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32979}
2021-01-14 15:02:47 +00:00
Danil Chapovalov
8c2250eddc Replace RTC_WARN_UNUSED_RESULT with ABSL_MUST_USE_RESULT in c++ code
Bug: webrtc:12336
Change-Id: If76f00d0883b5c8a90d3ef5554f5e22384b3fb58
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/197620
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32978}
2021-01-14 14:32:26 +00:00
Niels Moller
2accc7d6e0 Revert "Add task queue to RtpRtcpInterface::Configuration."
This reverts commit f23e2144e8.

Reason for revert: Need further discussion on appropriate thread/tq requirements.

Original change's description:
> Add task queue to RtpRtcpInterface::Configuration.
>
> Let ModuleRtpRtcpImpl2 use the configured value instead of
> TaskQueueBase::Current().
>
> Intention is to allow construction of RtpRtcpImpl2 on any thread.
> If a task queue is provided (required for periodic rtt updates), the
> destruction of the object must be done on that same task queue.
>
> Also, delete ModuleRtpRtcpImpl2::Create, callers updated to use std::make_unique.
>
> Bug: None
> Change-Id: I412b7b1e1ce24722ffd23d16aa6c48a7214c9bcd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199968
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32949}

TBR=danilchap@webrtc.org,ilnik@webrtc.org,saza@webrtc.org,nisse@webrtc.org,srte@webrtc.org

Change-Id: I7e5007f524a39a6552973ec9744cd04c13162432
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201420
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32953}
2021-01-12 17:47:32 +00:00
Niels Möller
f23e2144e8 Add task queue to RtpRtcpInterface::Configuration.
Let ModuleRtpRtcpImpl2 use the configured value instead of
TaskQueueBase::Current().

Intention is to allow construction of RtpRtcpImpl2 on any thread.
If a task queue is provided (required for periodic rtt updates), the
destruction of the object must be done on that same task queue.

Also, delete ModuleRtpRtcpImpl2::Create, callers updated to use std::make_unique.

Bug: None
Change-Id: I412b7b1e1ce24722ffd23d16aa6c48a7214c9bcd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199968
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32949}
2021-01-12 12:42:58 +00:00
Danil Chapovalov
e15dc58f32 Use rtc::CopyOnWriteBuffer::MutableData through webrtc
where mutable access is required.

Bug: webrtc:12334
Change-Id: I4b2b74f836aaf7f12278c3569d0d49936297716b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32936}
2021-01-11 11:31:33 +00:00
Per Kjellander
dbf95493ec Send VideoLayersAllocation with resolution if number of spatial layers
increase.

VP9 and other codecs can in theory add spatial layers without a key
frame.

Bug: webrtc:12000
Change-Id: I27461af2e34c855203a130e400a6aa01144d3cf7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198781
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32883}
2020-12-28 14:54:29 +00:00