Commit graph

1085 commits

Author SHA1 Message Date
Dan Tan
8b47ea459e Fixed timestamp_offset for RtpSenderEgress during initialization and SetRtpState call
The constructor and SetRtpState calls for ModuleRtpRtcpImpl2 class fail to propagate the RTP timestamp offset of RtpSender class to RtpSenderEgress class. This results in wrong RTP timestamps being propagated in LossNotification messages.

Change-Id: I1d293289a4815de29d9dd15208bb7fd1a682be82
Bug: webrtc:14719
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284824
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Dan Tan <dwtan@google.com>
Cr-Commit-Position: refs/heads/main@{#38768}
2022-11-29 18:18:57 +00:00
Henrik Boström
13730e9742 Rename VideoFrameMetadata tests to RTPVideoHeaderTest.
This is a pure move/rename. The reason for wanting the tests in
RTPVideoHeader is that it is the GetAsMetadata() function that we are
testing and in a future CL we'll also want to test SetFromMetadata().

// Bots green, no need to wait for the remaining ones, just a move
NOTRY=True

Bug: webrtc:14709
Change-Id: Iecb938e79e7e8d55e208baea190eef4c6730158e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285460
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38764}
2022-11-29 16:03:20 +00:00
Henrik Boström
bf2f605e03 Add more information to RTPVideoHeader::GetAsMetadata().
Update GetAsMetadata() to include more of the RTPVideoHeader metadata.
The intent is to be able to both get and set all of these from
JavaScript behind a flag.

Planned follow-up CLs:
1. Also get codecs-specifics, starting with VP8.
2. Test refactoring/rename: Move tests to RTPVideoHeaderTest.
3. Add RTPVideoHeader::SetFromMetadata() covering everything gettable.
4. Chrome plumbing.

Bug: webrtc:14709
Change-Id: I78679b9ff4ca749d50f309a1713e71ceabb826dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285084
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38756}
2022-11-29 12:30:46 +00:00
Henrik Boström
158d5e3078 Add RTPVideoHeader::GetAsMetadata().
In preparation of adding RTPVideoHeader::SetFromMetadata() method, the
VideoFrameMetadata construct-from-RTPVideoHeader is replaced by
RTPVideoHeader::GetAsMetadata(). This serves two purposes:
1. Having "GetAs" and "SetFrom" in the same file reduces the risk of
   these two methods getting out of sync as we expand its usage.
2. This is necessary to avoid a circular dependency that would
   otherwise be introduced by RTPVideoHeader::SetFromMetadata().

Bug: webrtc:14709
Change-Id: I127b3d15f9a8c6af210449a5a50d414c9ba79930
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285080
Reviewed-by: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38735}
2022-11-25 14:40:30 +00:00
Harald Alvestrand
5c4509a604 Add a clone method to the video frame transformer API.
This will clone an encoded video frame into a sender frame,
preserving metadata as much as possible.

Bug: webrtc:14708
Change-Id: I6f68d2ee65ef85c32cc3c142a41346b81ba73533
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284701
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38733}
2022-11-25 11:18:22 +00:00
Tony Herre
893c0e449d Allow Video Sender OnTransformedFrame() before TransformFrame()
Lazily initialize the RTPSenderVideoFrameTransformerDelegate's
encoder_queue_ on either OnTransformedFrame() or TransformFrame(), to
allow apps to write to an encoded insertable stream's writable before
reading from its readable.

Bug: chromium:1393373
Change-Id: I08f11682fa142884b575bb207d7d7044e80bbb9c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284921
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Auto-Submit: Tony Herre <herre@google.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38728}
2022-11-24 18:55:30 +00:00
Mirko Bonadei
9eb1ff3ac0 Revert "video_layer_allocation: clean up unused code"
This reverts commit 05b58ad77e.

Reason for revert: UB because the shift exponent (-2) is negative
(UB happens at this line https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc;l=279;drc=05b58ad77e79efc5b4750f40b5092f945f0fff4d).

Original change's description:
> video_layer_allocation: clean up unused code
>
> remove unused support for more than four spatial layer descriptions
> of temporal layers
>
> BUG=webrtc:12000
>
> Change-Id: I087bcd020897898636bdf9c838abafa8c73c53f3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281320
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38646}

Bug: webrtc:12000, webrtc:14678
Change-Id: Ib94a0dead98aeb84af9b91c0ca6ad0893e8f2874
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283840
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38660}
2022-11-17 09:58:29 +00:00
Philipp Hancke
05b58ad77e video_layer_allocation: clean up unused code
remove unused support for more than four spatial layer descriptions
of temporal layers

BUG=webrtc:12000

Change-Id: I087bcd020897898636bdf9c838abafa8c73c53f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281320
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38646}
2022-11-16 13:07:35 +00:00
Philipp Hancke
1afa161f59 doc: align VLA documentation with code
clarifying that the number of temporal layers is limited to
a single byte and moving the format description from the source
to the document.

drive-by editorial fixes

BUG=webrtc:12000

Change-Id: I33f85e0a81e1dc16ef762171c52a79919080e048
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279940
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38523}
2022-11-01 11:51:32 +00:00
Florent Castelli
a30f8829ff Properly mark RtpRtcp deprecated
The clang pragma have been added to ensure we can still test the code
until usage is gone, and that we can still have the one implementation
compiling without itself tripping on the deprecation errors.

Users of the code will have deprecation warnings or error as intended.

Bug: webrtc:14617
Change-Id: I21dae57c669557d4d218c235c811174a477be080
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281221
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38514}
2022-10-31 18:26:53 +00:00
Henrik Boström
d81992197c [Stats] Update totalPacketSendDelay to only cover time in pacer queue.
This metric was always supposed to be the spec's answer to
googBucketDelay, and is defined as "The total number of seconds that
packets have spent buffered locally before being transmitted onto the
network." But our implementation measured the time between capture and
send, including encode time. This is incorrect and yields a much larger
value than expected.

This CL updated the metric to do what the spec says. Implementation-wise
we measure the time between pushing and popping each packet from the
queue (in modules/pacing/prioritized_packet_queue.cc).

The spec says to increment the delay counter at the same time as we
increment the packet counter in order for the app to be able to do
"delta totalPacketSendDelay / delta packetSent". For this reason,
`total_packet_delay` is added to RtpPacketCounter. (Previously, the
two counters were incremented on different threads and observers.)

Running Google Meet on a good network, I could observe a 2-3 ms average
send delay per packet with this implementation compared to 20-30 ms
with the old implementation. See b/137014977#comment170 for comparison
with googBucketDelay which is a little bit different by design -
totalPacketSendDelay is clearly better than googBucketDelay.

Since none of this depend on the media kind, we can wire up this metric
for audio as well in a follow-up:
https://webrtc-review.googlesource.com/c/src/+/280523

Bug: webrtc:14593
Change-Id: If8fcd82fee74030d0923ee5df2c2aea2264600d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280443
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38480}
2022-10-26 21:29:20 +00:00
Emil Lundmark
1c8103d4db Add FieldTrialsRegistry that verifies looked up field trials
This new class implements the existing FieldTrialsView interface,
extending it with the verification functionality. For now, the
verification will only be performed if the rtc_strict_field_trials GN
arg is set.

Most classes extending FieldTrialsView today have been converted to
extend from FieldTrialsRegistry instead to automatically perform
verification.

Bug: webrtc:14154
Change-Id: I4819724cd66a04507e62fcc2bb1019187b6ba8c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276270
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38453}
2022-10-24 09:12:30 +00:00
Anton Podavalov
ea40563e34 Revise jitter value when payload frequency changes.
Bug: None
Change-Id: I81ec880479b3d19efc24ada62643cdc03292988d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279222
Commit-Queue: Anton Podavalov <tonypo@google.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38445}
2022-10-19 18:32:56 +00:00
Tomas Lundqvist
b50599b7b5 Expose jitter in time in addition to in samples.
RFC 3550 specifies samples to be the unit while https://w3c.github.io/webrtc-stats/#receivedrtpstats-dict* specifies time. This avoids the need to convert to time in code that reads the jitter value from RtpReceiveStats.

Bug: webrtc:13757
Change-Id: I972996971c58b686babd621ff4e0f5790fdf2cb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279281
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Lundqvist <tomasl@google.com>
Cr-Commit-Position: refs/heads/main@{#38419}
2022-10-17 16:27:57 +00:00
Evan Shrubsole
9b643d4a49 Have RTPSenderVideoFrameTransformerDelegate use new TQ for HW encoders
Instead of re-using the sender task queue, a new task queue will
suffice.

Bug: webrtc:14445
Change-Id: Ia7395ace2f0bb66bf9e76e3783b208f2cd0385dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275771
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38332}
2022-10-10 09:57:08 +00:00
Olga Sharonova
2d0ba28e25 Audio stack traces
Bug: webrtc:0
Change-Id: I90ea6301f02c2ebe72711ddbeda0bf000a6873aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276940
Auto-Submit: Olga Sharonova <olka@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38223}
2022-09-27 15:05:51 +00:00
Byoungchan Lee
6c2ac2ea6b Fix math involving enums in C++20
(-Wdeprecated-anon-enum-enum-conversion)
- Replace enum with constexpr if necessary.
- Merge multiple definitions for H.264 NalDefs and FuDefs and apply
  constexpr.

Bug: chromium:1284275
Change-Id: I4a4d95ed6aba258e7c19c3ae6251c8b78caf84ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276561
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#38215}
2022-09-27 06:55:31 +00:00
Alessio Bazzica
56b96ffe6a Surface local_capture_clock_offset from RtpSource
- Propagating `RtpPacketInfo::local_capture_clock_offset`, an
  existing field that is related to the abs-capture-timestamp
  header extension field `estimated_capture_clock_offset`
- Propagated through `SourceTracker::SourceEntry`

Bug: webrtc:10739, b/246753278
Change-Id: I21d9841e4f3a35da5f8d7b31582898309421d524
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275241
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38129}
2022-09-20 12:51:22 +00:00
Alessio Bazzica
a1d035655e RtpPacketInfo: new ctor + deprecated ctors clean-up
New ctor added without optional and media specific fields.

Bug: webrtc:10739, b/246753278
Change-Id: I7e15849aced6ed0a7ada725ea171a15ea1e9bc5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275941
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38124}
2022-09-20 08:58:38 +00:00
Philipp Hancke
03e6cccc28 Revert "rtp sender: don't send BYE on deactivating streams"
This reverts commit a22c2a0c58.

Reason for revert: breaks upstream project

Original change's description:
> rtp sender: don't send BYE on deactivating streams
>
> as this breaks RTCP assumptions about SSRCs being no longer
> active as defined in
>   https://www.rfc-editor.org/rfc/rfc3550#section-6.6
>
> This should not be sent in reaction to temporarily disabling
> a stream via RTCRtpParameters.active as this does not mean that
> the participant is leaving the session as defined in
>   https://www.rfc-editor.org/rfc/rfc3550#section-6.3.7
> and does not indicate end of participation as defined in
>   https://www.rfc-editor.org/rfc/rfc3550#section-6.1
> which stipulates BYE should be the last packet sent from this SSRC.
>
> BUG=webrtc:11082
>
> Change-Id: Ia5144857f85303643146b0759184f0f3f50b66e4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273348
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#38059}

Bug: webrtc:11082
Change-Id: Iaaff0c0d7bb857fe9ce78ebcc716f3c6f1bc5c4a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275640
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38097}
2022-09-16 09:40:18 +00:00
Alessio Bazzica
31996f48f4 RtpSource: remove deprecated ctor, use designated initializers
Bug: webrtc:10739, b/246753278
Change-Id: I215483709e1f415170bc42ea6d523ffad8eb1e76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275561
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38085}
2022-09-15 07:42:27 +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
Philipp Hancke
a22c2a0c58 rtp sender: don't send BYE on deactivating streams
as this breaks RTCP assumptions about SSRCs being no longer
active as defined in
  https://www.rfc-editor.org/rfc/rfc3550#section-6.6

This should not be sent in reaction to temporarily disabling
a stream via RTCRtpParameters.active as this does not mean that
the participant is leaving the session as defined in
  https://www.rfc-editor.org/rfc/rfc3550#section-6.3.7
and does not indicate end of participation as defined in
  https://www.rfc-editor.org/rfc/rfc3550#section-6.1
which stipulates BYE should be the last packet sent from this SSRC.

BUG=webrtc:11082

Change-Id: Ia5144857f85303643146b0759184f0f3f50b66e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273348
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38059}
2022-09-12 10:22:27 +00:00
Mirko Bonadei
e761c3e7f3 Minor fix to RtpPacket::ToString.
Bug: None
Change-Id: I60241a413536b6fa4100a66a2f28b1e8f3d7a268
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274705
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38046}
2022-09-09 12:29:55 +00:00
Erik Språng
5045949490 Add ability to abort retransmissions.
In some upcoming use cases we might wish to flush pending
retransmissions from the pacer queue. In order to not make those packets
forever inaccessible this CL adds a way to clear their "pending" status
from the packet history.

Bug: webrtc:11340
Change-Id: I9aac44125899a7f1e5a5e5be3390ac07b1e661ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274600
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38037}
2022-09-08 16:34:40 +00:00
Jakob Ivarsson
7e7a23fea4 Set default audio level header extension value to 127.
Having the minimum value as the default makes more sense than maximum.

Bug: b/232103634
Change-Id: Ia6a97f7a2a47bb74ed3b3316d95a1c6d00e2c16b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274260
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38021}
2022-09-06 16:20:58 +00:00
Markus Handell
2cfc1af78a Update rtc::Event::Wait call sites to use TimeDelta.
Bug: webrtc:14366
Change-Id: I949c1d26f030696b18153afef977633c9a5bd4cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272003
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37835}
2022-08-19 10:07:28 +00:00
Tommi
b69b81944c Conditionally construct UlpfecReceiver
Bug: none
Change-Id: I986803dcba5d7b6bb6e58e6a51fb38a216c1d03d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271120
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37764}
2022-08-12 11:57:35 +00:00
Danil Chapovalov
e519f38eaa Remove rtc::Location from SendTask test helper
that rtc::Location parameter was used only as extra information for the
RTC_CHECKs directly in the function, thus call stack of the crash should
provide all the information about the caller.

Bug: webrtc:11318
Change-Id: Iec6dd2c5de547f3e1601647a614be7ce57a55734
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270920
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37748}
2022-08-11 12:55:32 +00:00
Tommi
7fbab87b60 Report histograms in dtor of UlpfecReceiver.
The data that's used to report the histograms is owned by UlpfecReceiver
and moving the reporting there, simplifies things as configuration
changes happen in RtpVideoStreamReceiver2 (which currently require all
receive streams to be deleted+reconstructed).

Additional updates:
* Consistently using `Clock` for timestamps. Before there was
  a mix of Clock and rtc::TimeMillis.
* Update code to use Timestamp and TimeDelta.

Bug: none
Change-Id: I89ca28ec7067a49d6b357315ae733b04e7c5a2e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271027
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37729}
2022-08-10 07:51:35 +00:00
Tommi
e488a87753 Remove UlpfecReceiver virtual interface.
There's only one implementation.

Bug: none
Change-Id: I204c23e7f87102909fcf6ee8632ceeed84e901a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271026
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37725}
2022-08-09 18:31:22 +00:00
Philipp Hancke
a204ad210d clean up misc TimeDelta use
follow-up from https://webrtc-review.googlesource.com/c/src/+/262810

* replace Time::Millis(0) and TimeDelta::Millis(0) with ::Zero()
* drop unnecessary webrtc namespace from some TimeDeltas
* make TimeDelta do the unit conversion for stats

BUG=webrtc:13756

Change-Id: Ic60625ae0fc7959a47a6be9f5051851feaf76373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265875
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37664}
2022-08-02 13:52:36 +00:00
Danil Chapovalov
300a230f16 Delete inter arrival jitter rtcp packet as unused
WebRTC doesn't produces such packet and ignores it when receive.

Bug: None
Change-Id: I4af8cb3308cb2422808bdfc420a85fa175085bfb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269181
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37627}
2022-07-27 14:53:05 +00:00
Danil Chapovalov
6e7c2685e3 Allow recursive check for RTC_DCHECK_RUN_ON macro
instead of using Lock/Unlock attributes, use Assert attribute to annotate code is running on certain task queue or thread.

Such check better matches what is checked, in particular allows to
recheck (and thus better document) currently used task queue

Bug: None
Change-Id: I5bc1c397efbc8342cf7915093b578bb015c85651
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269381
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37619}
2022-07-26 09:27:23 +00:00
Byoungchan Lee
e044ec572a Don't print warning for tasks running 1ms earlier than planned.
Bug: webrtc:12889
Change-Id: I33faa986130f2d7ae049466c303ef29b643d97ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268920
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37585}
2022-07-21 11:44:35 +00:00
Danil Chapovalov
be5258e61d Optimize adding many consecutive missing packets to rtcp TransportFeedback
Bug: chromium:1342840
Change-Id: I894157af2ed4f8b9dc97ccb8613cbf18db09f95a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269100
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37583}
2022-07-21 10:15:25 +00:00
Niels Möller
253f36f88e Delete rtp_sender_ check in ModuleRtpRtcpImpl2::SetSendingMediaStatus
Analogous to https://webrtc-review.googlesource.com/c/src/+/267845/

Bug: webrtc:10198
Change-Id: Ib7d5e9b2a456486a419c61e7b2ce36df8960c67a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268762
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37550}
2022-07-18 14:28:31 +00:00
Niels Möller
d78789eee2 Delete old TODOs.
Bug: webrtc:10198
Change-Id: I7ea6ddedd97db17a9fc8caf6434cf72f6cd0d6ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268761
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Auto-Submit: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37544}
2022-07-18 12:09:31 +00:00
Danil Chapovalov
52747f1744 Reland "Fix overflow due to rounding in AbsoluteSendTime::To24Bits"
This reverts commit 791294a647.

Reason for revert: downstream test adjusted

Original change's description:
> Revert "Fix overflow due to rounding in AbsoluteSendTime::To24Bits"
>
> This reverts commit a17651f7d8.
>
> Reason for revert: triggers failure in downstream test
>
> Original change's description:
> > Fix overflow due to rounding in AbsoluteSendTime::To24Bits
> >
> > Actual rounding is not important for this time as long it is consistent
> > during the call: only difference between two absolute send time matter
> > Rounding down avoids producing 1 < 24 when value is close to the wrap around boundary.
> >
> > Bug: None
> > Change-Id: Ibbf5bae21bc37eccdc5d4c130a59796ee5108017
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268001
> > 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@{#37468}
>
> Bug: None
> Change-Id: I90a9c1b174b918b7ede58c3bbdb879b1b67da7b2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268120
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37473}

Bug: None
Change-Id: I99bcc6c6b7c08cd9621bdce336cd5793f78ee657
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268190
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37498}
2022-07-08 16:09:02 +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
Danil Chapovalov
677c1ddde5 Migrate rtp_rtcp to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: I037f964130648caf0bd1de86611f8681d475b078
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268146
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37481}
2022-07-07 12:39:25 +00:00
Danil Chapovalov
791294a647 Revert "Fix overflow due to rounding in AbsoluteSendTime::To24Bits"
This reverts commit a17651f7d8.

Reason for revert: triggers failure in downstream test

Original change's description:
> Fix overflow due to rounding in AbsoluteSendTime::To24Bits
>
> Actual rounding is not important for this time as long it is consistent
> during the call: only difference between two absolute send time matter
> Rounding down avoids producing 1 < 24 when value is close to the wrap around boundary.
>
> Bug: None
> Change-Id: Ibbf5bae21bc37eccdc5d4c130a59796ee5108017
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268001
> 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@{#37468}

Bug: None
Change-Id: I90a9c1b174b918b7ede58c3bbdb879b1b67da7b2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268120
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37473}
2022-07-07 07:19:44 +00:00
Danil Chapovalov
a17651f7d8 Fix overflow due to rounding in AbsoluteSendTime::To24Bits
Actual rounding is not important for this time as long it is consistent
during the call: only difference between two absolute send time matter
Rounding down avoids producing 1 < 24 when value is close to the wrap around boundary.

Bug: None
Change-Id: Ibbf5bae21bc37eccdc5d4c130a59796ee5108017
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268001
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@{#37468}
2022-07-06 16:25:54 +00:00
Niels Möller
cb99ccd244 Update/delete old TODOs
Bug: webrtc:10198
Change-Id: I0341e068d792bc0b143db86e675988f4cd07ff2e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267822
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37454}
2022-07-06 07:49:04 +00:00
Niels Möller
ea8eff3737 Delete rtp_sender_ check in ModuleRtpRtcpImpl::SetSendingMediaStatus
Bug: webrtc:10198
Change-Id: Ic40cd702717665a70f5aac0833963d467ea71dd0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267845
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37452}
2022-07-06 06:07:43 +00:00
Niels Möller
c8152fe4a8 Update/delete old TODOs
Bug: webrtc:10198
Change-Id: I226768c2a6bd97ffcd0638e5bc6a1c286b71815f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267704
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37435}
2022-07-05 09:44:53 +00:00
Niels Möller
fb9fbdf395 Delete unused UlpfecReceiver::ProcessReceivedFec return value
Bug: webrtc:10198
Change-Id: Ibb85f1b9094d09dabe677ccbc11e00f3a3590c50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267705
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37434}
2022-07-05 09:40:53 +00:00
Danil Chapovalov
ed665521e4 in RtpRtcp configuration delete unused remote bitrate estimator
No code sets that configuration field.

Bug: None
Change-Id: Idd611d15ec54b3bd9115eac77d2222b97620d675
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267180
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37382}
2022-06-30 14:07:49 +00:00
Philipp Hancke
fb60796b64 fec: simplify fec generation
since the fec packets are initialized to 0 there is no need
to special-case the first packet since
  A XOR 0
is the identity operator.

BUG=None

Change-Id: I0cb55283ecdca06f8e3a7b5856ec1f9fbbad1ffb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251522
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37378}
2022-06-30 11:53:58 +00:00
Danil Chapovalov
7769dc87d7 Detach legacy RtpRtcp from Module interface
Bug: webrtc:7219
Change-Id: I5faf8f68b043994a86d227926c13b07d0141f382
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267063
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37353}
2022-06-28 11:17:43 +00:00