1357 Commits

Author SHA1 Message Date
Shunbo Li
521b09bfb7 Fix regression caused by default action changed for h264:Nalu:kFiller
This commit fixes the issue of discontinuous RTP sequence numbers
caused by improper discarding of these nalu types:
kFiller/kEndofSequence/kEndOfStream.

Bug: webrtc:368335257
Change-Id: Id7a2d34b22ee1c6e1523d8279d9838c57fdeb97f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366501
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43299}
2024-10-24 10:59:29 +00:00
Olov Brändström
05666b4db7 Function that Converts NtpTime to a Timestamp with UTC epoch in Clock.
danilchap@webrtc.org suggested to add a converter for NtpTime <-> UTC Timestamp for in https://webrtc-review.googlesource.com/c/src/+/365641.

This CL add a NtpTime -> UTC Timestamp in Clock, and change code to start to use the new function.

Bug: None
Change-Id: If4af6cb8e31c1731692edfb8358e67b7a43226a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366001
Commit-Queue: Olov Brändström <brandstrom@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43293}
2024-10-23 14:19:08 +00:00
Per K
639494be57 Add method CompactNtpIntervalToTimeDelta
Similar to CompactNtpRttToTimeDelta but can return negative values.

Bug: webrtc:42225697
Change-Id: Iea97502ea73eb6240f42c2040cdc576e51298704
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366422
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43284}
2024-10-22 16:46:10 +00:00
Per K
079a8b4691 Refactor CongestionControllerFeedback logic
CongestrionControllerGenerator tracks received packets per SSRC.
Lost packets are included in rtcp:CongestionControlFeedback::Packets()

This is done in order to be able to track lost packets between
feedback packets.

Bug: webrtc:42225697
Change-Id: Ib47d9b55c3d150cb98a44a4f3997cfcfe6c5fbb5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366002
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43274}
2024-10-21 12:42:26 +00:00
Per K
2ee43d6daa Callback to NetworkStateEstimateObserver before NetworkLinkRtcpObserver
If RTCP compound message is received with both these messages,
NetworkStateEstimator should be invoked before NetworkLinkRtcpObserver
since remote network state estimate may set limits on the BWE
calculated from the transport feedback.

Bug: webrtc:42220808
Change-Id: Ieac9c1d7d9c28e690351bcf1d8125c9e0099f962
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365583
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43239}
2024-10-15 10:55:31 +00:00
qwu16
60c3fea7eb Fix header length and set layer_id/temporal_id with lowest value of aggregated NALU for AP packet in H265 RTP packetizer
Bug: webrtc:41480904
Change-Id: I56047b20933ba1f251ef88dc73a40c4967e8f89e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362560
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Qiujiao Wu <qiujiao.wu@intel.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43220}
2024-10-11 02:58:02 +00:00
Olov Brändström
b74268e0cf Update TODOs to the correct format.
Some TODOs that where added in https://webrtc-review.googlesource.com/c/src/+/365001 do not follow the correct format
https://webrtc.googlesource.com/src/+/refs/heads/main/g3doc/style-guide.md#comments. This CL updates the incorrect TODOs.

Also updated some comments as they referred to ntp timestamps, when the timestamp is utc.

Bug: None
Change-Id: I1661f6f57c9fa5f66e5b92f154007c34854923c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365162
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Olov Brändström <brandstrom@google.com>
Cr-Commit-Position: refs/heads/main@{#43214}
2024-10-10 11:21:44 +00:00
Olov Brändström
51b682648e Add an environment clock timestamp to SenderReportStats.
Add an environment clock timestamp to SenderReportStats and make it visible in rtc_stats_collector.cc. This make it possible to use the pc->GetConfiguration().stats_timestamp_with_environment_clock() flag to decide which timestamp to use when creating a RTCRemoteOutboundRtpStreamStats object.

This CL is the third (and possible the last) of a series of CLs that aim to replace the UTC timestamps in RTCStats objects to Environment clock timestamps. The other CLs where https://webrtc-review.googlesource.com/c/src/+/363946 and https://webrtc-review.googlesource.com/c/src/+/364782.

When Chromium and Google internal uses of RTCStats are updated to set the stats_timestamp_with_environment_clock configuration, the flag can be deleted.

Bug: chromium:369369568
Change-Id: Ic0b07d7b012505267bd6516f19a9ba90df4cafab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365001
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Olov Brändström <brandstrom@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43206}
2024-10-09 12:59:08 +00:00
Olov Brändström
b9c4c242d4 rename timestamps to show epoch
I missed one timestamp in https://webrtc-review.googlesource.com/c/src/+/363946, meaning that the config flag that was added do not yet work for all timestamps in RTCStats objects. The RTCRemoteOutboundRtpStreamStats still has UTC timestamps even if the config flag is set.

I will solve this by saving both an UTC (existing) and env (to be added) timestamp, and then let rtc_stats_collector choose timestamp based on the value of the config flag (just like RTCRemoteInboundRtpStreamStats is done in the 363946 commit).

Before adding the new env_ timestamp I want to make this change. I rename the existing timestamp to show what epoch it uses (NTP or UTC). This will later make it clear which timestamp is which.

So this CL will make no logical change, just renaming members.

I only need to rename the last_sender_report_timestamp_ms, but opted to rename the remote timestamp as well, to be consistent with the naming convention I add in this CL.

Bug: chromium:369369568
Change-Id: Icfe7cf274995b39799e1478a1bb8cdf5134f0b16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364782
Commit-Queue: Olov Brändström <brandstrom@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43194}
2024-10-08 16:27:58 +00:00
Danil Chapovalov
d9b04adbdb Cleanup static constants in modules/rtp_rtcp/
Change static const to static constexpr where applicable
In .cc files ensure static constants are in unnamed namespace
Remove obsolete declaration for class level constexpr values

Bug: None
Change-Id: I23759974b5042c8c9d9ec2816ee7df283a8872d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364483
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43171}
2024-10-04 13:05:46 +00:00
Sergio Garcia Murillo
ca3ac5fe64 Use ArrayView for byte stream parsing in VideoRtpDepacketizerH264
Bug: webrtc:42223344, webrtc:42225170
Change-Id: I4894961d31baf09880ada600516b75799cba6ac0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364640
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43170}
2024-10-04 13:01:44 +00:00
Sergio Garcia Murillo
fb803de683 Fix is_first_packet_in_frame for SEI and PPS NALUs
PacketBuffer will ignore any non-idr frame which is firs packet has not
is_first_packet_in_frame set to true if there was a packet loss in the
previous frame even if the cseqs are continous:

https://issues.webrtc.org/issues/368335257#comment14

This CL sets this flag to true to SEI and PPS nal units that would have
caused the delta frames after an idr frame to be dropped in case of loss.

Bug: webrtc:368335257
Change-Id: Ic7150297d7fb4ed274c7d99175ff367100b5cf75
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364241
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43168}
2024-10-03 18:29:19 +00:00
Danil Chapovalov
f75ab82b46 Support RTC_LOG for types that implement both AbslStringify and ToLogString
To support libraries and dependencies compatible with absl way of debug printing custom types.
In particular gtest can use AbslStringify to produce nice output when unit types are compared with EXPECT macros.

Bug: None
Change-Id: Ie78293a225f61977f256f0234e07d166b1977e2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364162
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43164}
2024-10-03 13:54:40 +00:00
Olov Brändström
4baeed3b97 Use environment monotonic timestamps (i.e. not UTC) in RTCStats.
Add media config for using environment monotonic timestamps (i.e. not UTC) in RTCStats constructor, and implemented the usage of the flag.

Bug: chromium:369369568
Change-Id: Ia93d048742c28af201164fe7b2152b791bb6d0b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363946
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Olov Brändström <brandstrom@google.com>
Cr-Commit-Position: refs/heads/main@{#43156}
2024-10-03 09:07:17 +00:00
Danil Chapovalov
208491c8b9 Revert "Use ArrayView for byte stream parsing in VideoRtpDepacketizerH264"
This reverts commit 4b53e9af6126028497239b39321ec6740f8e2bc2.

Reason for revert: Bug: chromium:371054866

Original change's description:
> Use ArrayView for byte stream parsing in VideoRtpDepacketizerH264
>
>
> Bug: webrtc:42223344, webrtc:42225170
> Change-Id: Ia2025ab225499702c0abe47690742a9c0d6109b7
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364380
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43147}

Bug: webrtc:42223344, webrtc:42225170, chromium:371054866
Change-Id: I5c0222add560622a6ce34622d80a4bf7f1fc3fae
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364560
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43155}
2024-10-03 08:52:33 +00:00
Sergio Garcia Murillo
4b53e9af61 Use ArrayView for byte stream parsing in VideoRtpDepacketizerH264
Bug: webrtc:42223344, webrtc:42225170
Change-Id: Ia2025ab225499702c0abe47690742a9c0d6109b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364380
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43147}
2024-10-02 14:12:50 +00:00
Fanny Linderborg
4c675e3850 Use absl::get_if instead of absl::holds_alternative and absl::get
Bug: webrtc:358039777
Change-Id: I47efb3efe43cacee39d5d103915e49bdd6e20775
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364420
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43145}
2024-10-02 13:38:32 +00:00
Fanny Linderborg
a49ab28fca Set CodecSpecific.FrameInstrumentationData in RtpFrameObject ctor
Bug: webrtc:358039777
Change-Id: Ib0a663f06b293c62a4eb0689b82b3bf919cff25f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364282
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43136}
2024-10-02 07:09:11 +00:00
Philipp Hancke
949d3c9acf Reland "h264: fix first_packet_in_frame logic for multislice in a single rtp packet"
This reverts commit bdc669347c70160cd648f5cab7a417227d41d82a.

Reason for revert: AUDs will be taken into account now.
video_replay with the provided out.pcap and these options:
--codec H264 --input_file out.pcap --media_payload_type 102 --ssrc 40000
plays smoothly.

Original change's description:
> Revert "h264: fix first_packet_in_frame logic for multislice in a single rtp packet"
>
> This reverts commit 3753c8190e3f0aca6758a5521e33f8b5d4f09ab4.
>
> Reason for revert: Break assembling of hardware encoded h264 P frame on
> weak network condition.
>
> Original change's description:
> > h264: fix first_packet_in_frame logic for multislice in a single rtp packet
> >
> > a frame must be (or should be) first when it contains either SPS (but not just PPS),
> > is an IDR or is a slice with first_mb_in_slice == 0.
> >
> > Fixes an edge case where a STAP-A with SPS, PPS and multiple slices of an IDR fit
> > into a single RTP packet which can happen with small 320x196 frames
> >
> > BUG=webrtc:352379280,webrtc:346608838
> >
> > Change-Id: Ic6dea6c81db759d0d7ddd4054407103fd791f6c5
> > No-Try: true
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357121
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#42652}
>
> Bug: webrtc:368335257
> Change-Id: I07725c78be628bff71b79b8b9369677e39f5f5ac
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363080
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Philipp Hancke <phancke@meta.com>
> Cr-Commit-Position: refs/heads/main@{#43062}

Bug: webrtc:368335257
Change-Id: Idfae2efc1ebd7b97a2f7ebbd9d1e8c7bf6fcc348
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363842
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43113}
2024-09-30 18:03:49 +00:00
Danil Chapovalov
8d4638f985 Delete deprecated variant of ReceiveStatistics::SetMaxReorderingThreshold
Fixed: webrtc:42220729
Change-Id: I87c08769d33746e40dcdbf213096fc9732f82a07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363962
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43095}
2024-09-27 14:43:42 +00:00
Danil Chapovalov
0af0c059f2 Delete deprecated RtpPacketHistory constructor
Bug: webrtc:362762208
Change-Id: I72b0f8b12b2282d9466271ae20dad5de44539af2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363863
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43093}
2024-09-27 11:01:56 +00:00
Fanny Linderborg
28d1a9a4de Write corruption detection header extension to last packet
Bug: webrtc:358039777
Change-Id: Iaa69310e361b51cb109a43cc46aed124af69bd97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363302
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43084}
2024-09-26 11:38:22 +00:00
Ho Cheung
a8efbb223b [cleanup] Migrate absl::in_place to std::in_place
Self-explanatory.

Fixed: webrtc:342905193
Change-Id: I3cf1ec99ef6867bb33289977246725badf2bfcfe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363360
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Auto-Submit: Ho Cheung <hocheung@chromium.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43071}
2024-09-23 16:21:45 +00:00
Gao Chun
bdc669347c Revert "h264: fix first_packet_in_frame logic for multislice in a single rtp packet"
This reverts commit 3753c8190e3f0aca6758a5521e33f8b5d4f09ab4.

Reason for revert: Break assembling of hardware encoded h264 P frame on
weak network condition.

Original change's description:
> h264: fix first_packet_in_frame logic for multislice in a single rtp packet
>
> a frame must be (or should be) first when it contains either SPS (but not just PPS),
> is an IDR or is a slice with first_mb_in_slice == 0.
>
> Fixes an edge case where a STAP-A with SPS, PPS and multiple slices of an IDR fit
> into a single RTP packet which can happen with small 320x196 frames
>
> BUG=webrtc:352379280,webrtc:346608838
>
> Change-Id: Ic6dea6c81db759d0d7ddd4054407103fd791f6c5
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357121
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42652}

Bug: webrtc:368335257
Change-Id: I07725c78be628bff71b79b8b9369677e39f5f5ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363080
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43062}
2024-09-20 14:32:01 +00:00
Joachim Reiersen
bba1a2e476 Propagate Environment to RtpPacketHistory
Passing Environment instead of Clock into this class simplifies some plumbing for downstream consumers that need to read field trials within this class.

Bug: webrtc:362762208
Change-Id: Ia501e9f7f1d91a8115a2f71fb005dd35146db172
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362535
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43048}
2024-09-19 09:39:07 +00:00
Danil Chapovalov
a1ed306293 Cleanup unused members in RtpRtcp::Configuration
They are now passed as part of the Environment

Bug: webrtc:362762208
Change-Id: I02868e9f41533a546f62fe30fdc6f3a7708eb346
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362084
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43032}
2024-09-17 12:02:19 +00:00
Danil Chapovalov
0acbb7745f Pass Environment into RtcpSender
To remove usage of RtcpConfiguration fields that are passed through Environment

Bug: webrtc:362762208
Change-Id: I1a0f218efe6a893c31ef2272cf2379c66fb7b205
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361746
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42984}
2024-09-09 13:44:21 +00:00
Danil Chapovalov
02113a2169 Pass Environment into RtcpReceiver
to avoid relying on the global field trials.

Bug: webrtc:362762208
Change-Id: I94e96f0a3f16cfd64f7deb4deb4aaa924ac1bba8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361865
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42982}
2024-09-09 11:36:29 +00:00
Danil Chapovalov
e922cd1262 Use Environment instead of Clock in ModuleRtpRtcp and its RTP subcomponents
Bug: webrtc:362762208
Change-Id: I35af5cf3ed48e2c738c12df2ed9117a640ed0ff7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361720
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42966}
2024-09-05 15:58:43 +00:00
Jakob Ivarsson
6255a7f3a0 Avoid negative timestamp in SourceTracker.
Bug: b/364184684
Change-Id: If03cd697fed05c24549b9ef80bbaf9f11b47d8bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361640
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42959}
2024-09-05 10:43:37 +00:00
Jakob Ivarsson
010c189f76 Move thread handling from source tracker.
This makes it simpler to use in more contexts.

Bug: b/364184684
Change-Id: I1b08ebd24e51ba1b3f85261eed503a78cd006fd8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361480
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42956}
2024-09-05 08:45:11 +00:00
Danil Chapovalov
af8f6264ca Use Environment instead of Clock in ModuleRtpRtcp2 and its RTP subcomponents
Bug: webrtc:362762208
Change-Id: Ie9bbb7f3b505acd8aab1b8552ba64e09a5a1bddf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361481
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42949}
2024-09-04 20:39:39 +00:00
Fanny Linderborg
dac0805955 Add FrameInstrumentationData to RTPVideoHeader and CodecSpecificInfo
Bug: webrtc:358039777
Change-Id: If2659240047e1935f7666266bff25ed86a6a234c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361420
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42940}
2024-09-04 07:21:02 +00:00
Danil Chapovalov
fb7c3065b2 Run include cleaner on subset of modules/rtp_rtcp
Bug: webrtc:362762208, webrtc:42226242
Change-Id: Iaa28c21346380c634ef983b02b370c1523e4ef36
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361300
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42930}
2024-09-03 12:08:19 +00:00
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Danil Chapovalov
164b3b3fce Introduce ModuleRtpRtcpImpl factory that accepts Environment
ModuleRtpRtcpImpl and ModuleRtpRtcpImpl2 share certain components, RtcpReceiver in particular.
To always have Environment in RtcpReceiver both legacy and new module need to propagate it.

No-Iwyu: suggests too many changes, better address them separately.
Bug: webrtc:362762208
Change-Id: I2c885f57e24f135229fb7cd9781126d663017b3d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361142
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42908}
2024-09-02 10:24:12 +00:00
Danil Chapovalov
d385af56c3 Introduce ModuleRtpRtcpImpl2 constructor that accepts Environment
And checks similar fields in Configuration struct are not set.
Migrate rtp_rtcp to use new constructor.

Bug: webrtc:362762208
Change-Id: I2385439c169a7432d174c72ca57ecb0ca639d864
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361100
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42896}
2024-08-30 12:05:27 +00:00
Fanny Linderborg
2f91bdceee Declare corruption detection URI in RtpExtension
R=sprang@webrtc.org

Bug: webrtc:358039777
Change-Id: I9c66794b8a622bef5505f3a4a7252a0e7a989813
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360760
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42887}
2024-08-29 19:41:16 +00:00
Erik Språng
c1a0d233d0 Update explainer text for corruption detection header extension.
Bug: webrtc:358039777
Change-Id: I6a1cffc2a5797d154bfecb50c60b4c05d4943426
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360661
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42862}
2024-08-27 08:34:31 +00:00
Fanny Linderborg
fd6f4b4e51 Add the corruption detection extension to RTPExtensionType
Bug: webrtc:358039777
Change-Id: Ib825593e5c37beb0cba3190c1d3bdcf1c9d957cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360144
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42861}
2024-08-27 08:27:20 +00:00
Danil Chapovalov
c54c85fe8f Attach Mid/Rid RTP header extension to pure padding packets
same as they attached to other packets.
Otherwise there is risk that ssrc will be acked after few initial pure padding packets are sent, before remote endpoint seen any mid or rid attached.

Bug: b/361257385
Change-Id: I695b379221debe2518ad33d13d65620877f0b2a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360660
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42851}
2024-08-26 16:00:16 +00:00
Fanny Linderborg
c03edf6096 Add missing includes and remove unused includes
Unused includes in header files are not removed.

Bug: webrtc:358039777
Change-Id: I4586971cd33ff76cac2f869bcdfb063c31e9a7a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360160
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42826}
2024-08-22 08:53:12 +00:00
Philipp Hancke
13b327b05f srtp: demonstrate wraparound with loss decryption failure
by encryption a packet with sequence number 65535 followed
by a packet with sequence number 1. The second packet is encrypted
with a SRTP ROC of 1 as described in
  https://datatracker.ietf.org/doc/html/rfc3711#section-3.3.1

The packets are (received and) decrypted in a different order,
the packet with sequence number 1 (and ROC=1) is decrypted first.
Since the ROC is maintained locally the decrypting session assumes
it to be 0.

Why is that a problem? The RFC recommends estimating the ROC with +-1 which, as demonstrated by the test, libSRTP does not.
But this is a rare problem that requires a random in a high range combined with packet loss/reordering which turns into no-a-problem if you choose carefully as done by packet_sequencer.cc which restricts the initial sequence number in the range 0..32767 which means you do not run into this issue in production.

See also Q6 in libsrtp's historical documentation at
  https://srtp.sourceforge.net/historical/faq.html

BUG=webrtc:353565743

Change-Id: I9bd72b198c946937aeb25c229005a0c682447f53
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358360
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42798}
2024-08-19 05:17:18 +00:00
Fanny Linderborg
aa9e557c81 Add header extension reader/writer for automatic corruption detection
R=sprang@webrtc.org

Bug: b/358039777
Change-Id: I84f447edf0524d4ac6c55cfd96cffe6abb77aaa9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359760
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42791}
2024-08-16 14:14:58 +00:00
Philipp Hancke
952c19511f Document when the dependency descriptor can be negotiated but not sent
This can happen when VP8 simulcast is negotiated while two-byte header
extensions are not negotiated via extmap-allow-mixed. For VP8 the
DD extension would be 23 bytes long which exceeds the maximum size
of 15 bytes for a one-byte header extension.

To test, revert
  f04b52b4a7
and test using VP8.

Note that this works for VP9, AV1, H264 out of the box.

BUG=webrtc:40191093

Change-Id: I2f5d04d8b58b71d32547b06fab6b9a9006df9f1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359623
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42786}
2024-08-15 16:38:54 +00:00
Xinyu Ma
675986ec5f Pass Environment into UlpfecGenerator
To make it available for FEC to use field trials in follow ups

Bug: webrtc:355577231
Change-Id: I4a6260a38e50a70dae27db28401b08bf0160aaec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358680
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42740}
2024-08-07 12:39:20 +00:00
Xinyu Ma
075349f039 Pass Environment into FlexfecSender
To make it available for FEC to use field trials in follow ups

Bug: webrtc:355577231
Change-Id: Ie0b7761915696e6ee7453df3d0531b0f7ad30ee1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358240
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42732}
2024-08-06 17:10:12 +00:00
Florent Castelli
916bf2f260 Remove usage of old copy of rtp_packet_sender.h
Bug: chromium:345101934
Change-Id: I9123dbd39f5d1e34dd1874b840ab6f34f34849a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357863
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42725}
2024-08-05 13:09:18 +00:00
Florent Castelli
5b9d4adfc8 Move rtp_packet_sender.h to api/
Old copy of the header and some previous usage is kept around
for compatibility with downstream projects for now.

Bug: chromium:345101934
Change-Id: Icbe42fb8450d3a4115799438d209da4eda127bab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357441
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42681}
2024-07-29 11:40:45 +00:00
Philipp Hancke
3753c8190e h264: fix first_packet_in_frame logic for multislice in a single rtp packet
a frame must be (or should be) first when it contains either SPS (but not just PPS),
is an IDR or is a slice with first_mb_in_slice == 0.

Fixes an edge case where a STAP-A with SPS, PPS and multiple slices of an IDR fit
into a single RTP packet which can happen with small 320x196 frames

BUG=webrtc:352379280,webrtc:346608838

Change-Id: Ic6dea6c81db759d0d7ddd4054407103fd791f6c5
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357121
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42652}
2024-07-19 08:49:24 +00:00