diff --git a/media/base/media_engine.h b/media/base/media_engine.h index dc8579a517..0d10248ed0 100644 --- a/media/base/media_engine.h +++ b/media/base/media_engine.h @@ -98,6 +98,28 @@ class VoiceEngineInterface : public RtpHeaderExtensionQueryInterface { // TODO(solenberg): Remove once VoE API refactoring is done. virtual rtc::scoped_refptr GetAudioState() const = 0; + virtual std::unique_ptr CreateSendChannel( + webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) { + // TODO(hta): Make pure virtual when all downstream has updated + RTC_CHECK_NOTREACHED(); + return nullptr; + } + + virtual std::unique_ptr + CreateReceiveChannel(webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) { + // TODO(hta): Make pure virtual when all downstream has updated + RTC_CHECK_NOTREACHED(); + return nullptr; + } + // MediaChannel creation // Creates a voice media channel. Returns NULL on failure. virtual VoiceMediaChannel* CreateMediaChannel( diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc index c09e1374ea..0dc4b7a8a6 100644 --- a/media/engine/webrtc_voice_engine.cc +++ b/media/engine/webrtc_voice_engine.cc @@ -433,6 +433,28 @@ rtc::scoped_refptr WebRtcVoiceEngine::GetAudioState() return audio_state_; } +std::unique_ptr +WebRtcVoiceEngine::CreateSendChannel( + webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) { + return std::make_unique( + this, config, options, crypto_options, call, codec_pair_id); +} + +std::unique_ptr +WebRtcVoiceEngine::CreateReceiveChannel( + webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) { + return std::make_unique( + this, config, options, crypto_options, call, codec_pair_id); +} + VoiceMediaChannel* WebRtcVoiceEngine::CreateMediaChannel( MediaChannel::Role role, webrtc::Call* call, @@ -444,13 +466,13 @@ VoiceMediaChannel* WebRtcVoiceEngine::CreateMediaChannel( std::unique_ptr send_channel; std::unique_ptr receive_channel; if (role == MediaChannel::Role::kSend || role == MediaChannel::Role::kBoth) { - send_channel = std::make_unique( - this, config, options, crypto_options, call, codec_pair_id); + send_channel = + CreateSendChannel(call, config, options, crypto_options, codec_pair_id); } if (role == MediaChannel::Role::kReceive || role == MediaChannel::Role::kBoth) { - receive_channel = std::make_unique( - this, config, options, crypto_options, call, codec_pair_id); + receive_channel = CreateReceiveChannel(call, config, options, + crypto_options, codec_pair_id); } return new VoiceMediaShimChannel(std::move(send_channel), std::move(receive_channel)); diff --git a/media/engine/webrtc_voice_engine.h b/media/engine/webrtc_voice_engine.h index d7661a61d2..327beed3d0 100644 --- a/media/engine/webrtc_voice_engine.h +++ b/media/engine/webrtc_voice_engine.h @@ -105,8 +105,22 @@ class WebRtcVoiceEngine final : public VoiceEngineInterface { // Does initialization that needs to occur on the worker thread. void Init() override; - rtc::scoped_refptr GetAudioState() const override; + + std::unique_ptr CreateSendChannel( + webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) override; + + std::unique_ptr CreateReceiveChannel( + webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) override; + VoiceMediaChannel* CreateMediaChannel( MediaChannel::Role role, webrtc::Call* call,