Commit graph

10 commits

Author SHA1 Message Date
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
Philipp Hancke
3e3881ae3c Reland "Make frame transformer MimeType pure virtual again"
This is a reland of commit 3ea9fc4cd8

Original change's description:
> Make frame transformer MimeType pure virtual again
>
> after both audio and video have been implemented.
>
> BUG=webrtc:15579
>
> Change-Id: Ib52e8f67292259cbf7497a884672de72f3003282
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326162
> 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@{#41114}

BUG=webrtc:15579

Change-Id: Ia020149cba3045022b539f290565d6c1d0e813ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326880
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41121}
2023-11-09 22:30:33 +00:00
Mirko Bonadei
be23ea4bb9 Revert "Make frame transformer MimeType pure virtual again"
This reverts commit 3ea9fc4cd8.

Reason for revert: Breaks downstream project.

Original change's description:
> Make frame transformer MimeType pure virtual again
>
> after both audio and video have been implemented.
>
> BUG=webrtc:15579
>
> Change-Id: Ib52e8f67292259cbf7497a884672de72f3003282
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326162
> 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@{#41114}

BUG=webrtc:15579
No-Presubmit: true
No-Tree-Checks: true
No-Try: true

Change-Id: I9b4c9753e260aca98d24a40f32ce57d86a181ea2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326525
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41116}
2023-11-09 14:24:53 +00:00
Philipp Hancke
3ea9fc4cd8 Make frame transformer MimeType pure virtual again
after both audio and video have been implemented.

BUG=webrtc:15579

Change-Id: Ib52e8f67292259cbf7497a884672de72f3003282
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326162
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@{#41114}
2023-11-09 12:28:10 +00:00
Tony Herre
392e4714e7 Remove deprecated TransformableAudioFrameInterface::getHeader() method
Fixed: chromium:1456628
Change-Id: I12ea08070578de846f042c64f2808b55de1603a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315960
Auto-Submit: 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@{#40555}
2023-08-15 16:31:02 +00:00
Tony Herre
fc68f1f7d9 Stop using TransformableAudioFrameInterface::GetHeader() within webrtc
Instead switch to specific getters, or methods only defined on specific implementations rather than part of the public API.

Once uses are removed from Chromium, I'll mark GetHeader() deprecated
and eventually remove it.

Bug: chromium:1456628
Change-Id: I19b80489b3a0322c201e24994494cfbb742ee13e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309780
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40344}
2023-06-26 10:07:50 +00:00
Tony Herre
097a4decc2 Make all encodedaudioframes inherit from TransformableAudioFrameI'face
Make outgoing encoded audio frames inherit from the same Audio interface
that incoming frames inherit from, to align them and make it possible to
eg clone frames regardless of their direction.

Also begin removing GetHeader() from the Audio interface, replacing it
with getters for the specific values we actually need to propagate in
the API: sequence number and CSRCs. This makes it much easier to treat
incoming and outgoing frames the same, even if they don't have full
RtpHeaders prepared at the point of the transform.

Bug: chromium:1453226
Change-Id: Ib5b39b30dea8a378b3b26efb1589dfd64741d201
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308141
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#40309}
2023-06-19 18:54:47 +00:00
Palak Agarwal
ee58849235 Make SetRTPTimestamp pure virtual in TransformableAudioFrameInterface
This can be done now as the function SetRTPTimestamp is now overriden
in blink MockTransformableAudioFrame.

Change-Id: I4fa4cb81d0282fea864818f0f2d9a5ed881a5d30
Bug: webrtc:14709
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308361
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#40257}
2023-06-12 13:41:27 +00:00
Palak Agarwal
fc260a1878 Add method SetTimestamp in TransformableAudioFrameInterface
This change will make it possible to let us modify timestamp in
RTCEncodedAudioFrame.

Change-Id: I97e9571c258fd718d6c211014f1476ca46c78097
Bug: webrtc:14709
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307501
Reviewed-by: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#40238}
2023-06-07 15:35:12 +00:00
Tove Petersson
1e2d951762 Add a clone method to the audio frame transformer API.
This will clone an encoded audio frame into a sender frame.

Bug: webrtc:14949
Change-Id: Ie62d9f5ec457541b335bde8f2f6e9b6d24704cf6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294560
Commit-Queue: Tove Petersson <tovep@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39480}
2023-03-06 08:22:25 +00:00