Remove SetAudioDelayOffset() and friends.
BUG=webrtc:4690
Review URL: https://codereview.webrtc.org/1364093002
Cr-Commit-Position: refs/heads/master@{#10047}
diff --git a/talk/media/base/fakemediaengine.h b/talk/media/base/fakemediaengine.h
index 49efe0f..5fb65fa 100644
--- a/talk/media/base/fakemediaengine.h
+++ b/talk/media/base/fakemediaengine.h
@@ -770,8 +770,7 @@
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 @@
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 @@
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 @@
}
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_;
diff --git a/talk/media/base/mediaengine.h b/talk/media/base/mediaengine.h
index d739804..8468e07 100644
--- a/talk/media/base/mediaengine.h
+++ b/talk/media/base/mediaengine.h
@@ -64,9 +64,6 @@
// 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 @@
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 @@
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 @@
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) {
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc
index 214059a..5130232 100644
--- a/talk/media/webrtc/webrtcvoiceengine.cc
+++ b/talk/media/webrtc/webrtcvoiceengine.cc
@@ -888,16 +888,6 @@
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),
diff --git a/talk/media/webrtc/webrtcvoiceengine.h b/talk/media/webrtc/webrtcvoiceengine.h
index e8edfb1..2832fb3 100644
--- a/talk/media/webrtc/webrtcvoiceengine.h
+++ b/talk/media/webrtc/webrtcvoiceengine.h
@@ -76,7 +76,6 @@
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);
diff --git a/talk/session/media/channelmanager.cc b/talk/session/media/channelmanager.cc
index 41819b7..1d86241 100644
--- a/talk/session/media/channelmanager.cc
+++ b/talk/session/media/channelmanager.cc
@@ -103,7 +103,6 @@
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 @@
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 @@
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 @@
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 @@
// 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);
diff --git a/talk/session/media/channelmanager.h b/talk/session/media/channelmanager.h
index 8545cdc..e0a0fb2 100644
--- a/talk/session/media/channelmanager.h
+++ b/talk/session/media/channelmanager.h
@@ -45,8 +45,6 @@
}
namespace cricket {
-const int kDefaultAudioDelayOffset = 0;
-
class VoiceChannel;
// ChannelManager allows the MediaEngine to run on a separate thread, and takes
@@ -178,8 +176,7 @@
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 @@
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 @@
DataChannels data_channels_;
AudioOptions audio_options_;
- int audio_delay_offset_;
int audio_output_volume_;
VideoEncoderConfig default_video_encoder_config_;
VideoRenderer* local_renderer_;