Commit graph

198 commits

Author SHA1 Message Date
Danil Chapovalov
6aba07e5fe Account for mid and rrsid when reserving extra space for an rtx packet
Bug: webrtc:11031
Change-Id: I44405d0d15e885307b3134b1b88dcb74b96381fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294400
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39368}
2023-02-22 12:52:43 +00:00
Philipp Hancke
5e7301f693 Remove rid and rrid from list of extensions that can be used for audio
BUG=webrtc:13279

Change-Id: I5d28d15bdb2b0d82b27c35069ca379631c7494cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291900
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39257}
2023-02-03 14:36:14 +00:00
Tony Herre
64ce699f4b Propagate Video CSRCs modified by an insertable streams frame transform
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}
2023-01-27 16:32:43 +00:00
Danil Chapovalov
ef90964b83 Introduce new enum name for the dependency descriptor extension
Dependency descriptor has finalized spec and thus deserve a dedicated name.

Bug: webrtc:10342
Change-Id: I2c2f1d52c82cfff8372cd4092dfcc47a083a6009
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290402
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38973}
2023-01-02 14:26:28 +00:00
Philipp Hancke
4e83af3a9a Adjust RTP header extension overhead for RRID
which needs to be taken into account separately if the
primary SSRC has been acknowledged but the RTX SSRC has
not.

If nothing has been acknowledged, mid+rid are sent on the primary SSRC and mid+rrid are sent on the RTX SSRC.
If the primary SSRC has been acknowledged, no extensions are sent on the primary SSRC and mid+rrid are sent on the RTX SSRC.
If both the primary SSRC and the RTX SSRC have been ack'd, no extensions are sent on either primary or RTX SSRC.

BUG=webrtc:13896

Change-Id: Ice251fae23a881ee9c9edc71b5d5c45a32ac76d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288980
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38949}
2022-12-23 08:54:30 +00:00
Byoungchan Lee
8c725f368c Fix several UBsan issues with memcpy
Most of the changes are trivial.

Bug: webrtc:14432
Change-Id: I0444527bf57c72c8d65f69754b4a4a1c1d7b2e92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38074}
2022-09-14 09:35:39 +00:00
Erik Språng
28bc2ca92c Remove unused WebRTC-LimitPaddingSize field trial
Bug: webrtc:11508
Change-Id: Ib7d48e23bd44e2f948d51800090fc14b873d11eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268122
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37485}
2022-07-07 14:28:06 +00:00
Niels Möller
bc6101459f Delete RtpRtcpInterface::SetRid.
This setter method is replaced by a construction-time config setting.

Bug: None
Change-Id: I1a685e9b4065762b30698231c7f4d9c567459e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264446
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37148}
2022-06-08 09:18:01 +00:00
Niels Möller
af785d9759 Deprecate setter RtpRtcpInterface::SetRid
This setter method is replaced by a construction-time config setting.

Bug: None
Change-Id: Iddffaeeb719a56328bccde3c4a1a0a852d2131b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264501
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37060}
2022-05-31 12:41:13 +00:00
Ali Tofigh
d14e8894fc Adopt absl::string_view in modules/rtp_rtcp
Bug: webrtc:13579
Change-Id: Ic4e1431bedc69492358cb2e3749b50a941306f44
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262250
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36887}
2022-05-13 15:01:18 +00:00
Danil Chapovalov
836d58408d Delete deprecated RTPSender constructor
Bug: webrtc:11340
Change-Id: Id7ade3b15510e32b8bf4653b0e1652c275b58e88
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258789
Auto-Submit: 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/main@{#36549}
2022-04-14 09:00:19 +00:00
Jonas Oreland
e62c2f2c77 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView

Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
2022-03-29 10:14:00 +00:00
Danil Chapovalov
a2ee9234b4 Migrate to Timestamp and TimeDelta types in RtpPacketHistory
Bug: webrtc:13757
Change-Id: Ie542fca50b97fe9dc450e45da40f05e2b66c7da5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252981
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36132}
2022-03-04 15:02:58 +00:00
Danil Chapovalov
b663cfaae4 Cleanup RtpPacketHistory from unused features
history no longer used for storing unsent packets and for legacy pacer.

Bug: None
Change-Id: I639c37de66857a64c620e80df6288fa6ce8326d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253260
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36120}
2022-03-03 14:30:27 +00:00
Danil Chapovalov
9af4aa7cf4 Reland "Represent RtpPacketToSend::capture_time with Timestamp"
This reverts commit 56db8d0952.

Reason for revert: downstream problem addressed

Original change's description:
> Revert "Represent RtpPacketToSend::capture_time with Timestamp"
>
> This reverts commit 385eb9714d.
>
> Reason for revert: Causes problems downstream:
>
> #
> # Fatal error in: rtc_base/units/unit_base.h, line 122
> # last system error: 0
> # Check failed: value >= 0 (-234 vs. 0)
>
> Original change's description:
> > Represent RtpPacketToSend::capture_time with Timestamp
> >
> > Bug: webrtc:13757
> > Change-Id: I0ede22cd34e3a59afe1477d8edd495dce64e3242
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252586
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#36083}
>
> Bug: webrtc:13757
> Change-Id: I8442abd438be8726cf671d0f372d50ecfac6847e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252720
> Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36087}

Bug: webrtc:13757
Change-Id: I1fa852757480116f35deb2b6c3c27800bdf5e197
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252781
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36093}
2022-02-28 10:04:37 +00:00
Tomas Gunnarsson
56db8d0952 Revert "Represent RtpPacketToSend::capture_time with Timestamp"
This reverts commit 385eb9714d.

Reason for revert: Causes problems downstream:

#
# Fatal error in: rtc_base/units/unit_base.h, line 122
# last system error: 0
# Check failed: value >= 0 (-234 vs. 0)

Original change's description:
> Represent RtpPacketToSend::capture_time with Timestamp
>
> Bug: webrtc:13757
> Change-Id: I0ede22cd34e3a59afe1477d8edd495dce64e3242
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252586
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36083}

Bug: webrtc:13757
Change-Id: I8442abd438be8726cf671d0f372d50ecfac6847e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252720
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36087}
2022-02-26 10:35:13 +00:00
Danil Chapovalov
385eb9714d Represent RtpPacketToSend::capture_time with Timestamp
Bug: webrtc:13757
Change-Id: I0ede22cd34e3a59afe1477d8edd495dce64e3242
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252586
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36083}
2022-02-25 16:44:07 +00:00
Danil Chapovalov
27d5f14cf2 in RTPSender disallow enabling misconfigured rtx
Bug: None
Change-Id: Id94771626ef723212e4d92d9093af3ec9e647990
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251780
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36020}
2022-02-16 16:08:40 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Danil Chapovalov
723b35f6f0 Delete legacy function to deregister rtp header extension by type
Bug: None
Change-Id: I1d9447df41edf109665a5c746a6dc2c912aad8a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234526
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35179}
2021-10-11 15:42:19 +00:00
Erik Språng
54abf984cc Remove the now unused non-deferred sequencing code path.
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}
2021-08-13 17:17:49 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
Artem Titov
913cfa76ec Use backticks not vertical bars to denote variables in comments for /modules/rtp_rtcp
Bug: webrtc:12338
Change-Id: I52eb3b6675c4705e22f51b70799ed6139a3b46bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227164
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34686}
2021-08-09 15:51:03 +00:00
Erik Språng
bb90497eaa Add support for deferred sequence numbering.
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}
2021-08-06 12:38:27 +00:00
Erik Språng
31c0cfdf7f Remove unused deprecated code in RTPSender.
Bug: webrtc:11340, webrtc:12470
Change-Id: I01a6262cfeb33d1900f8f3cd93cceee2ff73a8a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227643
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34646}
2021-08-04 19:19:00 +00:00
Erik Språng
bfcfe034f4 Move ownership of PacketSequencer from RTPSender to RtpRtcp module.
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}
2021-08-04 13:44:51 +00:00
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
Doudou Kisabaka
ae0d117d51 Implement the mixer-to-client per CSRC audio level extension (RFC 6465).
This is loosely based on the similar implementation in gecko.

Bug: webrtc:9965
Change-Id: I5203a05e1c34ca6f97bd1b143790f95ff245e340
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219791
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Doudou Kisabaka <doudouk@google.com>
Cr-Commit-Position: refs/heads/master@{#34102}
2021-05-24 14:11:28 +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
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
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
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
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
Karl Wiberg
c95b939667 Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()
And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.

Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
2020-11-09 10:47:55 +00:00
Fabien Vallée
f8b5bfeaf2 Fix "control reaches end of non-void function" warnings
"warning: control reaches end of non-void function [-Wreturn-type]"
Reported by gcc (8.3)

In all the reported cases, the end of function is never actually
reached. Add RTC_CHECK(false) to ensure the compiler is aware that
this path is a dead-end.

Bug: webrtc:12008
Change-Id: I7f816fde3d1897ed2774057c7e05da66e1895e60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189784
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Fabien VALLÉE <fabien.vallee@netgem.com>
Cr-Commit-Position: refs/heads/master@{#32503}
2020-10-27 10:22:23 +00:00
Per Kjellander
6556ed2402 Add experimental extension RtpVideoLayersAllocation
The extension is suggested to be used for signaling per target bitrate, resolution
and frame rate to a SFU to allow a SFU to know what video layers a client is currently targeting.
It is hoped to replace the current Target bitrate RTCP XR message currently used only for screen share.

Bug: webrtc:12000
Change-Id: Id7b55e7ddaf6304e31839fd0482b096e1dbe8925
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185980
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32313}
2020-10-05 13:38:13 +00:00
Erik Språng
f360506c7a Deferred FEC: Prevents duplicate FEC addition of non-RTX retransmission.
This CL fixes a bug where the RtpPackeToSend::fec_protect_packet flag
was not cleared when a packet copy was fetched from the packet history
in order to be retransmitted. This caused the packet to be added to the
FEC generator a second time when the retransmission passed through
RtpSenderEgress.

The bug did not affect RTX retransmission and only manifests when using
deferred FEC generation.

Bug: webrtc:11340
Change-Id: Ic7ce2800cce9a99e74bd3dd697bc0779d2a02fda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185817
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32227}
2020-09-29 12:31:01 +00:00
Dan Minor
fa504e744f Check that capture time is valid before adjusting it.
A packet's capture time may be -1 to indicate an unset value. We need to
check that this is the case before adjusting it when generating padding.
Otherwise, invalid values will result.

Bug: webrtc:11615
Change-Id: Ibbeb959f1d4d37dd4d65702494b97246642b57d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176281
Commit-Queue: Dan Minor <dminor@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31766}
2020-07-20 14:04:00 +00:00
Markus Handell
e7c015e112 Migrate modules/rtp_rtcp to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: I4c71f3a28ef875af2c232b1b553840d6e21649d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178804
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31645}
2020-07-07 12:13:47 +00:00
philipel
9465978a3b Remove framemarking RTP extension.
BUG=webrtc:11637

Change-Id: I47f8e22473429c9762956444e27cfbafb201b208
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176442
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31522}
2020-06-15 11:18:00 +00:00
Tomas Gunnarsson
f25761d798 Remove dependency from RtpRtcp on the Module interface.
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}
2020-06-04 08:11:21 +00:00
Markus Handell
0ee4ee85dd RtpSender: remove lock recursions.
This change removes lock recursions and adds thread annotations.

Bug: webrtc:11567
Change-Id: I4d5a8b361b140c24f4bcd2dcb83706ca0b3927d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176222
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31370}
2020-05-27 16:05:46 +00:00
Erik Språng
adaec45f36 Removes RepairedRtpStreamId from overhead calculation.
In https://webrtc-review.googlesource.com/c/src/+/173704 the overhead
calculations were made more static, so that "volatile" extensions
(those that are not set on every packet) are ignored. The intent, as
the comments specify, was to ignore RepairedRtpStreamId since that is
only used on RTX packets.
This CL makes us actually count that extension as volatile.

Bug: webrtc:10809
Change-Id: If42ae84e4c09ff9112e93f8d872ee890c6253a23
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175010
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31246}
2020-05-13 16:53:12 +00:00
Erik Språng
04e1bab1b3 Replaces OverheadObserver with simple getter.
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}
2020-05-07 17:33:45 +00:00
Erik Språng
1120f7d895 Makes the max padding factor default 3.0x
Bug: webrtc:11508
Change-Id: Ib2e8f5216140f55a590f43fc52a50058703cc2bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173750
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31120}
2020-04-22 10:57:21 +00:00
Danil Chapovalov
ec9fc2208e Delete generic frame descriptor v1 trait and enum value
Bug: webrtc:11358
Change-Id: I272a45881f8ef9963b502c6d17edc97e7d9fbc8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173582
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31089}
2020-04-16 17:29:18 +00:00