Move the SetRTPTimestamp method from TransformableAudioFrameInterface
to the base class, so that RTPTimestamps can also be modified on encoded
video frames.
Bug: webrtc:14709
Change-Id: I355be527c2be201c9201e04c431394c962237140
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310781
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#40378}
We haven't switched to the std spelling in WebRTC yet.
Change-Id: If21a6ee9ac19be8ce959b3192eb8de044048f157
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310501
Auto-Submit: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40356}
Change implementation of `FinalizeFecHeader` to write the FEC header
for multiple ssrcs according to the updated RFC.
Change-Id: I280964b2e53c3579f348fbd42815c966840375ac
Bug: webrtc:15002
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307601
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40270}
Changed FinalizeFecHeader to recieve a list of `ProtectedStream` struct,
in order to prepare for receiving multiple ssrcs to protect in the same
FEC packet header. Implementation of the multistream case will follow in
next CL.
Change-Id: I697ef9172a07797a6f500b9ec3a9916f8f45bc04
Bug: webrtc:15002
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307620
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40269}
VoipCore still use RtpSenderEgress::NonPacedPacketSender, therefore
packets sent using NonPacedPacketSender::EnqueuePackets are proxied
to the worker thead.
When NonPacedPacketSender is used, the Pacer already guarantee that packets are sent on the worker queue.
Lock is removed from RtpSenderEgress and instead calls must be made on
the worker thread.
Bug: webrtc:15209
Change-Id: Iaf03377ad8a037ecedbbe588a4c1e8e4eadacd81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306960
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40252}
As per the comment in https://webrtc-review.googlesource.com/c/src/+/303240
on the flexfec_header_reader_writer2.h, renaming this file to flexfec_header_reader_writer.h
and renaming the current implementation to flexfec_03_header_reader_writer.h
as it is based on the 03 draft of the RFC.
Change-Id: I80cb2aba6225ec7cd989a134c3204d1db0ac6f7c
Bug: webrtc:15002
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307600
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40231}
Currently FecController knows about network conditions, these information can be used to control RTX settings in-call.
Change-Id: I8f84164aeac48ea13b7f1cf82fd7424431f98ada
Bug: webrtc:15167
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304800
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40192}
This change changes the flexfec header reader ReadFecHeader function to parse the FEC header according the the updated RFC. The fec_packet argument is expected to have the protected ssrcs list already populated, as they should be retrieved from the RTP header.
Updated and added Reader unittests. Unittests that are relevant for the Writer, were put inside a comment. In the next change set, when the header writer will be updated, we will update the unittests accordingly.
Bug: webrtc:15002
Change-Id: I118303e31c15c356ffeb2c0aafe503cf293bcad6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303260
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40172}
Instead of using most recent, or most "valuable" packets for padding, use most recent large packet.
The large packet for padding is not culled when acked by the receiver.
The most recent large packet is kept where payload size + 100bytes > currently stored.
Bug: webrtc:15201
Change-Id: I510735b757f99460c477b575061963d2b69016e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306521
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Erik Språng <sprang@google.com>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40146}
which is the correct term used in
https://www.rfc-editor.org/rfc/rfc3611#section-4.4
BUG=None
Change-Id: Iab5a1de6b69a8495aa9a6f79531053f4f2421c27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306480
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40143}
Replace Transport* interface with since std::function to stress this class doesn't produce RTP packets
Repesent outgoing packet as ArrayView instead of pointer + length.
Make outgoing transport optional, thus allowing to use RtcpTransciever as an rtcp parser.
Bug: webrtc:8239, webrtc:14870
Change-Id: Ia582d9a980786df8e295adcebe27081258b80dc0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306280
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40134}
StreamDataCounters is used both for send-side and receive side stats,
but last_packet_received_time is only used by receive statistician where
it duplicates another member
Bug: webrtc:13757
Change-Id: Iae6a65aba497e577ee3255e40623362e8c4c8a72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306183
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40119}
Create a copy of flexfec_header_reader_writer for changing the implementation according to updated RFC. The fork is needed, since the updated RFC is incompatible with flexfec-03.
In the updated RFC, we receive the list and the number of protected ssrcs from the RTP header (from it's CSRCs , and CSRC count fields).
This Change is only a copy of the existing files. This will make it easier to understand the changes to the implementation in the next change sets.
Bug: webrtc:15002
Change-Id: I31bf5eca0d8f3cb23b4caabb477897eeb0ca6d96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303240
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40103}
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}
This change replaces ReceivedFecPacket FEC header fields with vectors (for protected ssrcs, sequence numbers and masks), which is needed to support protection of multiple ssrcs in the same FEC packet (as part of the flexfec RFC - https://datatracker.ietf.org/doc/html/rfc8627).
Bug: webrtc:15002
Change-Id: I82c54203fcfec10c760f34f805cc6308562e3df1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303200
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40075}
RTX padding packets sent before media packets can legitimately have no
timestamps set (they are 0). Writing the TransmissionOffset extension
with capture time 0 will overflow once current time exceeds ~3 minutes.
Bug: webrtc:15172
Change-Id: I4dd1f341802d45016549b330f0e08cd3a00cfa19
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305020
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40055}
With intent to fully replace RtcpBandwidthObserver interface
and half of the TransportFeedbackObserver interface
RtcpBandwidthObserver interfaces passed bitrate and time variables as
raw ints, NetworkLinkRtcpObserver uses more expressive types.
Bug: webrtc:13757, webrtc:8239
Change-Id: I0a8c8de626fbe0c190a0a1a9f6733d863494401c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304700
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40043}
RtpRtcpInterface::RTT follows discouraged style of using return values,
uses raw integers to represent time delta,
and returns values that no code uses (min, max, average RTT)
added LastRtt function addresses all these stylistic issues.
Bug: webrtc:13757
Change-Id: Iaf947dd1b7139026f2beb991e69634c606c6b608
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304520
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40028}
Same information is already passed using ReporBlockData class
Bug: webrtc:8239
Change-Id: Iaae0edd34941c45527414a20923b5238e7a822fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304641
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40021}
This CL removes a PostTask in response to packet receipt reception.
This is made possible due to PacketRouter lock removal in
https://webrtc-review.googlesource.com/c/src/+/300964.
Depending on how transport code is organized, this may lead to
possibility of packet receipts arriving in
RtpTransportControllerSend which may re-enter the PacingController's
ProcessPackets method, leading to out-of-order packet sends. Fix
this by detecting re-entry and avoiding a second ProcessPackets call
in the TaskQueuePacedSender.
Bug: chromium:1373439
Change-Id: I24928f2d28a240d0860fe7e4a114cedf1f13d2bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304580
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40017}
Remove deprecated accessors returning time as raw int
Add setters for all fields to simplify usage of this class in tests
Remove unused min/max RTT fields
Bug: webrtc:13757
Change-Id: Ia8966975c15b9a930f54b4db0fc75f7002dcffe1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304461
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40013}
This CL introduces a new feature enabling video packet send batches.
The feature is enabled via
PeerConnectionInterface
::RTCConfiguration
::MediaConfig
::enable_send_packet_batching.
PacketOptions have been augmented with attribute "batchable" (set for
all video packets) and attribute "last_packet_in_batch" which gives
injected AsyncPacketSockets a chance to understand when a batch begins
and ends.
When the feature is on, packets are collected in RtpSenderEgress. On
reception of OnBatchComplete from PacingController, RtpSenderEgress
sends the collected batch, setting "last_packet_in_batch" to true
in the last packet.
Bug: chromium:1439830
Change-Id: I1846b9d4a8a0efd227d617691213a2e048bdc8a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303720
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40012}
This CL prepares for send packet batching support in later CLs.
Bug: chromium:1439830
Change-Id: I0bbecfa895aa6d4317ef8049b3789272a440d032
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304282
Auto-Submit: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40009}
rtcp::ReportBlock class is designed for serialization while
ReportBlockData designed for passing report block information across
multiple components.
This slightly reduce how RtcpTransceiver and RtcpReceiver interact with other webrtc components
Bug: webrtc:8239
Change-Id: I582e3d7b32dc6357954b29a1def37e2e72116a74
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304285
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40006}
These accessors would allow to deprecated report_block() accessor and
then would allow to remove redundant RTCPReportBlock and ReportBlock types converging on single
ReportBlockData type to pass that information across WebRTC components
helpers like fraction_lost() and jitter() would also allow to unify conversion of the rtp specific format into more common way of represent such information
Bug: None
Change-Id: I3c97f96affcf83b529095899bd63af007f8b4014
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303880
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39975}
This allows encoded frames to be written to any encoded insertable
streams writer without needing to somehow set valid RTP sequence
numbers. Assumes streams are using the Dependency Descriptor header ext.
A short term fix while we discuss whether we can remove the sequence
number check in RtpFrameReferenceFinder::ManageFrame.
Bug: chromium:1439799
Change-Id: I3c1d83793cd8b6cae2a8ad2129b3b6daab1d11c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302301
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#39966}
Instead of crashing with a CHECK fail when an insertable stream of a
Video RTPSender is given a frame from an RTPReceiver's insertable
stream, construct a reasonable analogous sender frame and pass it
through to be decoded.
A small step towards removing the split we have between Sender and
Receiver implementations of TransformableFrameInterface which just
confuses users of the API.
Counterpart to https://webrtc-review.googlesource.com/c/src/+/301181 in
the opposite direction.
Bug: chromium:1250638
Change-Id: If66da7d553f14979ff1c5b4e00bff715f58cfce0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303480
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#39963}
This is in preparation of using the state that SourceTracker manages
for more things than only getContributingSources. Audio levels reported
via getStats(), aren't consistent with levels reported via getCS.
Since more operations will be derived from the ST owned data, moving
the management of it away from the audio thread, reduces the potential
of contention.
Bug: webrtc:14029, webrtc:7517, webrtc:15119
Change-Id: I553f7e473316a1c61eeb43ded905a18242a04424
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302280
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39943}