Insert audio frame transformer between depacketizer and decoder.

The frame transformer is passed from RTPReceiverInterface through the
library to be eventually set in ChannelReceive, where the frame
transformation will occur in the follow-up CL.

Insertable Streams Web API explainer:
https://github.com/alvestrand/webrtc-media-streams/blob/master/explainer.md

Design doc for WebRTC library changes:
http://doc/1eiLkjNUkRy2FssCPLUp6eH08BZuXXoHfbbBP1ZN7EVk

Bug: webrtc:11380
Change-Id: I5af06d1431047ef50d00e304cf95e92a832b4220
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171872
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30956}
This commit is contained in:
Marina Ciocea
2020-04-01 07:46:16 +02:00
committed by Commit Bot
parent 784630f0e6
commit 3e9af7fe05
10 changed files with 126 additions and 24 deletions

View File

@ -22,6 +22,7 @@
#include "api/call/audio_sink.h"
#include "api/call/transport.h"
#include "api/crypto/crypto_options.h"
#include "api/frame_transformer_interface.h"
#include "api/neteq/neteq_factory.h"
#include "api/transport/rtp/rtp_source.h"
#include "call/rtp_packet_sink_interface.h"
@ -137,6 +138,12 @@ class ChannelReceiveInterface : public RtpPacketSinkInterface {
// Used for obtaining RTT for a receive-only channel.
virtual void SetAssociatedSendChannel(
const ChannelSendInterface* channel) = 0;
// Sets a frame transformer between the depacketizer and the decoder, to
// transform the received frames before decoding them.
virtual void SetDepacketizerToDecoderFrameTransformer(
rtc::scoped_refptr<webrtc::FrameTransformerInterface>
frame_transformer) = 0;
};
std::unique_ptr<ChannelReceiveInterface> CreateChannelReceive(
@ -155,7 +162,8 @@ std::unique_ptr<ChannelReceiveInterface> CreateChannelReceive(
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory,
absl::optional<AudioCodecPairId> codec_pair_id,
rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor,
const webrtc::CryptoOptions& crypto_options);
const webrtc::CryptoOptions& crypto_options,
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer);
} // namespace voe
} // namespace webrtc