Removes Set/GetRecordingChannel() from the ADM
These two unused APIs are removed:
SetRecordingChannel(const ChannelType channel)
RecordingChannel(ChannelType* channel) const
Bug: webrtc:7306
Change-Id: I3289c4b9a5eebb64cc0aa3a1c1144e9c4d6a661d
Reviewed-on: https://webrtc-review.googlesource.com/22681
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20667}
diff --git a/media/engine/adm_helpers.cc b/media/engine/adm_helpers.cc
index 3a1776e..b973ce6 100644
--- a/media/engine/adm_helpers.cc
+++ b/media/engine/adm_helpers.cc
@@ -42,10 +42,7 @@
return;
}
- // Set device and stereo mode.
- if (adm->SetRecordingChannel(AudioDeviceModule::kChannelBoth) != 0) {
- RTC_LOG(LS_ERROR) << "Unable to set recording channel to kChannelBoth.";
- }
+ // Set device to default.
if (adm->SetRecordingDevice(AUDIO_DEVICE_ID) != 0) {
RTC_LOG(LS_ERROR) << "Unable to set recording device.";
return;
diff --git a/media/engine/webrtcvoiceengine_unittest.cc b/media/engine/webrtcvoiceengine_unittest.cc
index e8c9a22..793fc7d 100644
--- a/media/engine/webrtcvoiceengine_unittest.cc
+++ b/media/engine/webrtcvoiceengine_unittest.cc
@@ -90,8 +90,6 @@
.WillOnce(Return(rtc::RefCountReleaseStatus::kDroppedLastRef));
#if !defined(WEBRTC_IOS)
EXPECT_CALL(*adm, Recording()).WillOnce(Return(false));
- EXPECT_CALL(*adm, SetRecordingChannel(webrtc::AudioDeviceModule::
- ChannelType::kChannelBoth)).WillOnce(Return(0));
#if defined(WEBRTC_WIN)
EXPECT_CALL(*adm, SetRecordingDevice(
testing::Matcher<webrtc::AudioDeviceModule::WindowsDeviceType>(
diff --git a/modules/audio_device/audio_device_buffer.cc b/modules/audio_device/audio_device_buffer.cc
index b580c16..158a86a 100644
--- a/modules/audio_device/audio_device_buffer.cc
+++ b/modules/audio_device/audio_device_buffer.cc
@@ -221,22 +221,6 @@
return 0;
}
-int32_t AudioDeviceBuffer::SetRecordingChannel(
- const AudioDeviceModule::ChannelType channel) {
- RTC_LOG(INFO) << "SetRecordingChannel(" << channel << ")";
- RTC_LOG(LS_WARNING) << "Not implemented";
- // Add DCHECK to ensure that user does not try to use this API with a non-
- // default parameter.
- RTC_DCHECK_EQ(channel, AudioDeviceModule::kChannelBoth);
- return -1;
-}
-
-int32_t AudioDeviceBuffer::RecordingChannel(
- AudioDeviceModule::ChannelType& channel) const {
- RTC_LOG(LS_WARNING) << "Not implemented";
- return -1;
-}
-
size_t AudioDeviceBuffer::RecordingChannels() const {
RTC_DCHECK(main_thread_checker_.CalledOnValidThread());
return rec_channels_;
diff --git a/modules/audio_device/audio_device_buffer.h b/modules/audio_device/audio_device_buffer.h
index 8b8e907..38e7996 100644
--- a/modules/audio_device/audio_device_buffer.h
+++ b/modules/audio_device/audio_device_buffer.h
@@ -92,8 +92,6 @@
int32_t SetPlayoutChannels(size_t channels);
size_t RecordingChannels() const;
size_t PlayoutChannels() const;
- int32_t SetRecordingChannel(const AudioDeviceModule::ChannelType channel);
- int32_t RecordingChannel(AudioDeviceModule::ChannelType& channel) const;
virtual int32_t SetRecordedBuffer(const void* audio_buffer,
size_t samples_per_channel);
diff --git a/modules/audio_device/audio_device_data_observer.cc b/modules/audio_device/audio_device_data_observer.cc
index e3b7f24..f37d808 100644
--- a/modules/audio_device/audio_device_data_observer.cc
+++ b/modules/audio_device/audio_device_data_observer.cc
@@ -241,12 +241,6 @@
int32_t StereoRecording(bool* enabled) const override {
return impl_->StereoRecording(enabled);
}
- int32_t SetRecordingChannel(const ChannelType channel) override {
- return impl_->SetRecordingChannel(channel);
- }
- int32_t RecordingChannel(ChannelType* channel) const override {
- return impl_->RecordingChannel(channel);
- }
int32_t PlayoutDelay(uint16_t* delay_ms) const override {
return impl_->PlayoutDelay(delay_ms);
}
diff --git a/modules/audio_device/audio_device_impl.cc b/modules/audio_device/audio_device_impl.cc
index a8321f4..46489da 100644
--- a/modules/audio_device/audio_device_impl.cc
+++ b/modules/audio_device/audio_device_impl.cc
@@ -524,41 +524,6 @@
return 0;
}
-int32_t AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel) {
- if (channel == kChannelBoth) {
- RTC_LOG(INFO) << __FUNCTION__ << "(both)";
- } else if (channel == kChannelLeft) {
- RTC_LOG(INFO) << __FUNCTION__ << "(left)";
- } else {
- RTC_LOG(INFO) << __FUNCTION__ << "(right)";
- }
- CHECKinitialized_();
- bool stereo = false;
- if (audio_device_->StereoRecording(stereo) == -1) {
- RTC_LOG(WARNING) << "recording in stereo is not supported";
- return -1;
- }
- return audio_device_buffer_.SetRecordingChannel(channel);
-}
-
-int32_t AudioDeviceModuleImpl::RecordingChannel(ChannelType* channel) const {
- RTC_LOG(INFO) << __FUNCTION__;
- CHECKinitialized_();
- ChannelType chType;
- if (audio_device_buffer_.RecordingChannel(chType) == -1) {
- return -1;
- }
- *channel = chType;
- if (*channel == kChannelBoth) {
- RTC_LOG(INFO) << "output: both";
- } else if (*channel == kChannelLeft) {
- RTC_LOG(INFO) << "output: left";
- } else {
- RTC_LOG(INFO) << "output: right";
- }
- return 0;
-}
-
int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const {
RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
diff --git a/modules/audio_device/audio_device_impl.h b/modules/audio_device/audio_device_impl.h
index 02daabc..cd4d0cc 100644
--- a/modules/audio_device/audio_device_impl.h
+++ b/modules/audio_device/audio_device_impl.h
@@ -128,8 +128,6 @@
int32_t StereoRecordingIsAvailable(bool* available) const override;
int32_t SetStereoRecording(bool enable) override;
int32_t StereoRecording(bool* enabled) const override;
- int32_t SetRecordingChannel(const ChannelType channel) override;
- int32_t RecordingChannel(ChannelType* channel) const override;
// Delay information and control
int32_t PlayoutDelay(uint16_t* delayMS) const override;
diff --git a/modules/audio_device/include/audio_device.h b/modules/audio_device/include/audio_device.h
index 5720888..52d367a 100644
--- a/modules/audio_device/include/audio_device.h
+++ b/modules/audio_device/include/audio_device.h
@@ -42,6 +42,7 @@
kDefaultDevice = -2
};
+ // TODO(bugs.webrtc.org/7306): deprecated.
enum ChannelType {
kChannelLeft = 0,
kChannelRight = 1,
@@ -141,8 +142,9 @@
virtual int32_t StereoRecordingIsAvailable(bool* available) const = 0;
virtual int32_t SetStereoRecording(bool enable) = 0;
virtual int32_t StereoRecording(bool* enabled) const = 0;
- virtual int32_t SetRecordingChannel(const ChannelType channel) = 0;
- virtual int32_t RecordingChannel(ChannelType* channel) const = 0;
+ // TODO(bugs.webrtc.org/7306): deprecated.
+ virtual int32_t SetRecordingChannel(const ChannelType channel) { return -1; }
+ virtual int32_t RecordingChannel(ChannelType* channel) const { return -1; }
// Playout delay
virtual int32_t PlayoutDelay(uint16_t* delayMS) const = 0;
diff --git a/modules/audio_device/include/fake_audio_device.h b/modules/audio_device/include/fake_audio_device.h
index c49e9fe..74822d5 100644
--- a/modules/audio_device/include/fake_audio_device.h
+++ b/modules/audio_device/include/fake_audio_device.h
@@ -99,8 +99,6 @@
return 0;
}
int32_t StereoRecording(bool* enabled) const override { return 0; }
- int32_t SetRecordingChannel(const ChannelType channel) override { return 0; }
- int32_t RecordingChannel(ChannelType* channel) const override { return 0; }
int32_t PlayoutDelay(uint16_t* delayMS) const override {
*delayMS = 0;
return 0;
diff --git a/modules/audio_device/include/mock_audio_device.h b/modules/audio_device/include/mock_audio_device.h
index a98d2ac..bfc7660 100644
--- a/modules/audio_device/include/mock_audio_device.h
+++ b/modules/audio_device/include/mock_audio_device.h
@@ -83,8 +83,6 @@
MOCK_CONST_METHOD1(StereoRecordingIsAvailable, int32_t(bool* available));
MOCK_METHOD1(SetStereoRecording, int32_t(bool enable));
MOCK_CONST_METHOD1(StereoRecording, int32_t(bool* enabled));
- MOCK_METHOD1(SetRecordingChannel, int32_t(const ChannelType channel));
- MOCK_CONST_METHOD1(RecordingChannel, int32_t(ChannelType* channel));
MOCK_CONST_METHOD1(PlayoutDelay, int32_t(uint16_t* delayMS));
MOCK_METHOD1(SetRecordingSampleRate, int32_t(const uint32_t samplesPerSec));
MOCK_CONST_METHOD1(RecordingSampleRate, int32_t(uint32_t* samplesPerSec));
diff --git a/pc/test/fakeaudiocapturemodule.cc b/pc/test/fakeaudiocapturemodule.cc
index dbbc044..9011376 100644
--- a/pc/test/fakeaudiocapturemodule.cc
+++ b/pc/test/fakeaudiocapturemodule.cc
@@ -388,24 +388,6 @@
return 0;
}
-int32_t FakeAudioCaptureModule::SetRecordingChannel(
- const ChannelType channel) {
- if (channel != AudioDeviceModule::kChannelBoth) {
- // There is no right or left in mono. I.e. kChannelBoth should be used for
- // mono.
- RTC_NOTREACHED();
- return -1;
- }
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::RecordingChannel(ChannelType* channel) const {
- // Stereo recording not supported. However, WebRTC ADM returns kChannelBoth
- // in that case. Do the same here.
- *channel = AudioDeviceModule::kChannelBoth;
- return 0;
-}
-
int32_t FakeAudioCaptureModule::PlayoutDelay(uint16_t* delay_ms) const {
// No delay since audio frames are dropped.
*delay_ms = 0;
diff --git a/pc/test/fakeaudiocapturemodule.h b/pc/test/fakeaudiocapturemodule.h
index aa10efc..9851bc3 100644
--- a/pc/test/fakeaudiocapturemodule.h
+++ b/pc/test/fakeaudiocapturemodule.h
@@ -125,8 +125,6 @@
int32_t StereoRecordingIsAvailable(bool* available) const override;
int32_t SetStereoRecording(bool enable) override;
int32_t StereoRecording(bool* enabled) const override;
- int32_t SetRecordingChannel(const ChannelType channel) override;
- int32_t RecordingChannel(ChannelType* channel) const override;
int32_t PlayoutDelay(uint16_t* delay_ms) const override;