Commit graph

50 commits

Author SHA1 Message Date
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
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
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
Per K
faf398785b Split ModuleRtpRtcpImpl2::TrySendPacket into three subfunctions.
The purpose of these new methods are to allow creating a RTP packet with
sequence numbers that
can be inspected and is ensured to be sent if SendPacket is invoked.

virtual bool CanSendPacket(const RtpPacketToSend& packet) const = 0;
virtual void AssignSequenceNumber(RtpPacketToSend& packet) = 0;
virtual void SendPacket(std::unique_ptr<RtpPacketToSend> packet,
                        const PacedPacketInfo& pacing_info) = 0;

Bug: webrtc:15368
Change-Id: I671e737575e15328e796aa98761a4d540c5812d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343785
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41951}
2024-03-22 12:37:24 +00:00
Danil Chapovalov
378fb28621 Propagate OnSendPacket even if transport sequence number is not registered
To allow to calculate send delay with that callback

Bug: None
Change-Id: I0fe1ffd42b62c99bd01670e583584511c34277db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319563
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40731}
2023-09-11 13:16:30 +00:00
Danil Chapovalov
06717773a5 Move EncodedImage::playout_delay_ to private section of the class
Remove code where integer -1 as delay is used to represent unset value.

Bug: webrtc:13756
Change-Id: I16a01e12c25a09ce21a971c9edabf47af5936662
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316923
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40592}
2023-08-22 08:24:37 +00:00
Harald Alvestrand
d43af9172b Remove internal overrides using old SendRtp and SendRtcp interfaces.
This CL takes away all usages except for Android code.

Low-Coverage-Reason: Refactoring old code
Bug: webrtc:15410
Change-Id: I66bed6a4a2787b4177a82e599b48623ca67cd235
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315940
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40554}
2023-08-15 13:20:21 +00:00
Danil Chapovalov
630c40d716 Update RtpSenderVideo::SendVideo/SendEncodedImage to take Timestamp/TimeDelta types
Bug: webrtc:13757
Change-Id: I2f21b14ecf003c5cb0c4c92d0c6b9b6f11c35f71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311945
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40450}
2023-07-21 10:36:49 +00:00
Danil Chapovalov
8beb6314ef Pass and process capture time through SendPacketObserver with Timestamp type
Bug: webrtc:13757
Change-Id: Icc9f650590640f402ca9004171bbddaf918c78d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308682
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40339}
2023-06-22 17:16:41 +00:00
Danil Chapovalov
e641a970ef In RtcpReceiver remove redundand way to represent RTCP report blocks
Pass ReportBlockData instead of RTCPReportBlock from RtcpReceiver to RtpRtcp module

Bug: None
Change-Id: Ia042bfc626dda532674e070c593db7a04e76254a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306220
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40167}
2023-05-28 15:24:46 +00:00
Danil Chapovalov
0f1a2c5d97 Change StreamDataCounters to use Timestamp instead of int64_t
Bug: webrtc:13757
Change-Id: I11151682a07a2d95389f81cbd7f47f26ad8e67ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306700
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40155}
2023-05-26 11:35:57 +00:00
Philipp Hancke
5c35d08703 Replace "RTRR" with "RRTR"
which is the correct term used in
  https://www.rfc-editor.org/rfc/rfc3611#section-4.4

BUG=None

Change-Id: Iab5a1de6b69a8495aa9a6f79531053f4f2421c27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306480
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40143}
2023-05-25 12:47:37 +00:00
Danil Chapovalov
8095d02884 Add RtpRtcpInterface::LastRtt function to replace RtpRtcpInterface::RTT
RtpRtcpInterface::RTT follows discouraged style of using return values,
uses raw integers to represent time delta,
and returns values that no code uses (min, max, average RTT)

added LastRtt function addresses all these stylistic issues.

Bug: webrtc:13757
Change-Id: Iaf947dd1b7139026f2beb991e69634c606c6b608
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304520
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40028}
2023-05-09 14:54:50 +00:00
Markus Handell
cb838e2c4e Move packets into RtpRtcpInterface and RtpSenderEgress.
This CL prepares for send packet batching support in later CLs.

Bug: chromium:1439830
Change-Id: I0bbecfa895aa6d4317ef8049b3789272a440d032
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304282
Auto-Submit: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40009}
2023-05-08 12:39:54 +00:00
Stefan Holmer
f5bbb2940e Compensate encoder bitrate for transformer added payload.
Bug: webrtc:15092
Change-Id: I7b4eff6f3f32ba0ae33ba8e4fc3c40425868719c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301500
Reviewed-by: Tony Herre <herre@google.com>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39967}
2023-04-28 12:41:55 +00:00
Danil Chapovalov
9ecc76e15b Use Timestamp type in RtpState struct
Bug: webrtc:13757
Change-Id: I7f8fc1a9c4cbf464b3969c4754ce5aa9c5b5f076
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303500
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39960}
2023-04-27 11:24:38 +00:00
Harald Alvestrand
1f206b841e Use ArrayView in the IncomingRtcpPacket function.
The lowest level and some of the highest levels of this function are
already using ArrayView. Make this consistent throughout.
Use deprecation for the old API rather than deleting it, since upstream
may be using it.

Bug: webrtc:14870
Change-Id: If5e1a6e9802ecf7e8e3ec27befb5167ca9985517
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291706
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39241}
2023-02-01 12:19:03 +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
Per Kjellander
e0b4cab69c Remove default enabled field trial WebRTC-SendSideBwe-WithOverhead
Bug: webrtc:6762
Change-Id: I520188a13ee5f50c441226574ccb3df54f842835
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285300
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38783}
2022-11-30 20:19:36 +00:00
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
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
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
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
e45cfb45b1 Delete RtcpPacketTypeCounter::first_packet_time_ms as unused
Bug: webrtc:13757
Change-Id: I358ab99c899b9de5f0135d5293101e7abda4aa31
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265682
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37198}
2022-06-13 14:24:07 +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
d0321c5e5a Deduplicate set of the rtp header extension uri constants
Bug: webrtc:7472
Change-Id: Ic0b4f2cc3374ba70a043310b5046d8bf91f0acbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231949
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34990}
2021-09-14 13:38:44 +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
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
d7ec635d82 Add unit tests for rtp state.
This CL is extracted from
https://webrtc-review.googlesource.com/c/src/+/208584

Bug: webrtc:11340, webrtc:12470
Change-Id: I322c271b02bc3577fe8aad57fe97364a76d83f4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227342
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34628}
2021-08-02 17:33:24 +00:00
Danil Chapovalov
623146cfe1 Delete remaining usage of RtpHeaderParser test helper.
Bug: None
Change-Id: Ia4f8c5dc212f25b1a507e13955973ce4aa6a7ddc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225550
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34525}
2021-07-22 10:15:07 +00:00
Markus Handell
eb61b7f620 ModuleRtcRtcpImpl2: remove Module inheritance.
This change achieves an Idle Wakeup savings of 200 Hz.

ModuleRtcRtcpImpl2 had Process() logic only active if TMMBR() is
enabled in RtcpSender, which it never is. Hence the Module
inheritance could be removed. The change removes all known
dependencies of the module inheritance, and any related mentions
of ProcessThread.

Fixed: webrtc:11581
Change-Id: I440942f07187fdb9ac18186dab088633969b340e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222604
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34358}
2021-06-22 14:51:04 +00:00
Markus Handell
049ed447b0 ModuleRtpRtcpImpl2: update test code.
This change prepares for later CLs that partly replaces
logic in the module that depends on the Module system
for logic that depends on task queues.

The change also changes SendTransport::SendRTCP
to schedule packet reception with the simulated time
controller. This fixes the problem that SendRTCP itself
updates the simulated time which makes it hard to
understand the tests.

Finally, GlobalSimulatedTimeController was updated
to support addition of custom SimulatedSequenceRunners
like SendTransport.

Bug: webrtc:11581
Change-Id: I0aa310ad0a10526479ad8c28affc38a413363ffd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222602
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34348}
2021-06-21 23:36:49 +00:00
Erik Språng
e7481a4199 Add an UlpFec test to RtpRtcp unit tests.
Bug: webrtc:11340
Change-Id: I0ef9c07ff1c9a23af5cd1e6c226c1fb15e4758ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219469
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34057}
2021-05-19 15:26:24 +00:00
Erik Språng
f6be1b22d6 Simplify RtpSenderTest.SendFlexfecPackets and move to RtpRtcp-level.
Bug: webrtc:11340
Change-Id: Ic83217994c447e490a6ac9cf04ceafa3dc009af7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219461
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34051}
2021-05-19 10:19:38 +00:00
Erik Språng
726b0e824b Refactor RtpSenderTest.TrafficSmoothingW* tests
Reduce to testing what RTPSender is actually interested in: that
packets are actually forwarded to the pacer.
Partially the old test was verifying TransmissionOffset header extension,
add an explicit test for that at RtpRtcp-level instead.

Bug: webrtc:11340
Change-Id: I62be39e1d9d8c214c3277f4f1326db05b937674a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218845
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34023}
2021-05-17 15:32:15 +00:00
Erik Språng
bd09a46aa1 Move some tests out from rtp_sender_unittest.
Moves OnSendSideDelayUpdated and OnSendPacketUpdated out from
rtp_sender_unittest and into rtp_sender_egress_unittest and
rtp_rtcp_impl2_unittest. The former test now only tests the logic for
updating send-side-delay stats. The latter is now on a proper
RtpRtcp-level and also verifies that frame timestamps makes it to the
egress (as assumed by the first test).

Bug: webrtc:11340
Change-Id: I784042ad91eb66a4d1eebdbbc625f9522528bfb5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218502
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33996}
2021-05-12 14:01:29 +00:00
Erik Språng
12d24113dc Move SendsPacketsWithTransportSequenceNumber to RtpRtcp level.
New tests (transport sequence number plus newly added abs send time) now
test more of production code and less of rtp_sender_unittest.cc test
fixture code.

Bug: webrtc:11340
Change-Id: I8ec0022c3d18467a4144ce984996af1a452760dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216327
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33895}
2021-05-03 12:15:19 +00:00
Erik Språng
696cea0843 Refactor some RtpSender-level tests into RtpRtcp-level tests
This prepares for ability to defer sequence number assignment to after
the pacing stage - a scenario where the RtpRtcp module rather than than
RTPSender class has responsibility for sequence numbering.

Bug: webrtc:11340
Change-Id: Ife88f60258b9b7cfd9dbd3326f02ac34da8f7603
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214967
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33702}
2021-04-13 08:37:14 +00:00
Alessio Bazzica
bc1c93dc6e Add remote-outbound stats for audio streams
Add missing members needed to surface `RTCRemoteOutboundRtpStreamStats`
via `ChannelReceive::GetRTCPStatistics()` - i.e., audio streams.

`GetSenderReportStats()` is added to both `ModuleRtpRtcpImpl` and
`ModuleRtpRtcpImpl2` and used by `ChannelReceive::GetRTCPStatistics()`.

Bug: webrtc:12529
Change-Id: Ia8f5dfe2e4cfc43e3ddd28f2f1149f5c00f9269d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211041
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33452}
2021-03-12 20:39:50 +00:00
Niels Moller
2accc7d6e0 Revert "Add task queue to RtpRtcpInterface::Configuration."
This reverts commit f23e2144e8.

Reason for revert: Need further discussion on appropriate thread/tq requirements.

Original change's description:
> Add task queue to RtpRtcpInterface::Configuration.
>
> Let ModuleRtpRtcpImpl2 use the configured value instead of
> TaskQueueBase::Current().
>
> Intention is to allow construction of RtpRtcpImpl2 on any thread.
> If a task queue is provided (required for periodic rtt updates), the
> destruction of the object must be done on that same task queue.
>
> Also, delete ModuleRtpRtcpImpl2::Create, callers updated to use std::make_unique.
>
> Bug: None
> Change-Id: I412b7b1e1ce24722ffd23d16aa6c48a7214c9bcd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199968
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32949}

TBR=danilchap@webrtc.org,ilnik@webrtc.org,saza@webrtc.org,nisse@webrtc.org,srte@webrtc.org

Change-Id: I7e5007f524a39a6552973ec9744cd04c13162432
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201420
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32953}
2021-01-12 17:47:32 +00:00
Niels Möller
f23e2144e8 Add task queue to RtpRtcpInterface::Configuration.
Let ModuleRtpRtcpImpl2 use the configured value instead of
TaskQueueBase::Current().

Intention is to allow construction of RtpRtcpImpl2 on any thread.
If a task queue is provided (required for periodic rtt updates), the
destruction of the object must be done on that same task queue.

Also, delete ModuleRtpRtcpImpl2::Create, callers updated to use std::make_unique.

Bug: None
Change-Id: I412b7b1e1ce24722ffd23d16aa6c48a7214c9bcd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199968
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32949}
2021-01-12 12:42:58 +00:00
Niels Möller
be810cba19 Delete SetRtcpXrRrtrStatus, make it a construction-time setting
Bug: None
Change-Id: If2c42af6038c2ce1dc4289b949a0a3a279bae1b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195337
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32754}
2020-12-03 10:01:01 +00:00
Niels Möller
af6ea0c3ab Delete internal getter methods from RtpRtcpInterface
Methods deleted: StorePackets, RtcpXrRrtrStatus. They are now private
methods on the two implementations.

Bug: None
Change-Id: If68e8f1e8ba233302e24e0cdb6bf7c1b0c9f330f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194322
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32670}
2020-11-23 11:37:41 +00:00
Niels Möller
23bd8745c1 Remove rtp test dependency on VideoCodec class
Bug: None
Change-Id: I4848b4bd37a6e263c787bba0851cd14c5c7b3052
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181070
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31882}
2020-08-07 12:27:15 +00:00
Danil Chapovalov
31cb3abd36 Do not propage RTPFragmentationHeader into rtp_rtcp
It is not longer needed by the rtp_rtcp module.

Bug: webrtc:6471
Change-Id: I89a4374a50c54a02e9f20a5ce789eac308aaffeb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179523
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31773}
2020-07-21 14:37:08 +00:00
Tomas Gunnarsson
ba0ba71e93 Add 1 sec timer to ModuleRtpRtcpImpl2 instead of frequent polling.
This reduces the number of times we grab a few locks down from
somewhere upwards of around a thousand time a second to a few times.

* Update the RTT value on the worker thread and fire callbacks.
* Trigger NotifyTmmbrUpdated() calls from the worker.
* Update the tests to use a GlobalSimulatedTimeController.

Change-Id: Ib81582494066b9460ae0aa84271f32311f30fbce
Bug: webrtc:11581
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177664
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31602}
2020-07-01 11:24:31 +00:00
Tomas Gunnarsson
096c0b0921 Post stats updates in RtpSenderEgress to the worker.
On the way remove need for lock for
rtp_sequence_number_map_ and timestamp_offset_.

Change-Id: I21a5cbf6208620435a1a16fff68c33c0cb84f51d
Bug: webrtc:11581
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177424
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31581}
2020-06-29 15:35:09 +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
Tommi
3a5742c880 Add thread/sequence checks to ModuleRtpRtcpImpl.
This ended up with needing to fork the current implementation
in order to not break downstream projects that were inheriting
from it. While those get updated, we'll move on with the forked
class.

Bug: webrtc:11581,b/8278269
Change-Id: I05b596cbda71aa5b72894c31a7119d17d4761883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175500
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31334}
2020-05-20 15:45:21 +00:00