Remove SetAudioDelayOffset() and friends.

BUG=webrtc:4690

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

Cr-Commit-Position: refs/heads/master@{#10047}
This commit is contained in:
solenberg 2015-09-24 03:53:08 -07:00 committed by Commit bot
parent f66a925142
commit 4a3ccad29e
6 changed files with 9 additions and 50 deletions

View File

@ -770,8 +770,7 @@ class FakeBaseEngine {
class FakeVoiceEngine : public FakeBaseEngine {
public:
FakeVoiceEngine()
: output_volume_(-1),
delay_offset_(0) {
: output_volume_(-1) {
// Add a fake audio codec. Note that the name must not be "" as there are
// sanity checks against that.
codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0));
@ -808,11 +807,6 @@ class FakeVoiceEngine : public FakeBaseEngine {
const std::vector<AudioCodec>& codecs() { return codecs_; }
void SetCodecs(const std::vector<AudioCodec> codecs) { codecs_ = codecs; }
bool SetDelayOffset(int offset) {
delay_offset_ = offset;
return true;
}
bool SetDevices(const Device* in_device, const Device* out_device) {
in_device_ = (in_device) ? in_device->name : "";
out_device_ = (out_device) ? out_device->name : "";
@ -839,7 +833,6 @@ class FakeVoiceEngine : public FakeBaseEngine {
std::vector<FakeVoiceMediaChannel*> channels_;
std::vector<AudioCodec> codecs_;
int output_volume_;
int delay_offset_;
std::string in_device_;
std::string out_device_;
AudioOptions options_;
@ -950,7 +943,6 @@ class FakeMediaEngine :
}
AudioOptions audio_options() const { return voice_.options_; }
int audio_delay_offset() const { return voice_.delay_offset_; }
int output_volume() const { return voice_.output_volume_; }
const VideoEncoderConfig& default_video_encoder_config() const {
return video_.default_encoder_config_;

View File

@ -64,9 +64,6 @@ class VideoCapturer;
// proper synchronization between both media types.
class MediaEngineInterface {
public:
// Default value to be used for SetAudioDelayOffset().
static const int kDefaultAudioDelayOffset;
virtual ~MediaEngineInterface() {}
// Initialization
@ -93,9 +90,6 @@ class MediaEngineInterface {
virtual AudioOptions GetAudioOptions() const = 0;
// Sets global audio options. "options" are from AudioOptions, above.
virtual bool SetAudioOptions(const AudioOptions& options) = 0;
// Sets the value used by the echo canceller to offset delay values obtained
// from the OS.
virtual bool SetAudioDelayOffset(int offset) = 0;
// Sets the default (maximum) codec/resolution and encoder option to capture
// and encode video.
virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config)
@ -182,9 +176,6 @@ class CompositeMediaEngine : public MediaEngineInterface {
virtual bool SetAudioOptions(const AudioOptions& options) {
return voice_.SetOptions(options);
}
virtual bool SetAudioDelayOffset(int offset) {
return voice_.SetDelayOffset(offset);
}
virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) {
return video_.SetDefaultEncoderConfig(config);
}
@ -243,7 +234,6 @@ class NullVoiceEngine {
VoiceMediaChannel* CreateChannel(const AudioOptions& options) {
return nullptr;
}
bool SetDelayOffset(int offset) { return true; }
AudioOptions GetOptions() const { return AudioOptions(); }
bool SetOptions(const AudioOptions& options) { return true; }
bool SetDevices(const Device* in_device, const Device* out_device) {

View File

@ -888,16 +888,6 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
return true;
}
bool WebRtcVoiceEngine::SetDelayOffset(int offset) {
voe_wrapper_->processing()->SetDelayOffsetMs(offset);
if (voe_wrapper_->processing()->DelayOffsetMs() != offset) {
LOG_RTCERR1(SetDelayOffsetMs, offset);
return false;
}
return true;
}
struct ResumeEntry {
ResumeEntry(WebRtcVoiceMediaChannel *c, bool p, SendFlags s)
: channel(c),

View File

@ -76,7 +76,6 @@ class WebRtcVoiceEngine
AudioOptions GetOptions() const { return options_; }
bool SetOptions(const AudioOptions& options);
bool SetDelayOffset(int offset);
bool SetDevices(const Device* in_device, const Device* out_device);
bool GetOutputVolume(int* level);
bool SetOutputVolume(int level);

View File

@ -103,7 +103,6 @@ void ChannelManager::Construct(MediaEngineInterface* me,
worker_thread_ = worker_thread;
// Get the default audio options from the media engine.
audio_options_ = media_engine_->GetAudioOptions();
audio_delay_offset_ = kDefaultAudioDelayOffset;
audio_output_volume_ = kNotSetOutputVolume;
local_renderer_ = NULL;
capturing_ = false;
@ -206,10 +205,9 @@ bool ChannelManager::Init() {
return false;
}
if (!SetAudioOptions(audio_options_, audio_delay_offset_)) {
LOG(LS_WARNING) << "Failed to SetAudioOptions with"
<< " options: " << audio_options_.ToString()
<< " delay: " << audio_delay_offset_;
if (!SetAudioOptions(audio_options_)) {
LOG(LS_WARNING) << "Failed to SetAudioOptions with options: "
<< audio_options_.ToString();
}
// If audio_output_volume_ has been set via SetOutputVolume(), set the
@ -429,8 +427,7 @@ void ChannelManager::DestroyDataChannel_w(DataChannel* data_channel) {
delete data_channel;
}
bool ChannelManager::SetAudioOptions(const AudioOptions& options,
int delay_offset) {
bool ChannelManager::SetAudioOptions(const AudioOptions& options) {
// "Get device ids from DeviceManager" - these are the defaults returned.
Device in_dev("", -1);
Device out_dev("", -1);
@ -440,19 +437,18 @@ bool ChannelManager::SetAudioOptions(const AudioOptions& options,
if (initialized_) {
ret = worker_thread_->Invoke<bool>(
Bind(&ChannelManager::SetAudioOptions_w, this,
options, delay_offset, &in_dev, &out_dev));
options, &in_dev, &out_dev));
}
// If all worked well, save the values for use in GetAudioOptions.
if (ret) {
audio_options_ = options;
audio_delay_offset_ = delay_offset;
}
return ret;
}
bool ChannelManager::SetAudioOptions_w(
const AudioOptions& options, int delay_offset,
const AudioOptions& options,
const Device* in_dev, const Device* out_dev) {
ASSERT(worker_thread_ == rtc::Thread::Current());
ASSERT(initialized_);
@ -460,10 +456,6 @@ bool ChannelManager::SetAudioOptions_w(
// Set audio options
bool ret = media_engine_->SetAudioOptions(options);
if (ret) {
ret = media_engine_->SetAudioDelayOffset(delay_offset);
}
// Set the audio devices
if (ret) {
ret = media_engine_->SetSoundDevices(in_dev, out_dev);

View File

@ -45,8 +45,6 @@ class MediaControllerInterface;
}
namespace cricket {
const int kDefaultAudioDelayOffset = 0;
class VoiceChannel;
// ChannelManager allows the MediaEngine to run on a separate thread, and takes
@ -178,8 +176,7 @@ class ChannelManager : public rtc::MessageHandler,
protected:
// Adds non-transient parameters which can only be changed through the
// options store.
bool SetAudioOptions(const AudioOptions& options, int delay_offset);
int audio_delay_offset() const { return audio_delay_offset_; }
bool SetAudioOptions(const AudioOptions& options);
private:
typedef std::vector<VoiceChannel*> VoiceChannels;
@ -212,7 +209,7 @@ class ChannelManager : public rtc::MessageHandler,
bool rtcp,
DataChannelType data_channel_type);
void DestroyDataChannel_w(DataChannel* data_channel);
bool SetAudioOptions_w(const AudioOptions& options, int delay_offset,
bool SetAudioOptions_w(const AudioOptions& options,
const Device* in_dev, const Device* out_dev);
void OnVideoCaptureStateChange(VideoCapturer* capturer,
CaptureState result);
@ -234,7 +231,6 @@ class ChannelManager : public rtc::MessageHandler,
DataChannels data_channels_;
AudioOptions audio_options_;
int audio_delay_offset_;
int audio_output_volume_;
VideoEncoderConfig default_video_encoder_config_;
VideoRenderer* local_renderer_;