Remove [Voice|Video]MediaChannel::GetOptions().

BUG=webrtc:4690

Review URL: https://codereview.webrtc.org/1324853003

Cr-Commit-Position: refs/heads/master@{#9904}
This commit is contained in:
solenberg 2015-09-09 01:36:22 -07:00 committed by Commit bot
parent c99ebc1490
commit 66f43392a3
8 changed files with 26 additions and 69 deletions

View File

@ -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));
}

View File

@ -410,10 +410,6 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
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<VideoMediaChannel> {
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;

View File

@ -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:

View File

@ -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.

View File

@ -220,10 +220,6 @@ class WebRtcVideoChannel2 : public rtc::MessageHandler,
const std::vector<RtpHeaderExtension>& 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;

View File

@ -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<AudioCodec>& codecs) override;
bool SetSendCodecs(const std::vector<AudioCodec>& codecs) override;
bool SetRecvRtpHeaderExtensions(

View File

@ -2992,10 +2992,12 @@ TEST_F(WebRtcVoiceEngineTestFake, InitDoesNotOverwriteDefaultAgcConfig) {
TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) {
EXPECT_TRUE(SetupEngine());
rtc::scoped_ptr<cricket::VoiceMediaChannel> channel1(
engine_.CreateChannel(cricket::AudioOptions()));
rtc::scoped_ptr<cricket::VoiceMediaChannel> channel2(
engine_.CreateChannel(cricket::AudioOptions()));
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel1(
static_cast<cricket::WebRtcVoiceMediaChannel*>(
engine_.CreateChannel(cricket::AudioOptions())));
rtc::scoped_ptr<cricket::WebRtcVoiceMediaChannel> channel2(
static_cast<cricket::WebRtcVoiceMediaChannel*>(
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);

View File

@ -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());
}
};