contributing sources are usually decided per packet, and thus having persistent member for csrcs makes them less natural to use.
Bug: None
Change-Id: I804d58ace574368f8cdd4356a15471110e530744
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291334
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40547}
which is the maximum allowed in RFC 3550:
The last octet of the padding contains a count of how
many padding octets should be ignored, including itself
SRTP encryption does not need to be taken into account since none of
the cipher suites used by WebRTC require padding:
https://www.rfc-editor.org/rfc/rfc3711#section-3.1https://www.rfc-editor.org/rfc/rfc7714#section-7.2
BUG=webrtc:15182
Change-Id: Ife3d264af389509733699f2dd4d32ba63793e9de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305642
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40101}
Allow CSRCs to be modified per-frame in an Encoded Insertable Streams
transform, to support a web API which allows per-frame CSRC
modifications to signal when a JS application has changed the source
of the video which is written into an encoded frame.
Initially only for Video, with Audio support likely to follow later.
Bug: webrtc:14709
Change-Id: Ib34f35faa9cee56216b30eaae42d7e65c78bb9f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291324
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tove Petersson <tovep@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#39214}
The config flag will be removed once downstream usage is gone.
Bug: webrtc:11340
Change-Id: Iee8816660009211540d9b09bb3cba514455d709b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228431
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34757}
With this turned on, packets will be sequence number after the pacing
stage rather that during packetization.
This avoids a race where packets may be sent out of order, and paves
the way for the ability to cull packets from the pacer queue without
causing sequence number gaps.
For now, the feature is off by default. Follow-ups will enable it for
video and audio separately.
Bug: webrtc:11340, webrtc:12470
Change-Id: I6d411d8c85b9047e3e9b05ff4c2c3ed97c579aa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208584
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34661}
This prepares for deferred sequence numbering, and is (sort of)
extracted from
https://webrtc-review.googlesource.com/c/src/+/208584
Bug: webrtc:11340, webrtc:12470
Change-Id: I2f3695309e1591b9f7a1ee98556f4f0758de7f69
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227352
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34643}
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}
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}
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}
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}
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}
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}
The former was unused, the latter is replaced with the explicit C++11
deletions. The related RTC_DISALLOW_COPY_AND_ASSIGN is left for now,
it is used in a lot more places.
Bug: None
Change-Id: I49503e7f2b9ff43c6285f8695833479bbc18c380
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185500
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32224}
The 'Module' part of the implementation must not be
called via the RtpRtcp interface, but is rather a part of
the contract with ProcessThread. That in turn is an
implementation detail for how timers are currently implemented
in the default implementation.
Along the way I'm deprecating away the factory function which
was inside the interface and tied it to one specific implementation.
Instead, I'm moving that to the implementation itself and down the
line, we don't have to go through it if we just want to create an
instance of the class.
The key change is in rtp_rtcp.h and the new rtp_rtcp_interface.h
header file (things moved from rtp_rtcp.h), the rest falls from that.
Change-Id: I294f13e947b9e3e4e649400ee94a11a81e8071ce
Bug: webrtc:11581
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176419
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31440}
This interface has a couple of issues. Primarily for me, it makes it
difficult work with the paced sender as we need to either temporarily
release a lock or force a thread-handover in order to avoid a cyclic
lock order.
For video in particular, its behavior is also falky since header sizes
can vary not only form frame to frame, but from packet to packet within
a frame (e.g. TimingInfo extension is only on the last packet, if set).
On bitrate allocation, the last reported value is picked, leading to
timing issues affecting the bitrate set.
This CL removes the callback interface and instead we simply poll the
RTP module for a packet overhead. This consists of an expected overhead
based on which non-volatile header extensions are registered (so for
instance AbsoluteCaptureTime is disregarded since it's only populated
once per second). The overhead estimation is a little less accurate but
instead simpler and deterministic.
Bug: webrtc:10809
Change-Id: I2c3d3fcca6ad35704c4c1b6b9e0a39227aada1ea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173704
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31185}
This CL also slightly refactors unit test, to test fewer things each.
Bug: webrtc:11508
Change-Id: I98553d2b185364132c626d373683f38891e36c6d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173620
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31087}
With the new config option |always_send_mid_and_rid|, the user
of the RTPSender can decide if MIDs and RIDs should always be sent
(when provided and negotiated), or if their sending should be disabled
after the receiver has acked the stream. Depending on the use case,
different settings might be preferable. The default setting is not
changed in this CL.
Bug: webrtc:11416
Change-Id: Ic3c71a6105fb7ee08d53cf9eb03f4e53b5799610
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170109
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30742}
Some clients will not count audio packets into the bandwidth estimate
despite negotiating e.g. abs-send-time for that SSRC.
If padding is sent on such an RTP module, we might get stuck in a low
resolution.
This CL works around that by preferring to send padding on video SSRCs.
Bug: webrtc:11196
Change-Id: I1ff503a31a85bc32315006a4f15f8b08e5d4e883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161941
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30066}
The post-pacing part of the RTP sender has been moved from RTPSender
into the new RtpSenderEgress class. However, that class is not directly
used and instead a subset of method calls are passed through RTPSender.
This CL prepares for removing dependencies between RTPSender and
RtpSenderEgress. All current behavior is preserved, and unit tests are
unchanged to verify this.
For more context, see patch set 2.
Change-Id: If795f2603aeb6302ac1565d9efaea514af240dc7
Bug: webrtc:11036
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158020
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29616}
Post-pacer code now contained in RtpSenderEgress class.
For now, this is a member of RTPSender. More refactoring is needed to
make clean split.
Bug: webrtc:11036
Change-Id: I95264d013de120601784f130ba81c7b234446980
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157172
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29519}
This is a reland of 96f3de0945
Downstream test is fixed, this is a pure reland.
TBR=danilchap@webrtc.org,srte@webrtc.org
Original change's description:
> Use just a lookup map of RTP modules in PacketRouter
>
> Since SSRCs of RTP modules are now set at construction time, we can
> use just a simple unordered map from SSRC to module in packet router.
>
> Bug: webrtc:11036
> Change-Id: I0b3527f17c9ee2df9253c778e5b9e3651a70b355
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155965
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29510}
Bug: webrtc:11036
Change-Id: I0731339dfd0781cc7f2f7ca78ac903539f25ff9c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157304
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29514}
This reverts commit 96f3de0945.
Reason for revert: Downstream test is borked.
Original change's description:
> Use just a lookup map of RTP modules in PacketRouter
>
> Since SSRCs of RTP modules are now set at construction time, we can
> use just a simple unordered map from SSRC to module in packet router.
>
> Bug: webrtc:11036
> Change-Id: I0b3527f17c9ee2df9253c778e5b9e3651a70b355
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155965
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29510}
TBR=danilchap@webrtc.org,sprang@webrtc.org,srte@webrtc.org
Change-Id: I31330fd68ab809ff3951573791e9a79b81599958
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11036
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157281
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29511}
Since SSRCs of RTP modules are now set at construction time, we can
use just a simple unordered map from SSRC to module in packet router.
Bug: webrtc:11036
Change-Id: I0b3527f17c9ee2df9253c778e5b9e3651a70b355
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155965
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29510}
This CL sets the RTP stats callback on construction, by adding a field
next to the other observers in RtpRtcp::Configuration.
We can then remove the RegisterCallback() methods and the unused
GetCallback() method.
Bug: webrtc:11036
Change-Id: I4eb86ea63b4b2ebeff60b311ddf3bed06b279ce4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157169
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29504}
This is a reland of 17608dc459
Downstream test now fixed.
As a precaution, also avoid DCHECKS for non-zero SSRC.
First patch set is reland, second makes checks more lenient.
Original change's description:
> RtpRtcp modules and below: Make media, RTX and FEC SSRCs const
>
> Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
> remove them, make the members const, and remove now unnecessary locking.
>
> Bug: webrtc:10774
> Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29475}
Bug: webrtc:10774
Change-Id: I540b49a31a31e98d87f02ae04083d5206e71c1b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157100
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29491}
This was just checked in all places were it was used, moving the check
into RtpRtcp reduces the boiler plate required at the call sites.
Also changing to always register and unregister extensions by URI to
synchronize the code in AudioSendStream with the code in RtpVideoSender.
This prepares for reducing the scope of ChannelSend.
Bug: webrtc:9883
Change-Id: Ia64d79f20eb98f46cbbbe8318770e4fcf9caa1ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155620
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29490}
This is a reland of 17608dc459
Downstream fixed, relanding.
Original change's description:
> RtpRtcp modules and below: Make media, RTX and FEC SSRCs const
>
> Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
> remove them, make the members const, and remove now unnecessary locking.
>
> Bug: webrtc:10774
> Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29475}
TBR=nisse@webrtc.org
Bug: webrtc:10774
Change-Id: I759bed3ff1909857696c6d1b13df595a5e552f03
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157049
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29486}
Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
remove them, make the members const, and remove now unnecessary locking.
Bug: webrtc:10774
Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29475}
This interface/config field is now unused, let's remove it.
Bug: webrtc:10633
Change-Id: I56ff3d47ba784d973de411ada52ec9485bad9864
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150531
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28978}
Previously the kDontRetransmit value was used to indicate packets that
should not be retransmitted but were put in the RtpPacketHistory anyway
as a temporary storage while waiting for a callback from PacedSender.
Since PacedSender now always owns the delayed packets directly, we can
remove all usage of StorageTye in RtpPacketHistory, and only put
packets there after pacing if RtpPacketToSend::allow_retransmission()
returns true.
Bug: webrtc:10633
Change-Id: I003b76ba43bd87658cc2a39e908fd28ebcd403f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150521
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28974}