Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(905)

Unified Diff: pc/test/fakeaudiocapturemodule.cc

Issue 3020493002: Remove AudioDeviceObserver and make ADM not inherit from the Module interface.
Patch Set: linux build error Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pc/test/fakeaudiocapturemodule.cc
diff --git a/pc/test/fakeaudiocapturemodule.cc b/pc/test/fakeaudiocapturemodule.cc
index ffee283023997fe46408f100702e580a8fa795e2..ea734ed93149d987eb8b716d68f69122f74ea040 100644
--- a/pc/test/fakeaudiocapturemodule.cc
+++ b/pc/test/fakeaudiocapturemodule.cc
@@ -21,10 +21,6 @@
// Even simpler buffers would likely just contain audio sample values of 0.
static const int kHighSampleValue = 10000;
-// Same value as src/modules/audio_device/main/source/audio_device_config.h in
-// https://code.google.com/p/webrtc/
-static const int kAdmMaxIdleTimeProcess = 1000;
-
// Constants here are derived by running VoE using a real ADM.
// The constants correspond to 10ms of mono audio at 44kHz.
static const int kTimePerFrameMs = 10;
@@ -40,8 +36,7 @@ enum {
};
FakeAudioCaptureModule::FakeAudioCaptureModule()
- : last_process_time_ms_(0),
- audio_callback_(nullptr),
+ : audio_callback_(nullptr),
recording_(false),
playing_(false),
play_is_initialized_(false),
@@ -72,23 +67,6 @@ int FakeAudioCaptureModule::frames_received() const {
return frames_received_;
}
-int64_t FakeAudioCaptureModule::TimeUntilNextProcess() {
- const int64_t current_time = rtc::TimeMillis();
- if (current_time < last_process_time_ms_) {
- // TODO: wraparound could be handled more gracefully.
- return 0;
- }
- const int64_t elapsed_time = current_time - last_process_time_ms_;
- if (kAdmMaxIdleTimeProcess < elapsed_time) {
- return 0;
- }
- return kAdmMaxIdleTimeProcess - elapsed_time;
-}
-
-void FakeAudioCaptureModule::Process() {
- last_process_time_ms_ = rtc::TimeMillis();
-}
-
int32_t FakeAudioCaptureModule::ActiveAudioLayer(
AudioLayer* /*audio_layer*/) const {
RTC_NOTREACHED();
@@ -100,13 +78,6 @@ webrtc::AudioDeviceModule::ErrorCode FakeAudioCaptureModule::LastError() const {
return webrtc::AudioDeviceModule::kAdmErrNone;
}
-int32_t FakeAudioCaptureModule::RegisterEventObserver(
- webrtc::AudioDeviceObserver* /*event_callback*/) {
- // Only used to report warnings and errors. This fake implementation won't
- // generate any so discard this callback.
- return 0;
-}
-
int32_t FakeAudioCaptureModule::RegisterAudioCallback(
webrtc::AudioTransport* audio_callback) {
rtc::CritScope cs(&crit_callback_);
@@ -505,7 +476,6 @@ bool FakeAudioCaptureModule::Initialize() {
// sent to it. Note that the audio processing pipeline will likely distort the
// original signal.
SetSendBuffer(kHighSampleValue);
- last_process_time_ms_ = rtc::TimeMillis();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698