Commit graph

93 commits

Author SHA1 Message Date
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
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
Per K
61fff586b1 Split out time_util to separate target ntp_time_util
Split out time_util.h and cc from target rtp_rtcp to its own target.
This is to avoid possible circular dependencies and not having all targets using them to depend on the full RtpRcp module.


Bug: webrtc:343076000
Change-Id: I7b3c84456b17f1920f71afdd5a644d27e28caed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352480
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42392}
2024-05-28 13:31:00 +00:00
Philipp Hancke
8602f604e0 Reland "rtp sender: don't send BYE on deactivating streams"
This is a reland of commit a22c2a0c58
after systems depending on this have been fixed.

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: Iad8b503b3101d1e684a4da2d1547b879e77b85dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293861
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40716}
2023-09-07 13:25:25 +00:00
Danil Chapovalov
24e704f148 Cleanup calculating time between RTCP reports
Move that calculation into dedicated function, move comment why it is calculated the way it is into the same function.
Cleanup that comment - remove parts unused by current code, in particular remove description of code that was deleted a while ago
Use more strict types for the calculation to make it clearer.
Replace DCHECK result can't be zero with a clamp to ensure it can't be zero, because with large bitrates it may.

Reland of https://webrtc-review.googlesource.com/c/src/+/315143

Bug: None
Change-Id: I41ce383a2f19d489e4cae0b1bf1f720e0ffdd17a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315460
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40538}
2023-08-10 20:40:15 +00:00
Danil Chapovalov
3b75c39d59 Revert "Cleanup calculating time between RTCP reports"
This reverts commit 762f193ca4.

Reason for revert: breaks downstream test

Original change's description:
> Cleanup calculating time between RTCP reports
>
> Move that calculation into dedicated function, move comment why it is calculated the way it is into the same function.
> Cleanup that comment - remove parts unused by current code, in particular remove description of code that was deleted a while ago
> Use more strict types for the calculation to make it clearer.
> Replace DCHECK result can't be zero with a clamp to ensure it can't be zero, because with large bitrates it may.
>
> Bug: None
> Change-Id: Ie8c6b9720095cd1cc3f9814b9df16700119337c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315143
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40529}

Bug: None
Change-Id: I8c83013523120a84f236e8efa0d122363e7a228b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315381
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40535}
2023-08-10 14:18:52 +00:00
Danil Chapovalov
762f193ca4 Cleanup calculating time between RTCP reports
Move that calculation into dedicated function, move comment why it is calculated the way it is into the same function.
Cleanup that comment - remove parts unused by current code, in particular remove description of code that was deleted a while ago
Use more strict types for the calculation to make it clearer.
Replace DCHECK result can't be zero with a clamp to ensure it can't be zero, because with large bitrates it may.

Bug: None
Change-Id: Ie8c6b9720095cd1cc3f9814b9df16700119337c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315143
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40529}
2023-08-09 09:14:41 +00:00
Harald Alvestrand
34d82df2ba Use ArrayView versions of SendRtp and SendRtcp
This CL adds [[deprecated]] to the old signatures, and uses the new
signatures throughout.

Bug: webrtc:14870
Change-Id: Ic9a8198ac0a2f954e1b2e7d05a55dbe04342f958
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314962
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40517}
2023-08-07 08:28:48 +00:00
Alfred E. Heggestad
e9ae738c7c rtcp_sender: uppercase protocol names (RTCP) in log messages
Bug: None
Change-Id: Ie6683897fca469a15c1aa054eeb1b2d378b22bcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311461
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40405}
2023-07-06 13:34:31 +00:00
Danil Chapovalov
812186d060 Unassign personal TODOs in modules/rtp_rtcp
1st TODO is removed because there are no plans to use RtcpSender for multiple media streams, RtcpTransceiver designed for that instead
2nd TODO is removed because benefits of not producing same report blocks is unclear, while there is risk to break RTT calculation for remote receivers

TODOs in RtcpTransceiver are reassigned to general bug about it instead, in particular to note low priority, same as that issues has.

No-Try: true
Bug: webrtc:10198
Change-Id: Ibcc3691265459c0732019ceba7903e27d57d543a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296360
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@{#39488}
2023-03-06 17:24:50 +00:00
Danil Chapovalov
0f43da2248 Cleanup RtcpReceiver::NTP function
Replace it with GetSenderReportStats that returns result instead of
filling lots of output parameters
On the way replace pair of uint32_t with dedicated NtpTime type

Bug: None
Change-Id: I5b821b8d000d63ebd8cdc1b9897a86429d97b19b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295560
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39431}
2023-03-01 10:44:29 +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
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
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
Ali Tofigh
d14e8894fc Adopt absl::string_view in modules/rtp_rtcp
Bug: webrtc:13579
Change-Id: Ic4e1431bedc69492358cb2e3749b50a941306f44
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262250
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36887}
2022-05-13 15:01:18 +00:00
Danil Chapovalov
017a606836 Avoid sending empty receiver reports with RTCPSender
in reduced size mode, i.e. when rtcp-rsize sdp attribute is negotiated

Bug: webrtc:13833
Change-Id: I55fa5248d3f66dc2240d7a6fbbb399319f1a2e03
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256004
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36246}
2022-03-18 10:45:27 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Artem Titov
913cfa76ec Use backticks not vertical bars to denote variables in comments for /modules/rtp_rtcp
Bug: webrtc:12338
Change-Id: I52eb3b6675c4705e22f51b70799ed6139a3b46bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227164
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34686}
2021-08-09 15:51:03 +00:00
Jonathan Lennox
c219a53c80 Don't try to send REMB or VideoBitrateAllocation when RTCP is off.
Bug: webrtc:12978
Change-Id: I0bd9cb239c9d74695c1408dde985c92b2834ba2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225961
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@nvidia.com>
Cr-Commit-Position: refs/heads/master@{#34610}
2021-07-30 20:28:24 +00:00
Ivo Creusen
8c40d510c8 Make it possible to enable/disable receive-side RTT with a setter.
This will allow us to enable receive-side RTT without having to recreate all AudioReceiveStream objects.

Bug: webrtc:12951
Change-Id: I1227297ec4ebeea9ba15fe2ed904349829b2e669
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225262
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34464}
2021-07-13 14:15:46 +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
3f7b7170cc RTCPSender: remove compatibility ctor & method.
This change removes compatibility APIs in RTCPSender now
that downstream consumers updated.

Bug: webrtc:11581, webrtc:6458
Change-Id: I82d70f1ab6b522b3884480b0b16cbdff9a1490c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222323
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34356}
2021-06-22 13:30:20 +00:00
Markus Handell
885d538cdd ModuleRtpRtcpImpl2: remove RTCP send polling.
This change migrates RTCP send polling happening in
ModuleRtpRtcpImpl2::Process to task queues.

ModuleRtpRtcpImpl2 would previously only cause RTCP sends while being
registered with a ProcessThread. This is now relaxed so that RTCP will
be sent regardless of ProcessThread registration status, and it seems
no tests cared.

Now there's only one piece of polling left in Process.

Bug: webrtc:11581
Change-Id: Ibdcffefccef7363f2089c34a9c7d694d222445c0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222603
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34350}
2021-06-22 07:49:05 +00:00
Markus Handell
c6b9ac782a RTCPSender: migrate to Timestamp.
This change migrates RTCPSender to use webrtc::Timestamp, preparing
for later improvements regarding bugs.webrtc.org/11581.

Fixed: webrtc:12873
Change-Id: I1159701dc373883367d9b2c86823f8fb59904d55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222324
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34346}
2021-06-21 22:26:34 +00:00
Markus Handell
2e3edc1da9 RTCPSender: migrate to own configuration struct.
The class depends on RtcRtcpInterface::Configuration which adds an
unneeded dependency, and inhibits well-manored changes to the
constructor interface.

Fix this so that RTCPSender uses it's own configuration struct which
can be extended in future CLs.

Also add a legacy constructor while downstream dependencies are
updated.

Bug: webrtc:11581
Change-Id: I8d166ab8253b27c08fcbe6aa7c7adde92688b7dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222322
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34343}
2021-06-21 20:23:01 +00:00
Tommi
08be9baaa3 Don't recreate the audio receive stream when updating the local_ssrc.
Bug: webrtc:11993
Change-Id: Ic5d8a8a8b7c12fb1d906e0b3cbdf657fd9e8eafc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222042
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34299}
2021-06-16 10:03:31 +00:00
Paul Hallak
00f6e75671 Use webrtc::Clock to query for the NTP time and to convert timestamps
to NTP.

No-Try because of lack of infra lack of capacity on macs.

No-Try: True
Bug: webrtc:11327
Change-Id: Ie0c9983031a6d37ae54b1d2381c229bee1a89e8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214134
Commit-Queue: Paul Hallak <phallak@google.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34078}
2021-05-21 14:33:00 +00:00
Tomas Gunnarsson
dbcf5d3918 Change return type of SetSendingStatus to be void.
The eventual implementation of changing the status will be async so the
return value isn't that useful and was in fact only being used to log
a warning if an error occured.

This change is to facilitate upcoming changes related to media engine.

Bug: webrtc:11993
Change-Id: Ia7f85a9ea18b2648b511fa356918cf32a201461f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215975
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33825}
2021-04-25 15:27:38 +00:00
Danil Chapovalov
3562318bde Delete unused functions in RtpSender, RtcpSender and RtcpReceiver
These functions are not longer used by the RtpRtcp implementations.

Bug: None
Change-Id: Ibc36433b253b264de4cdcdf380f5ec1df201b17a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207862
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33282}
2021-02-16 14:16:22 +00:00
Danil Chapovalov
ded6636cf4 Cleanup RtcpSender from legacy functionality
Reduce amount of dynamic memory used to generate rtcp message
Remove option to request several types of rtcp message as unused
Deduplicated PacketContainer and PacketSender as constructs to create packets

Bug: None
Change-Id: Ib2e20a72a9bd73a441ae6b72a13e18ab5885f5c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203261
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33068}
2021-01-25 14:20:57 +00:00
Niels Möller
1f2209d28c Delete unneeded and incorrect logic for 32-bit time wrap around
The RTCP next send time has used a 64-bit type since
https://webrtc-codereview.appspot.com/678011 (2012).

Bug: None
Change-Id: Ie570e9b82d71d9d8d56af91478741226d73e090e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198541
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32868}
2020-12-21 11:55:46 +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
de95329daa Delete macros RTC_DISALLOW_ASSIGN and RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
The former was unused, the latter is replaced with the explicit C++11
deletions. The related RTC_DISALLOW_COPY_AND_ASSIGN is left for now,
it is used in a lot more places.

Bug: None
Change-Id: I49503e7f2b9ff43c6285f8695833479bbc18c380
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185500
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32224}
2020-09-29 10:19:20 +00:00
Erik Språng
de5507d31b Updates rtcp::CompoundPacket to contain unique pointers to packets.
Currently test code passes pointer to temporary objects, while
RtcpSender passes raw pointers to objects that are then seen as owned,
and will be manually deleted by a overloaded destructor, which is scary
and fragile.

This CL moves all usage to std::unique_ptr<RtcpPacket> instead, which
may create some heap churn in unit tests but that should be fine.

Bug: webrtc:11925
Change-Id: I981bc7ccd6a74115c5a3de64b8427adbf3f16cc7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183920
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32084}
2020-09-11 14:34:07 +00:00
Markus Handell
f7303e6486 Migrate leftovers in media/ and modules/ to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: Id40a53fcec6cba1cd5af70422291ba46b0a6da8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178905
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31694}
2020-07-10 08:27:45 +00:00
Tomas Gunnarsson
9766b890a8 Remove SetRTCPApplicationSpecificData.
Also removing some related code that appears to be unused.
This is a part of simplifying the RtpRtcpInterface implementation.

Bug: webrtc:11581
Change-Id: I580bfdc1b821d571cb7437d7713a49ee4de2d19a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176568
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31464}
2020-06-08 17:16:43 +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
Markus Handell
31c61c5091 RtcpSender: remove lock recursions.
This change removes lock recursions and adds thread annotations.

Bug: webrtc:11567
Change-Id: Idc872bda693776667f3b9126bd79589d74398b34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175640
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31308}
2020-05-18 14:28:19 +00:00
Ilya Nikolaevskiy
00a1bcb441 Ensure that unset capture timestamp wouldn't cause incorrect SR rtp timestamps
If for some reason capture timestamp is unset, the default value of 0 would be
passed to RtcpSender. This will cause rtp timestamps to grow at double the rate
in Sender Reports because it has time since the last frame capture as a term.

Bug: none
Change-Id: I2fe09dabef6b0957fb504deaa06393dedc4a9e70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162481
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30105}
2019-12-17 12:03:24 +00:00
Per Kjellander
b11c4111f3 Removed unused RTCP methods SendFeedbackPacket and SendNetworkStateEstimate
Bug: webrtc:10742
Change-Id: I179089a7b5ffcfcd93a56c836338872f600599af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157161
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29498}
2019-10-16 09:26:50 +00:00
Erik Språng
6841d25d45 Reland "RtpRtcp modules and below: Make media, RTX and FEC SSRCs const"
This is a reland of 17608dc459

Downstream test now fixed.
As a precaution, also avoid DCHECKS for non-zero SSRC.
First patch set is reland, second makes checks more lenient.

Original change's description:
> RtpRtcp modules and below: Make media, RTX and FEC SSRCs const
>
> Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
> remove them, make the members const, and remove now unnecessary locking.
>
> Bug: webrtc:10774
> Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29475}

Bug: webrtc:10774
Change-Id: I540b49a31a31e98d87f02ae04083d5206e71c1b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157100
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29491}
2019-10-15 14:03:19 +00:00
Erik Språng
e8a6bc3f25 Revert "Reland "RtpRtcp modules and below: Make media, RTX and FEC SSRCs const""
This reverts commit c9348218cf.

Reason for revert: Downstream tests are relying on incorrect behavior which this CL explicitly checks...

Original change's description:
> Reland "RtpRtcp modules and below: Make media, RTX and FEC SSRCs const"
> 
> This is a reland of 17608dc459
> 
> Downstream fixed, relanding.
> 
> Original change's description:
> > RtpRtcp modules and below: Make media, RTX and FEC SSRCs const
> >
> > Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
> > remove them, make the members const, and remove now unnecessary locking.
> >
> > Bug: webrtc:10774
> > Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
> > Commit-Queue: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29475}
> 
> TBR=nisse@webrtc.org
> 
> Bug: webrtc:10774
> Change-Id: I759bed3ff1909857696c6d1b13df595a5e552f03
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157049
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29486}

TBR=nisse@webrtc.org,sprang@webrtc.org

Change-Id: I168fb3738a04dfdbd1581ddd8c3276ede9f72322
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10774
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157080
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29488}
2019-10-15 11:54:33 +00:00
Erik Språng
c9348218cf Reland "RtpRtcp modules and below: Make media, RTX and FEC SSRCs const"
This is a reland of 17608dc459

Downstream fixed, relanding.

Original change's description:
> RtpRtcp modules and below: Make media, RTX and FEC SSRCs const
>
> Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
> remove them, make the members const, and remove now unnecessary locking.
>
> Bug: webrtc:10774
> Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29475}

TBR=nisse@webrtc.org

Bug: webrtc:10774
Change-Id: I759bed3ff1909857696c6d1b13df595a5e552f03
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157049
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29486}
2019-10-15 11:42:05 +00:00
Erik Språng
4ed0b52c12 Revert "RtpRtcp modules and below: Make media, RTX and FEC SSRCs const"
This reverts commit 17608dc459.

Reason for revert: Breaks downstream build

Original change's description:
> RtpRtcp modules and below: Make media, RTX and FEC SSRCs const
> 
> Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
> remove them, make the members const, and remove now unnecessary locking.
> 
> Bug: webrtc:10774
> Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29475}

TBR=nisse@webrtc.org,sprang@webrtc.org

Change-Id: Idc60f26f34dd0456a40c72375ae829e25b28621f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10774
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157046
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29483}
2019-10-15 09:43:21 +00:00
Erik Språng
17608dc459 RtpRtcp modules and below: Make media, RTX and FEC SSRCs const
Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's
remove them, make the members const, and remove now unnecessary locking.

Bug: webrtc:10774
Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29475}
2019-10-15 07:50:59 +00:00
Per Kjellander
16999814e6 Add void::RtcpFeedbackSenderInterface::SendCombinedRtcpPacket
This method sends arbitrary number rtp::RcpPackets into one or more IP packets.
It is implemented both in RtcpTranceiver and in RtpRtcp.

Change-Id: I00424ee2f1730ff98626f768846f4ac1ad864933

BUG: webrtc:10742
Change-Id: I00424ee2f1730ff98626f768846f4ac1ad864933
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156240
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29430}
2019-10-10 12:05:49 +00:00
Per Kjellander
955f8fd047 Add virtual method rtcp::RtcpPacket::SetSenderSsrc
This will allow RtcpPackets to be sent in a more generic way where the
PacketRouter does not have to know about the type.

App::SetSsrc is replaced with SetSenderSsrc

Bug: webrtc:10742
Change-Id: I9fa18d408250f15818dc6898093d9b116603facb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156166
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29420}
2019-10-09 14:01:53 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00