Commit graph

17 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
Harald Alvestrand
6431a64f02 Reland "Run IWYU on some files I intend to work on"
This reverts commit fe34363ca0.

Reason for revert: Downstream error fixed.

Original change's description:
> Revert "Run IWYU on some files I intend to work on"
>
> This reverts commit 827da15f14.
>
> Reason for revert: Breaks downstream project
>
> Original change's description:
> > Run IWYU on some files I intend to work on
> >
> > and files that broke when I fixed the first set.
> >
> > Bug: webrtc:42226242
> > Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Auto-Submit: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#42429}
>
> Bug: webrtc:42226242
> Change-Id: I6b18dced08669c6741c6a51768fbb8b9072c6e82
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353580
> 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@{#42430}

Bug: webrtc:42226242
Change-Id: I8ba51da47ea34d6bbf868e5ebc0037c6cffec8ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353660
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42437}
2024-06-05 08:59:49 +00:00
Mirko Bonadei
fe34363ca0 Revert "Run IWYU on some files I intend to work on"
This reverts commit 827da15f14.

Reason for revert: Breaks downstream project

Original change's description:
> Run IWYU on some files I intend to work on
>
> and files that broke when I fixed the first set.
>
> Bug: webrtc:42226242
> Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Auto-Submit: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42429}

Bug: webrtc:42226242
Change-Id: I6b18dced08669c6741c6a51768fbb8b9072c6e82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353580
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@{#42430}
2024-06-04 11:36:06 +00:00
Harald Alvestrand
827da15f14 Run IWYU on some files I intend to work on
and files that broke when I fixed the first set.

Bug: webrtc:42226242
Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42429}
2024-06-04 10:59:05 +00:00
Tony Herre
64437e8cc0 Calculate the audio level of audio packets before encoded transforms
Calculate the RMS audio level of audio packets being sent before
invoking an encoded frame transform, and pass them with the encode frame
object.

Before this, the audio level was calculated at send time by having rms_levels_ look at all audio samples encoded since the last send. This
is fine without a transform, as this is done synchronously after
encoding, but with an async transform which might take arbitrarily long,
we could end up marking older audio packets with newer audio levels, or
not at all.

This also makes things work correctly if external encoded frames are
injected from elsewhere to be sent, and exposes the AudioLevel on the
TransformableFrame interface.

Bug: chromium:337193823, webrtc:42226202
Change-Id: If55d2c1d30dc03408ca9fb0193d791db44428316
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349263
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#42193}
2024-04-29 15:14:25 +00:00
Dor Hen
3e613c2590 Change vector<const T> with const vector<T>
As described in the issue. This won't compile under most compilers,
at least that what godbolt indicated.
So instead, using const vector<T> to prevent the compilation errors. Keep in mind this is a bit more restrictive as it also implies constness on the vector itself and not only its members, meaning we cannot push/pop.


Bug: webrtc:15829
Change-Id: I19c1223f0a3c56082da75b39c2afe152ae43a3a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337960
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41695}
2024-02-08 11:42:40 +00:00
Tony Herre
7aa797244d Propagate sequence number to cloned encoded audio frames
Bug: chromium:1520859
Change-Id: I6ce0304c850158ebfea1cb88bbcc74b09904fac2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336061
Auto-Submit: Tony Herre <herre@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41629}
2024-01-29 14:29:44 +00:00
Tony Herre
9c6874607a Consolidate encoded transform mocks into api/test/
Includes removing the duplicate MockTransformableAudioFrame definition
in test/ in favour of the existing one in api/test/

Bug: webrtc:15802
Change-Id: Ib5f86b8b2095dd4e580cd9ff0038134f8a43cd93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336340
Auto-Submit: Tony Herre <herre@google.com>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41622}
2024-01-26 12:46:34 +00:00
Danil Chapovalov
0f1b9a9589 Replace rtc::TaskQueue* with TaskQueueBase* in audio channel send frame transformer
To remove unneeded dependency on rtc::TaskQueue wrapper

Bug: webrtc:14169
Change-Id: Ib43da5c2a942a8278761db6a99a1632e72ee34fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334920
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41555}
2024-01-18 09:39:55 +00:00
Tony Herre
5f3ac43551 Ensure cloning and then sending audio encoded frames propagates CSRCs
Bug: chromium:1508337
Change-Id: I9f28fc0958d28bc97f9378a46fbec3e45148736f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330260
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41337}
2023-12-07 15:09:01 +00:00
Tony Herre
6e956053b7 Support shortcircuiting encoded transforms
Add a StartShortCircuiting() callback to allow clients which have
configured Encoded Transforms when creating a PeerConnection to have
all frames skip the transform. This offers a zero cost path for streams
which don't need transforms.

This is preferable to uninstalling/not installing the transform to allow
implementing the behaviour in
https://w3c.github.io/webrtc-encoded-transform/#stream-creation -
giving web apps a chance to configure transforms within a short window
(before the next JS event loop run, so usually sub-millisecond) after stream creation, without any untransformed frames passing.

Usage in Chromium: crrev.com/c/5040731

Bug: chromium:1502781
Change-Id: I803477db1df51e80bdedf6c84d2d3695b088de83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327601
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#41184}
2023-11-17 13:03:27 +00:00
Philipp Hancke
d2098933e1 Expose audio mimeType for insertable streams
Split from
  https://webrtc-review.googlesource.com/c/src/+/318283
to reduce CL size. Takes a different and (hopefully) simpler
approach.

BUG=webrtc:15579

Change-Id: I8517ffbeb0f0a76db80e3e367de727fb6976211d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325023
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#41073}
2023-11-03 09:49:12 +00:00
Tony Herre
36500ab634 Move RTPTimestamp offset handling out of encoded transform delegate
Keep the logic managing whether audio RTP timestamps have the random
start offset added or not inside ChannelSend, so that the
ChannelSendFrameTransformerDelegate doesn't need to worry about it.
Crucially, this means that frames moved between senders by encoded
transforms clients will always use the correct offset for the channel
where we actually get sent.

Also rename TS variables throughout both classes to be explicit over
whether the offset has been added or not.

Bug: chromium:1464847
Change-Id: I19955ec4c1cb834161b00dd74622725a070b713a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317900
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40655}
2023-08-29 12:28:41 +00:00
Palak Agarwal
14e5d4ce5e Support sending IncomingFrames in audio
ChannelSendFrameTransformerDelegate::SendFrame() currently only
supports sending frames in a single direction. With this change, we
allow sending received audio frames.

Bug: chromium:1464847
Change-Id: I8113a3278dfce7b2ba709afecc672bc9af9c4a27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316600
Reviewed-by: Tony Herre <herre@google.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40643}
2023-08-28 13:52:20 +00:00
Niels Möller
105711e9ad Move rtc::make_ref_counted to api/
Bug: webrtc:12701
Change-Id: If49095b101c1a1763c2a44a0284c0d670cce953f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265390
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37219}
2022-06-15 09:47:38 +00:00
Tomas Gunnarsson
c1d589146b Replace new rtc::RefCountedObject with rtc::make_ref_counted in a few files
Bug: webrtc:12701
Change-Id: Ie50225374f811424faf20caf4cf454b2fd1c4dc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215930
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33818}
2021-04-23 12:04:39 +00:00
Marina Ciocea
d7197080c0 Add unit tests for audio channel send frame transformer delegate.
Bug: webrtc:11380
Change-Id: I58a3983d3f16be8ed6a95ea2b9ce759bc3b3a7b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174003
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31159}
2020-05-04 16:50:12 +00:00