Exposing audio and video engines directly.
The audio and video engine is exposed directly rather via redundant
wrapping functions. This reduces the amount of boiler plate code.
Bug: webrtc:9883
Change-Id: I203a945ee6079397e24a378966a569cd5626ac4a
Reviewed-on: https://webrtc-review.googlesource.com/c/106683
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25673}
diff --git a/media/base/mediaengine.h b/media/base/mediaengine.h
index 1ddb36c..01300d4 100644
--- a/media/base/mediaengine.h
+++ b/media/base/mediaengine.h
@@ -111,37 +111,10 @@
// Initialization
// Starts the engine.
virtual bool Init() = 0;
- // TODO(solenberg): Remove once VoE API refactoring is done.
- virtual rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const = 0;
-
- // MediaChannel creation
- // Creates a voice media channel. Returns NULL on failure.
- virtual VoiceMediaChannel* CreateChannel(
- webrtc::Call* call,
- const MediaConfig& config,
- const AudioOptions& options,
- const webrtc::CryptoOptions& crypto_options) = 0;
- // Creates a video media channel, paired with the specified voice channel.
- // Returns NULL on failure.
- virtual VideoMediaChannel* CreateVideoChannel(
- webrtc::Call* call,
- const MediaConfig& config,
- const VideoOptions& options,
- const webrtc::CryptoOptions& crypto_options) = 0;
-
- virtual const std::vector<AudioCodec>& audio_send_codecs() = 0;
- virtual const std::vector<AudioCodec>& audio_recv_codecs() = 0;
- virtual RtpCapabilities GetAudioCapabilities() = 0;
- virtual std::vector<VideoCodec> video_codecs() = 0;
- virtual RtpCapabilities GetVideoCapabilities() = 0;
-
- // Starts AEC dump using existing file, a maximum file size in bytes can be
- // specified. Logging is stopped just before the size limit is exceeded.
- // If max_size_bytes is set to a value <= 0, no limit will be used.
- virtual bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes) = 0;
-
- // Stops recording AEC dump.
- virtual void StopAecDump() = 0;
+ virtual VoiceEngineInterface& voice() = 0;
+ virtual VideoEngineInterface& video() = 0;
+ virtual const VoiceEngineInterface& voice() const = 0;
+ virtual const VideoEngineInterface& video() const = 0;
};
// CompositeMediaEngine constructs a MediaEngine from separate
@@ -153,34 +126,10 @@
~CompositeMediaEngine() override;
bool Init() override;
- rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const override;
- VoiceMediaChannel* CreateChannel(
- webrtc::Call* call,
- const MediaConfig& config,
- const AudioOptions& options,
- const webrtc::CryptoOptions& crypto_options) override;
-
- VideoMediaChannel* CreateVideoChannel(
- webrtc::Call* call,
- const MediaConfig& config,
- const VideoOptions& options,
- const webrtc::CryptoOptions& crypto_options) override;
-
- const std::vector<AudioCodec>& audio_send_codecs() override;
- const std::vector<AudioCodec>& audio_recv_codecs() override;
- RtpCapabilities GetAudioCapabilities() override;
-
- std::vector<VideoCodec> video_codecs() override;
- RtpCapabilities GetVideoCapabilities() override;
-
- bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes) override;
- void StopAecDump() override;
-
- protected:
- VoiceEngineInterface& voice();
- VideoEngineInterface& video();
- const VoiceEngineInterface& voice() const;
- const VideoEngineInterface& video() const;
+ VoiceEngineInterface& voice() override;
+ VideoEngineInterface& video() override;
+ const VoiceEngineInterface& voice() const override;
+ const VideoEngineInterface& video() const override;
private:
std::unique_ptr<VoiceEngineInterface> voice_engine_;