diff --git a/talk/app/webrtc/webrtcsession_unittest.cc b/talk/app/webrtc/webrtcsession_unittest.cc index 582bdc6356..71d68edbf4 100644 --- a/talk/app/webrtc/webrtcsession_unittest.cc +++ b/talk/app/webrtc/webrtcsession_unittest.cc @@ -623,8 +623,7 @@ class WebRtcSessionTest video_channel_ = media_engine_->GetVideoChannel(0); ASSERT_TRUE(video_channel_ != NULL); - cricket::VideoOptions video_options; - EXPECT_TRUE(video_channel_->GetOptions(&video_options)); + const cricket::VideoOptions& video_options = video_channel_->options(); EXPECT_EQ(value_expected, video_options.unsignalled_recv_stream_limit.GetWithDefaultIfUnset(-1)); } @@ -3726,10 +3725,8 @@ TEST_F(WebRtcSessionTest, TestDscpConstraint) { ASSERT_TRUE(video_channel_ != NULL); ASSERT_TRUE(voice_channel_ != NULL); - cricket::AudioOptions audio_options; - EXPECT_TRUE(voice_channel_->GetOptions(&audio_options)); - cricket::VideoOptions video_options; - EXPECT_TRUE(video_channel_->GetOptions(&video_options)); + const cricket::AudioOptions& audio_options = voice_channel_->options(); + const cricket::VideoOptions& video_options = video_channel_->options(); EXPECT_TRUE(audio_options.dscp.IsSet()); EXPECT_TRUE(audio_options.dscp.GetWithDefaultIfUnset(false)); EXPECT_TRUE(video_options.dscp.IsSet()); @@ -3750,8 +3747,7 @@ TEST_F(WebRtcSessionTest, TestSuspendBelowMinBitrateConstraint) { video_channel_ = media_engine_->GetVideoChannel(0); ASSERT_TRUE(video_channel_ != NULL); - cricket::VideoOptions video_options; - EXPECT_TRUE(video_channel_->GetOptions(&video_options)); + const cricket::VideoOptions& video_options = video_channel_->options(); EXPECT_TRUE( video_options.suspend_below_min_bitrate.GetWithDefaultIfUnset(false)); } @@ -3779,8 +3775,7 @@ TEST_F(WebRtcSessionTest, TestCombinedAudioVideoBweConstraint) { voice_channel_ = media_engine_->GetVoiceChannel(0); ASSERT_TRUE(voice_channel_ != NULL); - cricket::AudioOptions audio_options; - EXPECT_TRUE(voice_channel_->GetOptions(&audio_options)); + const cricket::AudioOptions& audio_options = voice_channel_->options(); EXPECT_TRUE( audio_options.combined_audio_video_bwe.GetWithDefaultIfUnset(false)); } diff --git a/talk/media/base/fakemediaengine.h b/talk/media/base/fakemediaengine.h index de6062b5d4..47ec402f18 100644 --- a/talk/media/base/fakemediaengine.h +++ b/talk/media/base/fakemediaengine.h @@ -410,10 +410,6 @@ class FakeVoiceMediaChannel : public RtpHelper { options_.SetAll(options); return true; } - virtual bool GetOptions(AudioOptions* options) const { - *options = options_; - return true; - } private: struct OutputScaling { @@ -597,10 +593,6 @@ class FakeVideoMediaChannel : public RtpHelper { options_ = options; return true; } - virtual bool GetOptions(VideoOptions* options) const { - *options = options_; - return true; - } virtual void UpdateAspectRatio(int ratio_w, int ratio_h) {} void set_sent_intra_frame(bool v) { sent_intra_frame_ = v; } bool sent_intra_frame() const { return sent_intra_frame_; } @@ -751,9 +743,6 @@ class FakeVoiceEngine : public FakeBaseEngine { bool Init(rtc::Thread* worker_thread) { return true; } void Terminate() {} int GetCapabilities() { return AUDIO_SEND | AUDIO_RECV; } - AudioOptions GetAudioOptions() const { - return options_; - } AudioOptions GetOptions() const { return options_; } @@ -862,10 +851,6 @@ class FakeVideoEngine : public FakeBaseEngine { codecs_.push_back(VideoCodec(0, "fake_video_codec", 0, 0, 0, 0)); } void Init() {} - bool GetOptions(VideoOptions* options) const { - *options = options_; - return true; - } bool SetOptions(const VideoOptions& options) { options_ = options; options_changed_ = true; diff --git a/talk/media/base/mediachannel.h b/talk/media/base/mediachannel.h index 7b88134194..7c76d2bcb4 100644 --- a/talk/media/base/mediachannel.h +++ b/talk/media/base/mediachannel.h @@ -1135,7 +1135,6 @@ class VoiceMediaChannel : public MediaChannel { } // Sets the media options to use. virtual bool SetOptions(const AudioOptions& options) = 0; - virtual bool GetOptions(AudioOptions* options) const = 0; // Signal errors from MediaChannel. Arguments are: // ssrc(uint32), and error(VoiceMediaChannel::Error). @@ -1211,7 +1210,6 @@ class VideoMediaChannel : public MediaChannel { virtual bool RequestIntraFrame() = 0; // Sets the media options to use. virtual bool SetOptions(const VideoOptions& options) = 0; - virtual bool GetOptions(VideoOptions* options) const = 0; virtual void UpdateAspectRatio(int ratio_w, int ratio_h) = 0; // Signal errors from MediaChannel. Arguments are: diff --git a/talk/media/sctp/sctpdataengine.h b/talk/media/sctp/sctpdataengine.h index 20d9ed7792..010175b34e 100644 --- a/talk/media/sctp/sctpdataengine.h +++ b/talk/media/sctp/sctpdataengine.h @@ -171,7 +171,6 @@ class SctpDataMediaChannel : public DataMediaChannel, // TODO(ldixon): add a DataOptions class to mediachannel.h virtual bool SetOptions(int options) { return false; } - virtual int GetOptions() const { return 0; } // Many of these things are unused by SCTP, but are needed to fulfill // the MediaChannel interface. diff --git a/talk/media/webrtc/webrtcvideoengine2.h b/talk/media/webrtc/webrtcvideoengine2.h index c7c8bc0cf5..eabea76a1d 100644 --- a/talk/media/webrtc/webrtcvideoengine2.h +++ b/talk/media/webrtc/webrtcvideoengine2.h @@ -220,10 +220,6 @@ class WebRtcVideoChannel2 : public rtc::MessageHandler, const std::vector& extensions) override; bool SetMaxSendBandwidth(int bps) override; bool SetOptions(const VideoOptions& options) override; - bool GetOptions(VideoOptions* options) const override { - *options = options_; - return true; - } void SetInterface(NetworkInterface* iface) override; void UpdateAspectRatio(int ratio_w, int ratio_h) override; diff --git a/talk/media/webrtc/webrtcvoiceengine.h b/talk/media/webrtc/webrtcvoiceengine.h index 313a371f7a..4b35ba7db2 100644 --- a/talk/media/webrtc/webrtcvoiceengine.h +++ b/talk/media/webrtc/webrtcvoiceengine.h @@ -285,14 +285,11 @@ class WebRtcVoiceMediaChannel : public VoiceMediaChannel, int voe_channel() const { return voe_channel_; } bool valid() const { return voe_channel_ != -1; } + const AudioOptions& options() const { return options_; } bool SetSendParameters(const AudioSendParameters& params) override; bool SetRecvParameters(const AudioRecvParameters& params) override; bool SetOptions(const AudioOptions& options) override; - bool GetOptions(AudioOptions* options) const override { - *options = options_; - return true; - } bool SetRecvCodecs(const std::vector& codecs) override; bool SetSendCodecs(const std::vector& codecs) override; bool SetRecvRtpHeaderExtensions( diff --git a/talk/media/webrtc/webrtcvoiceengine_unittest.cc b/talk/media/webrtc/webrtcvoiceengine_unittest.cc index 601d45fa18..18b318a6ef 100644 --- a/talk/media/webrtc/webrtcvoiceengine_unittest.cc +++ b/talk/media/webrtc/webrtcvoiceengine_unittest.cc @@ -2992,10 +2992,12 @@ TEST_F(WebRtcVoiceEngineTestFake, InitDoesNotOverwriteDefaultAgcConfig) { TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) { EXPECT_TRUE(SetupEngine()); - rtc::scoped_ptr channel1( - engine_.CreateChannel(cricket::AudioOptions())); - rtc::scoped_ptr channel2( - engine_.CreateChannel(cricket::AudioOptions())); + rtc::scoped_ptr channel1( + static_cast( + engine_.CreateChannel(cricket::AudioOptions()))); + rtc::scoped_ptr channel2( + static_cast( + engine_.CreateChannel(cricket::AudioOptions()))); // Have to add a stream to make SetSend work. cricket::StreamParams stream1; @@ -3013,12 +3015,9 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) { ASSERT_TRUE(channel1->SetOptions(options_all)); cricket::AudioOptions expected_options = options_all; - cricket::AudioOptions actual_options; - ASSERT_TRUE(channel1->GetOptions(&actual_options)); - EXPECT_EQ(expected_options, actual_options); + EXPECT_EQ(expected_options, channel1->options()); ASSERT_TRUE(channel2->SetOptions(options_all)); - ASSERT_TRUE(channel2->GetOptions(&actual_options)); - EXPECT_EQ(expected_options, actual_options); + EXPECT_EQ(expected_options, channel2->options()); // unset NS cricket::AudioOptions options_no_ns; @@ -3028,8 +3027,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) { expected_options.echo_cancellation.Set(true); expected_options.auto_gain_control.Set(true); expected_options.noise_suppression.Set(false); - ASSERT_TRUE(channel1->GetOptions(&actual_options)); - EXPECT_EQ(expected_options, actual_options); + EXPECT_EQ(expected_options, channel1->options()); // unset AGC cricket::AudioOptions options_no_agc; @@ -3039,8 +3037,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) { expected_options.echo_cancellation.Set(true); expected_options.auto_gain_control.Set(false); expected_options.noise_suppression.Set(true); - ASSERT_TRUE(channel2->GetOptions(&actual_options)); - EXPECT_EQ(expected_options, actual_options); + EXPECT_EQ(expected_options, channel2->options()); ASSERT_TRUE(engine_.SetOptions(options_all)); bool ec_enabled; @@ -3099,8 +3096,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) { expected_options.echo_cancellation.Set(true); expected_options.auto_gain_control.Set(false); expected_options.noise_suppression.Set(false); - ASSERT_TRUE(channel2->GetOptions(&actual_options)); - EXPECT_EQ(expected_options, actual_options); + EXPECT_EQ(expected_options, channel2->options()); voe_.GetEcStatus(ec_enabled, ec_mode); voe_.GetAgcStatus(agc_enabled, agc_mode); voe_.GetNsStatus(ns_enabled, ns_mode); diff --git a/talk/session/media/channel_unittest.cc b/talk/session/media/channel_unittest.cc index 6d56792eb0..fa182c362b 100644 --- a/talk/session/media/channel_unittest.cc +++ b/talk/session/media/channel_unittest.cc @@ -1848,18 +1848,13 @@ class VoiceChannelTest channel1_->SetChannelOptions(options1); channel2_->SetChannelOptions(options1); - cricket::AudioOptions actual_options; - ASSERT_TRUE(media_channel1_->GetOptions(&actual_options)); - EXPECT_EQ(options1, actual_options); - ASSERT_TRUE(media_channel2_->GetOptions(&actual_options)); - EXPECT_EQ(options1, actual_options); + EXPECT_EQ(options1, media_channel1_->options()); + EXPECT_EQ(options1, media_channel2_->options()); channel1_->SetChannelOptions(options2); channel2_->SetChannelOptions(options2); - ASSERT_TRUE(media_channel1_->GetOptions(&actual_options)); - EXPECT_EQ(options2, actual_options); - ASSERT_TRUE(media_channel2_->GetOptions(&actual_options)); - EXPECT_EQ(options2, actual_options); + EXPECT_EQ(options2, media_channel1_->options()); + EXPECT_EQ(options2, media_channel2_->options()); } }; @@ -1931,23 +1926,19 @@ class VideoChannelTest void TestSetChannelOptions() { CreateChannels(0, 0); - cricket::VideoOptions o1, o2; + cricket::VideoOptions o1; o1.video_noise_reduction.Set(true); channel1_->SetChannelOptions(o1); channel2_->SetChannelOptions(o1); - EXPECT_TRUE(media_channel1_->GetOptions(&o2)); - EXPECT_EQ(o1, o2); - EXPECT_TRUE(media_channel2_->GetOptions(&o2)); - EXPECT_EQ(o1, o2); + EXPECT_EQ(o1, media_channel1_->options()); + EXPECT_EQ(o1, media_channel2_->options()); o1.video_start_bitrate.Set(123); channel1_->SetChannelOptions(o1); channel2_->SetChannelOptions(o1); - EXPECT_TRUE(media_channel1_->GetOptions(&o2)); - EXPECT_EQ(o1, o2); - EXPECT_TRUE(media_channel2_->GetOptions(&o2)); - EXPECT_EQ(o1, o2); + EXPECT_EQ(o1, media_channel1_->options()); + EXPECT_EQ(o1, media_channel2_->options()); } };