| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/webrtc_audio_device_impl.h" | 5 #include "content/renderer/media/webrtc_audio_device_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/win/windows_version.h" |
| 9 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| 10 #include "content/renderer/render_thread_impl.h" | 11 #include "content/renderer/render_thread_impl.h" |
| 11 #include "media/audio/audio_util.h" | 12 #include "media/audio/audio_util.h" |
| 12 | 13 |
| 13 static const int64 kMillisecondsBetweenProcessCalls = 5000; | 14 static const int64 kMillisecondsBetweenProcessCalls = 5000; |
| 14 static const char kVersion[] = "WebRTC AudioDevice 1.0.0.Chrome"; | 15 static const char kVersion[] = "WebRTC AudioDevice 1.0.0.Chrome"; |
| 15 | 16 |
| 16 static int GetAudioInputHardwareSampleRate() { | 17 static int GetAudioInputHardwareSampleRate() { |
| 17 static double input_sample_rate = 0; | 18 static double input_sample_rate = 0; |
| 18 if (!input_sample_rate) { | 19 if (!input_sample_rate) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 33 input_sample_rate_(0), | 34 input_sample_rate_(0), |
| 34 output_sample_rate_(0), | 35 output_sample_rate_(0), |
| 35 input_delay_ms_(0), | 36 input_delay_ms_(0), |
| 36 output_delay_ms_(0), | 37 output_delay_ms_(0), |
| 37 last_error_(AudioDeviceModule::kAdmErrNone), | 38 last_error_(AudioDeviceModule::kAdmErrNone), |
| 38 last_process_time_(base::TimeTicks::Now()), | 39 last_process_time_(base::TimeTicks::Now()), |
| 39 session_id_(0), | 40 session_id_(0), |
| 40 initialized_(false), | 41 initialized_(false), |
| 41 playing_(false), | 42 playing_(false), |
| 42 recording_(false) { | 43 recording_(false) { |
| 43 VLOG(1) << "WebRtcAudioDeviceImpl::WebRtcAudioDeviceImpl()"; | 44 DVLOG(1) << "WebRtcAudioDeviceImpl::WebRtcAudioDeviceImpl()"; |
| 44 DCHECK(RenderThreadImpl::current()) << | 45 DCHECK(RenderThreadImpl::current()) << |
| 45 "WebRtcAudioDeviceImpl must be constructed on the render thread"; | 46 "WebRtcAudioDeviceImpl must be constructed on the render thread"; |
| 46 } | 47 } |
| 47 | 48 |
| 48 WebRtcAudioDeviceImpl::~WebRtcAudioDeviceImpl() { | 49 WebRtcAudioDeviceImpl::~WebRtcAudioDeviceImpl() { |
| 49 VLOG(1) << "WebRtcAudioDeviceImpl::~WebRtcAudioDeviceImpl()"; | 50 DVLOG(1) << "WebRtcAudioDeviceImpl::~WebRtcAudioDeviceImpl()"; |
| 50 if (playing_) | 51 if (playing_) |
| 51 StopPlayout(); | 52 StopPlayout(); |
| 52 if (recording_) | 53 if (recording_) |
| 53 StopRecording(); | 54 StopRecording(); |
| 54 if (initialized_) | 55 if (initialized_) |
| 55 Terminate(); | 56 Terminate(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 int32_t WebRtcAudioDeviceImpl::AddRef() { | 59 int32_t WebRtcAudioDeviceImpl::AddRef() { |
| 59 return base::subtle::Barrier_AtomicIncrement(&ref_count_, 1); | 60 return base::subtle::Barrier_AtomicIncrement(&ref_count_, 1); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 input_delay_ms_ + output_delay_ms_, | 168 input_delay_ms_ + output_delay_ms_, |
| 168 0, // clock_drift | 169 0, // clock_drift |
| 169 0, // current_mic_level | 170 0, // current_mic_level |
| 170 new_mic_level); // not used | 171 new_mic_level); // not used |
| 171 accumulated_audio_samples += samples_per_10_msec; | 172 accumulated_audio_samples += samples_per_10_msec; |
| 172 audio_byte_buffer += bytes_per_10_msec; | 173 audio_byte_buffer += bytes_per_10_msec; |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 | 176 |
| 176 void WebRtcAudioDeviceImpl::OnDeviceStarted(int device_index) { | 177 void WebRtcAudioDeviceImpl::OnDeviceStarted(int device_index) { |
| 177 VLOG(1) << "OnDeviceStarted (device_index=" << device_index << ")"; | 178 DVLOG(1) << "OnDeviceStarted (device_index=" << device_index << ")"; |
| 178 // -1 is an invalid device index. Do nothing if a valid device has | 179 // -1 is an invalid device index. Do nothing if a valid device has |
| 179 // been started. Otherwise update the |recording_| state to false. | 180 // been started. Otherwise update the |recording_| state to false. |
| 180 if (device_index != -1) | 181 if (device_index != -1) |
| 181 return; | 182 return; |
| 182 | 183 |
| 183 base::AutoLock auto_lock(lock_); | 184 base::AutoLock auto_lock(lock_); |
| 184 if (recording_) | 185 if (recording_) |
| 185 recording_ = false; | 186 recording_ = false; |
| 186 } | 187 } |
| 187 | 188 |
| 188 void WebRtcAudioDeviceImpl::OnDeviceStopped() { | 189 void WebRtcAudioDeviceImpl::OnDeviceStopped() { |
| 189 VLOG(1) << "OnDeviceStopped"; | 190 DVLOG(1) << "OnDeviceStopped"; |
| 190 base::AutoLock auto_lock(lock_); | 191 base::AutoLock auto_lock(lock_); |
| 191 if (recording_) | 192 if (recording_) |
| 192 recording_ = false; | 193 recording_ = false; |
| 193 } | 194 } |
| 194 | 195 |
| 195 int32_t WebRtcAudioDeviceImpl::Version(char* version, | 196 int32_t WebRtcAudioDeviceImpl::Version(char* version, |
| 196 uint32_t& remaining_buffer_in_bytes, | 197 uint32_t& remaining_buffer_in_bytes, |
| 197 uint32_t& position) const { | 198 uint32_t& position) const { |
| 198 VLOG(1) << "Version()"; | 199 DVLOG(1) << "Version()"; |
| 199 DCHECK(version); | 200 DCHECK(version); |
| 200 if (version == NULL) | 201 if (version == NULL) |
| 201 return -1; | 202 return -1; |
| 202 size_t arr_size = arraysize(kVersion); | 203 size_t arr_size = arraysize(kVersion); |
| 203 if (remaining_buffer_in_bytes < arr_size) { | 204 if (remaining_buffer_in_bytes < arr_size) { |
| 204 DLOG(WARNING) << "version string requires " << arr_size << " bytes"; | 205 DLOG(WARNING) << "version string requires " << arr_size << " bytes"; |
| 205 return -1; | 206 return -1; |
| 206 } | 207 } |
| 207 base::strlcpy(&version[position], kVersion, arr_size - 1); | 208 base::strlcpy(&version[position], kVersion, arr_size - 1); |
| 208 remaining_buffer_in_bytes -= arr_size; | 209 remaining_buffer_in_bytes -= arr_size; |
| 209 position += arr_size; | 210 position += arr_size; |
| 210 VLOG(1) << "version: " << version; | 211 DVLOG(1) << "version: " << version; |
| 211 return 0; | 212 return 0; |
| 212 } | 213 } |
| 213 | 214 |
| 214 int32_t WebRtcAudioDeviceImpl::ChangeUniqueId(const int32_t id) { | 215 int32_t WebRtcAudioDeviceImpl::ChangeUniqueId(const int32_t id) { |
| 215 NOTIMPLEMENTED(); | 216 NOTIMPLEMENTED(); |
| 216 return -1; | 217 return -1; |
| 217 } | 218 } |
| 218 | 219 |
| 219 int32_t WebRtcAudioDeviceImpl::TimeUntilNextProcess() { | 220 int32_t WebRtcAudioDeviceImpl::TimeUntilNextProcess() { |
| 220 // Calculate the number of milliseconds until this module wants its | 221 // Calculate the number of milliseconds until this module wants its |
| (...skipping 17 matching lines...) Expand all Loading... |
| 238 NOTIMPLEMENTED(); | 239 NOTIMPLEMENTED(); |
| 239 return -1; | 240 return -1; |
| 240 } | 241 } |
| 241 | 242 |
| 242 webrtc::AudioDeviceModule::ErrorCode WebRtcAudioDeviceImpl::LastError() const { | 243 webrtc::AudioDeviceModule::ErrorCode WebRtcAudioDeviceImpl::LastError() const { |
| 243 return last_error_; | 244 return last_error_; |
| 244 } | 245 } |
| 245 | 246 |
| 246 int32_t WebRtcAudioDeviceImpl::RegisterEventObserver( | 247 int32_t WebRtcAudioDeviceImpl::RegisterEventObserver( |
| 247 webrtc::AudioDeviceObserver* event_callback) { | 248 webrtc::AudioDeviceObserver* event_callback) { |
| 248 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::RegisterEventObserver() " | 249 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::RegisterEventObserver() " |
| 249 << "NOT IMPLEMENTED"; | 250 << "NOT IMPLEMENTED"; |
| 250 return -1; | 251 return -1; |
| 251 } | 252 } |
| 252 | 253 |
| 253 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( | 254 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback( |
| 254 webrtc::AudioTransport* audio_callback) { | 255 webrtc::AudioTransport* audio_callback) { |
| 255 VLOG(1) << "RegisterAudioCallback()"; | 256 DVLOG(1) << "RegisterAudioCallback()"; |
| 256 if (playing_ || recording_) { | 257 if (playing_ || recording_) { |
| 257 LOG(ERROR) << "Unable to (de)register transport during active media"; | 258 LOG(ERROR) << "Unable to (de)register transport during active media"; |
| 258 return -1; | 259 return -1; |
| 259 } | 260 } |
| 260 audio_transport_callback_ = audio_callback; | 261 audio_transport_callback_ = audio_callback; |
| 261 return 0; | 262 return 0; |
| 262 } | 263 } |
| 263 | 264 |
| 264 int32_t WebRtcAudioDeviceImpl::Init() { | 265 int32_t WebRtcAudioDeviceImpl::Init() { |
| 265 VLOG(1) << "Init()"; | 266 DVLOG(1) << "Init()"; |
| 266 | 267 |
| 267 if (!render_loop_->BelongsToCurrentThread()) { | 268 if (!render_loop_->BelongsToCurrentThread()) { |
| 268 int32_t error = 0; | 269 int32_t error = 0; |
| 269 base::WaitableEvent event(false, false); | 270 base::WaitableEvent event(false, false); |
| 270 // Ensure that we call Init() from the main render thread since | 271 // Ensure that we call Init() from the main render thread since |
| 271 // the audio clients can only be created on this thread. | 272 // the audio clients can only be created on this thread. |
| 272 render_loop_->PostTask( | 273 render_loop_->PostTask( |
| 273 FROM_HERE, | 274 FROM_HERE, |
| 274 base::Bind(&WebRtcAudioDeviceImpl::InitOnRenderThread, | 275 base::Bind(&WebRtcAudioDeviceImpl::InitOnRenderThread, |
| 275 this, &error, &event)); | 276 this, &error, &event)); |
| 276 event.Wait(); | 277 event.Wait(); |
| 277 return error; | 278 return error; |
| 278 } | 279 } |
| 279 | 280 |
| 280 // Calling Init() multiple times in a row is OK. | 281 // Calling Init() multiple times in a row is OK. |
| 281 if (initialized_) | 282 if (initialized_) |
| 282 return 0; | 283 return 0; |
| 283 | 284 |
| 284 DCHECK(!audio_input_device_); | 285 DCHECK(!audio_input_device_); |
| 285 DCHECK(!audio_output_device_); | 286 DCHECK(!audio_output_device_); |
| 286 DCHECK(!input_buffer_.get()); | 287 DCHECK(!input_buffer_.get()); |
| 287 DCHECK(!output_buffer_.get()); | 288 DCHECK(!output_buffer_.get()); |
| 288 | 289 |
| 289 // Ask the browser for the default audio output hardware sample-rate. | 290 // Ask the browser for the default audio output hardware sample-rate. |
| 290 // This request is based on a synchronous IPC message. | 291 // This request is based on a synchronous IPC message. |
| 291 int output_sample_rate = | 292 int output_sample_rate = |
| 292 static_cast<int>(AudioDevice::GetAudioHardwareSampleRate()); | 293 static_cast<int>(AudioDevice::GetAudioHardwareSampleRate()); |
| 293 VLOG(1) << "Audio output hardware sample rate: " << output_sample_rate; | 294 DVLOG(1) << "Audio output hardware sample rate: " << output_sample_rate; |
| 294 | 295 |
| 295 // Ask the browser for the default audio input hardware sample-rate. | 296 // Ask the browser for the default audio input hardware sample-rate. |
| 296 // This request is based on a synchronous IPC message. | 297 // This request is based on a synchronous IPC message. |
| 297 int input_sample_rate = GetAudioInputHardwareSampleRate(); | 298 int input_sample_rate = GetAudioInputHardwareSampleRate(); |
| 298 VLOG(1) << "Audio input hardware sample rate: " << input_sample_rate; | 299 DVLOG(1) << "Audio input hardware sample rate: " << input_sample_rate; |
| 299 | 300 |
| 300 int input_channels = 0; | 301 int input_channels = 0; |
| 301 int output_channels = 0; | 302 int output_channels = 0; |
| 302 | 303 |
| 303 size_t input_buffer_size = 0; | 304 size_t input_buffer_size = 0; |
| 304 size_t output_buffer_size = 0; | 305 size_t output_buffer_size = 0; |
| 305 | 306 |
| 306 // For real-time audio (in combination with the webrtc::VoiceEngine) it | 307 // For real-time audio (in combination with the webrtc::VoiceEngine) it |
| 307 // is convenient to use audio buffers of size N*10ms. | 308 // is convenient to use audio buffers of size N*10ms. |
| 308 | 309 |
| 309 #if defined(OS_WIN) | 310 #if defined(OS_WIN) |
| 310 if (output_sample_rate != 48000) { | |
| 311 DLOG(ERROR) << "Only 48kHz sample rate is supported on Windows."; | |
| 312 return -1; | |
| 313 } | |
| 314 | |
| 315 // Use stereo recording on Windows since low-latency Core Audio (WASAPI) | 311 // Use stereo recording on Windows since low-latency Core Audio (WASAPI) |
| 316 // does not support mono. | 312 // does not support mono. |
| 317 input_channels = 2; | 313 input_channels = 2; |
| 318 output_channels = 1; | 314 |
| 315 // Use stereo rendering on Windows to make input and output sides |
| 316 // symmetric. WASAPI supports both stereo and mono. |
| 317 output_channels = 2; |
| 319 | 318 |
| 320 // Capture side: AUDIO_PCM_LOW_LATENCY is based on the Core Audio (WASAPI) | 319 // Capture side: AUDIO_PCM_LOW_LATENCY is based on the Core Audio (WASAPI) |
| 321 // API which was introduced in Windows Vista. For lower Windows versions, | 320 // API which was introduced in Windows Vista. For lower Windows versions, |
| 322 // a callback-driven Wave implementation is used instead. An input buffer | 321 // a callback-driven Wave implementation is used instead. An input buffer |
| 323 // size of 10ms works well for both these implementations. | 322 // size of 10ms works well for both these implementations. |
| 324 | 323 |
| 325 // Use different buffer sizes depending on the current hardware sample rate. | 324 // Use different buffer sizes depending on the current hardware sample rate. |
| 326 if (input_sample_rate == 48000) { | 325 if (input_sample_rate == 48000) { |
| 327 input_buffer_size = 480; | 326 input_buffer_size = 480; |
| 328 } else { | 327 } else { |
| 329 // We do run at 44.1kHz at the actual audio layer, but ask for frames | 328 // We do run at 44.1kHz at the actual audio layer, but ask for frames |
| 330 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine. | 329 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine. |
| 331 input_buffer_size = 440; | 330 input_buffer_size = 440; |
| 332 } | 331 } |
| 333 | 332 |
| 334 // Rendering side: AUDIO_PCM_LOW_LATENCY on Windows is based on a callback- | 333 // Render side: AUDIO_PCM_LOW_LATENCY is based on the Core Audio (WASAPI) |
| 335 // driven Wave implementation where 2 buffers are fed to the audio driver | 334 // API which was introduced in Windows Vista. For lower Windows versions, |
| 336 // before actual rendering starts. Initial real-time tests have shown that | 335 // a callback-driven Wave implementation is used instead. An input buffer |
| 337 // 20ms buffer size (corresponds to ~40ms total delay) is not enough but | 336 // size of 10ms works well for both these implementations. |
| 338 // can lead to buffer underruns. The next even multiple of 10ms is 30ms | 337 |
| 339 // (<=> ~60ms total delay) and it works fine also under high load. | 338 // Use different buffer sizes depending on the current hardware sample rate. |
| 340 output_buffer_size = 3 * 480; | 339 if (output_sample_rate == 48000) { |
| 340 output_buffer_size = 480; |
| 341 } else { |
| 342 // We do run at 44.1kHz at the actual audio layer, but ask for frames |
| 343 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine. |
| 344 output_buffer_size = 440; |
| 345 } |
| 346 |
| 347 // Windows XP and lower can't cope with 10 ms output buffer size. |
| 348 // It must be extended to 30 ms (60 ms will be used internally by WaveOut). |
| 349 if (base::win::GetVersion() <= base::win::VERSION_XP) { |
| 350 output_buffer_size = 3 * output_buffer_size; |
| 351 DLOG(WARNING) << "Extending the output buffer size by a factor of three " |
| 352 << "since Windows XP has been detected."; |
| 353 } |
| 354 |
| 341 #elif defined(OS_MACOSX) | 355 #elif defined(OS_MACOSX) |
| 342 if (output_sample_rate != 48000 && output_sample_rate != 44100) { | 356 if (output_sample_rate != 48000 && output_sample_rate != 44100) { |
| 343 DLOG(ERROR) << "Only 48 and 44.1kHz sample rates are supported on Mac OSX."; | 357 DLOG(ERROR) << "Only 48 and 44.1kHz sample rates are supported on Mac OSX."; |
| 344 return -1; | 358 return -1; |
| 345 } | 359 } |
| 346 input_channels = 1; | 360 input_channels = 1; |
| 347 output_channels = 1; | 361 output_channels = 1; |
| 348 | 362 |
| 349 // Rendering side: AUDIO_PCM_LOW_LATENCY on Mac OS X is based on a callback- | 363 // Capture side: AUDIO_PCM_LOW_LATENCY on Mac OS X is based on a callback- |
| 350 // driven Core Audio implementation. Tests have shown that 10ms is a suitable | 364 // driven Core Audio implementation. Tests have shown that 10ms is a suitable |
| 351 // frame size to use, both for 48kHz and 44.1kHz. | 365 // frame size to use, both for 48kHz and 44.1kHz. |
| 352 // Capturing side: AUDIO_PCM_LINEAR on Mac OS X uses the Audio Queue Services | 366 |
| 353 // API which is not well suited for real-time applications since the delay | 367 // Use different buffer sizes depending on the current hardware sample rate. |
| 354 // is very high. We set buffer sizes to 10ms for the input side here as well | 368 if (input_sample_rate == 48000) { |
| 355 // but none of them will work. | 369 input_buffer_size = 480; |
| 356 // TODO(henrika): add support for AUDIO_PCM_LOW_LATENCY on the capture side | 370 } else { |
| 357 // based on the Mac OS X Core Audio API. | 371 // We do run at 44.1kHz at the actual audio layer, but ask for frames |
| 372 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine. |
| 373 input_buffer_size = 440; |
| 374 } |
| 375 |
| 376 // Render side: AUDIO_PCM_LOW_LATENCY on Mac OS X is based on a callback- |
| 377 // driven Core Audio implementation. Tests have shown that 10ms is a suitable |
| 378 // frame size to use, both for 48kHz and 44.1kHz. |
| 358 | 379 |
| 359 // Use different buffer sizes depending on the current hardware sample rate. | 380 // Use different buffer sizes depending on the current hardware sample rate. |
| 360 if (output_sample_rate == 48000) { | 381 if (output_sample_rate == 48000) { |
| 361 input_buffer_size = 480; | |
| 362 output_buffer_size = 480; | 382 output_buffer_size = 480; |
| 363 } else { | 383 } else { |
| 364 // We do run at 44.1kHz at the actual audio layer, but ask for frames | 384 // We do run at 44.1kHz at the actual audio layer, but ask for frames |
| 365 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine. | 385 // at 44.0kHz to ensure that we can feed them to the webrtc::VoiceEngine. |
| 366 input_buffer_size = 440; | |
| 367 output_buffer_size = 440; | 386 output_buffer_size = 440; |
| 368 } | 387 } |
| 369 #elif defined(OS_LINUX) | 388 #elif defined(OS_LINUX) |
| 370 if (output_sample_rate != 48000) { | 389 if (output_sample_rate != 48000) { |
| 371 DLOG(ERROR) << "Only 48kHz sample rate is supported on Linux."; | 390 DLOG(ERROR) << "Only 48kHz sample rate is supported on Linux."; |
| 372 return -1; | 391 return -1; |
| 373 } | 392 } |
| 374 input_channels = 1; | 393 input_channels = 1; |
| 375 output_channels = 1; | 394 output_channels = 1; |
| 376 | 395 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 input_buffer_.reset(new int16[input_buffer_size * input_channels]); | 433 input_buffer_.reset(new int16[input_buffer_size * input_channels]); |
| 415 output_buffer_.reset(new int16[output_buffer_size * output_channels]); | 434 output_buffer_.reset(new int16[output_buffer_size * output_channels]); |
| 416 | 435 |
| 417 DCHECK(input_buffer_.get()); | 436 DCHECK(input_buffer_.get()); |
| 418 DCHECK(output_buffer_.get()); | 437 DCHECK(output_buffer_.get()); |
| 419 | 438 |
| 420 bytes_per_sample_ = sizeof(*input_buffer_.get()); | 439 bytes_per_sample_ = sizeof(*input_buffer_.get()); |
| 421 | 440 |
| 422 initialized_ = true; | 441 initialized_ = true; |
| 423 | 442 |
| 424 VLOG(1) << "Capture parameters (size/channels/rate): (" | 443 DVLOG(1) << "Capture parameters (size/channels/rate): (" |
| 425 << input_buffer_size_ << "/" << input_channels_ << "/" | 444 << input_buffer_size_ << "/" << input_channels_ << "/" |
| 426 << input_sample_rate_ << ")"; | 445 << input_sample_rate_ << ")"; |
| 427 VLOG(1) << "Render parameters (size/channels/rate): (" | 446 DVLOG(1) << "Render parameters (size/channels/rate): (" |
| 428 << output_buffer_size_ << "/" << output_channels_ << "/" | 447 << output_buffer_size_ << "/" << output_channels_ << "/" |
| 429 << output_sample_rate_ << ")"; | 448 << output_sample_rate_ << ")"; |
| 430 return 0; | 449 return 0; |
| 431 } | 450 } |
| 432 | 451 |
| 433 void WebRtcAudioDeviceImpl::InitOnRenderThread(int32_t* error, | 452 void WebRtcAudioDeviceImpl::InitOnRenderThread(int32_t* error, |
| 434 base::WaitableEvent* event) { | 453 base::WaitableEvent* event) { |
| 435 DCHECK(render_loop_->BelongsToCurrentThread()); | 454 DCHECK(render_loop_->BelongsToCurrentThread()); |
| 436 *error = Init(); | 455 *error = Init(); |
| 437 event->Signal(); | 456 event->Signal(); |
| 438 } | 457 } |
| 439 | 458 |
| 440 int32_t WebRtcAudioDeviceImpl::Terminate() { | 459 int32_t WebRtcAudioDeviceImpl::Terminate() { |
| 441 VLOG(1) << "Terminate()"; | 460 DVLOG(1) << "Terminate()"; |
| 442 | 461 |
| 443 // Calling Terminate() multiple times in a row is OK. | 462 // Calling Terminate() multiple times in a row is OK. |
| 444 if (!initialized_) | 463 if (!initialized_) |
| 445 return 0; | 464 return 0; |
| 446 | 465 |
| 447 DCHECK(audio_input_device_); | 466 DCHECK(audio_input_device_); |
| 448 DCHECK(audio_output_device_); | 467 DCHECK(audio_output_device_); |
| 449 DCHECK(input_buffer_.get()); | 468 DCHECK(input_buffer_.get()); |
| 450 DCHECK(output_buffer_.get()); | 469 DCHECK(output_buffer_.get()); |
| 451 | 470 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 502 |
| 484 int32_t WebRtcAudioDeviceImpl::RecordingDeviceName( | 503 int32_t WebRtcAudioDeviceImpl::RecordingDeviceName( |
| 485 uint16_t index, | 504 uint16_t index, |
| 486 char name[webrtc::kAdmMaxDeviceNameSize], | 505 char name[webrtc::kAdmMaxDeviceNameSize], |
| 487 char guid[webrtc::kAdmMaxGuidSize]) { | 506 char guid[webrtc::kAdmMaxGuidSize]) { |
| 488 NOTIMPLEMENTED(); | 507 NOTIMPLEMENTED(); |
| 489 return -1; | 508 return -1; |
| 490 } | 509 } |
| 491 | 510 |
| 492 int32_t WebRtcAudioDeviceImpl::SetPlayoutDevice(uint16_t index) { | 511 int32_t WebRtcAudioDeviceImpl::SetPlayoutDevice(uint16_t index) { |
| 493 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetPlayoutDevice() " | 512 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetPlayoutDevice() " |
| 494 << "NOT IMPLEMENTED"; | 513 << "NOT IMPLEMENTED"; |
| 495 return 0; | 514 return 0; |
| 496 } | 515 } |
| 497 | 516 |
| 498 int32_t WebRtcAudioDeviceImpl::SetPlayoutDevice(WindowsDeviceType device) { | 517 int32_t WebRtcAudioDeviceImpl::SetPlayoutDevice(WindowsDeviceType device) { |
| 499 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetPlayoutDevice() " | 518 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetPlayoutDevice() " |
| 500 << "NOT IMPLEMENTED"; | 519 << "NOT IMPLEMENTED"; |
| 501 return 0; | 520 return 0; |
| 502 } | 521 } |
| 503 | 522 |
| 504 int32_t WebRtcAudioDeviceImpl::SetRecordingDevice(uint16_t index) { | 523 int32_t WebRtcAudioDeviceImpl::SetRecordingDevice(uint16_t index) { |
| 505 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetRecordingDevice() " | 524 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetRecordingDevice() " |
| 506 << "NOT IMPLEMENTED"; | 525 << "NOT IMPLEMENTED"; |
| 507 return 0; | 526 return 0; |
| 508 } | 527 } |
| 509 | 528 |
| 510 int32_t WebRtcAudioDeviceImpl::SetRecordingDevice(WindowsDeviceType device) { | 529 int32_t WebRtcAudioDeviceImpl::SetRecordingDevice(WindowsDeviceType device) { |
| 511 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetRecordingDevice() " | 530 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetRecordingDevice() " |
| 512 << "NOT IMPLEMENTED"; | 531 << "NOT IMPLEMENTED"; |
| 513 return 0; | 532 return 0; |
| 514 } | 533 } |
| 515 | 534 |
| 516 int32_t WebRtcAudioDeviceImpl::PlayoutIsAvailable(bool* available) { | 535 int32_t WebRtcAudioDeviceImpl::PlayoutIsAvailable(bool* available) { |
| 517 VLOG(1) << "PlayoutIsAvailable()"; | 536 DVLOG(1) << "PlayoutIsAvailable()"; |
| 518 *available = (audio_output_device_ != NULL); | 537 *available = (audio_output_device_ != NULL); |
| 519 return 0; | 538 return 0; |
| 520 } | 539 } |
| 521 | 540 |
| 522 int32_t WebRtcAudioDeviceImpl::InitPlayout() { | 541 int32_t WebRtcAudioDeviceImpl::InitPlayout() { |
| 523 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitPlayout() " | 542 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitPlayout() " |
| 524 << "NOT IMPLEMENTED"; | 543 << "NOT IMPLEMENTED"; |
| 525 return 0; | 544 return 0; |
| 526 } | 545 } |
| 527 | 546 |
| 528 bool WebRtcAudioDeviceImpl::PlayoutIsInitialized() const { | 547 bool WebRtcAudioDeviceImpl::PlayoutIsInitialized() const { |
| 529 VLOG(1) << "PlayoutIsInitialized()"; | 548 DVLOG(1) << "PlayoutIsInitialized()"; |
| 530 return (audio_output_device_ != NULL); | 549 return (audio_output_device_ != NULL); |
| 531 } | 550 } |
| 532 | 551 |
| 533 int32_t WebRtcAudioDeviceImpl::RecordingIsAvailable(bool* available) { | 552 int32_t WebRtcAudioDeviceImpl::RecordingIsAvailable(bool* available) { |
| 534 VLOG(1) << "RecordingIsAvailable()"; | 553 DVLOG(1) << "RecordingIsAvailable()"; |
| 535 *available = (audio_input_device_ != NULL); | 554 *available = (audio_input_device_ != NULL); |
| 536 return 0; | 555 return 0; |
| 537 } | 556 } |
| 538 | 557 |
| 539 int32_t WebRtcAudioDeviceImpl::InitRecording() { | 558 int32_t WebRtcAudioDeviceImpl::InitRecording() { |
| 540 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitRecording() " | 559 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitRecording() " |
| 541 << "NOT IMPLEMENTED"; | 560 << "NOT IMPLEMENTED"; |
| 542 return 0; | 561 return 0; |
| 543 } | 562 } |
| 544 | 563 |
| 545 bool WebRtcAudioDeviceImpl::RecordingIsInitialized() const { | 564 bool WebRtcAudioDeviceImpl::RecordingIsInitialized() const { |
| 546 VLOG(1) << "RecordingIsInitialized()"; | 565 DVLOG(1) << "RecordingIsInitialized()"; |
| 547 return (audio_input_device_ != NULL); | 566 return (audio_input_device_ != NULL); |
| 548 } | 567 } |
| 549 | 568 |
| 550 int32_t WebRtcAudioDeviceImpl::StartPlayout() { | 569 int32_t WebRtcAudioDeviceImpl::StartPlayout() { |
| 551 VLOG(1) << "StartPlayout()"; | 570 DVLOG(1) << "StartPlayout()"; |
| 552 if (!audio_transport_callback_) { | 571 if (!audio_transport_callback_) { |
| 553 LOG(ERROR) << "Audio transport is missing"; | 572 LOG(ERROR) << "Audio transport is missing"; |
| 554 return -1; | 573 return -1; |
| 555 } | 574 } |
| 556 if (playing_) { | 575 if (playing_) { |
| 557 // webrtc::VoiceEngine assumes that it is OK to call Start() twice and | 576 // webrtc::VoiceEngine assumes that it is OK to call Start() twice and |
| 558 // that the call is ignored the second time. | 577 // that the call is ignored the second time. |
| 559 LOG(WARNING) << "Playout is already active"; | 578 LOG(WARNING) << "Playout is already active"; |
| 560 return 0; | 579 return 0; |
| 561 } | 580 } |
| 562 audio_output_device_->Start(); | 581 audio_output_device_->Start(); |
| 563 playing_ = true; | 582 playing_ = true; |
| 564 return 0; | 583 return 0; |
| 565 } | 584 } |
| 566 | 585 |
| 567 int32_t WebRtcAudioDeviceImpl::StopPlayout() { | 586 int32_t WebRtcAudioDeviceImpl::StopPlayout() { |
| 568 VLOG(1) << "StopPlayout()"; | 587 DVLOG(1) << "StopPlayout()"; |
| 569 DCHECK(audio_output_device_); | 588 DCHECK(audio_output_device_); |
| 570 if (!playing_) { | 589 if (!playing_) { |
| 571 // webrtc::VoiceEngine assumes that it is OK to call Stop() just in case. | 590 // webrtc::VoiceEngine assumes that it is OK to call Stop() just in case. |
| 572 LOG(WARNING) << "Playout was already stopped"; | 591 LOG(WARNING) << "Playout was already stopped"; |
| 573 return 0; | 592 return 0; |
| 574 } | 593 } |
| 575 playing_ = !audio_output_device_->Stop(); | 594 playing_ = !audio_output_device_->Stop(); |
| 576 return (!playing_ ? 0 : -1); | 595 return (!playing_ ? 0 : -1); |
| 577 } | 596 } |
| 578 | 597 |
| 579 bool WebRtcAudioDeviceImpl::Playing() const { | 598 bool WebRtcAudioDeviceImpl::Playing() const { |
| 580 return playing_; | 599 return playing_; |
| 581 } | 600 } |
| 582 | 601 |
| 583 int32_t WebRtcAudioDeviceImpl::StartRecording() { | 602 int32_t WebRtcAudioDeviceImpl::StartRecording() { |
| 584 VLOG(1) << "StartRecording()"; | 603 DVLOG(1) << "StartRecording()"; |
| 585 #if defined(OS_MACOSX) | 604 #if defined(OS_MACOSX) |
| 586 DLOG(WARNING) << "Real-time recording is not yet fully supported on Mac OS X"; | 605 DLOG(WARNING) << "Real-time recording is not yet fully supported on Mac OS X"; |
| 587 #endif | 606 #endif |
| 588 LOG_IF(ERROR, !audio_transport_callback_) << "Audio transport is missing"; | 607 LOG_IF(ERROR, !audio_transport_callback_) << "Audio transport is missing"; |
| 589 if (!audio_transport_callback_) { | 608 if (!audio_transport_callback_) { |
| 590 LOG(ERROR) << "Audio transport is missing"; | 609 LOG(ERROR) << "Audio transport is missing"; |
| 591 return -1; | 610 return -1; |
| 592 } | 611 } |
| 593 | 612 |
| 594 if (session_id_ <= 0) { | 613 if (session_id_ <= 0) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 607 } | 626 } |
| 608 | 627 |
| 609 // Specify the session_id which is mapped to a certain device. | 628 // Specify the session_id which is mapped to a certain device. |
| 610 audio_input_device_->SetDevice(session_id_); | 629 audio_input_device_->SetDevice(session_id_); |
| 611 audio_input_device_->Start(); | 630 audio_input_device_->Start(); |
| 612 recording_ = true; | 631 recording_ = true; |
| 613 return 0; | 632 return 0; |
| 614 } | 633 } |
| 615 | 634 |
| 616 int32_t WebRtcAudioDeviceImpl::StopRecording() { | 635 int32_t WebRtcAudioDeviceImpl::StopRecording() { |
| 617 VLOG(1) << "StopRecording()"; | 636 DVLOG(1) << "StopRecording()"; |
| 618 DCHECK(audio_input_device_); | 637 DCHECK(audio_input_device_); |
| 619 | 638 |
| 620 base::AutoLock auto_lock(lock_); | 639 base::AutoLock auto_lock(lock_); |
| 621 if (!recording_) { | 640 if (!recording_) { |
| 622 // webrtc::VoiceEngine assumes that it is OK to call Stop() just in case. | 641 // webrtc::VoiceEngine assumes that it is OK to call Stop() just in case. |
| 623 LOG(WARNING) << "Recording was already stopped"; | 642 LOG(WARNING) << "Recording was already stopped"; |
| 624 return 0; | 643 return 0; |
| 625 } | 644 } |
| 626 recording_ = !audio_input_device_->Stop(); | 645 recording_ = !audio_input_device_->Stop(); |
| 627 return (!recording_ ? 0 : -1); | 646 return (!recording_ ? 0 : -1); |
| 628 } | 647 } |
| 629 | 648 |
| 630 bool WebRtcAudioDeviceImpl::Recording() const { | 649 bool WebRtcAudioDeviceImpl::Recording() const { |
| 631 return recording_; | 650 return recording_; |
| 632 } | 651 } |
| 633 | 652 |
| 634 int32_t WebRtcAudioDeviceImpl::SetAGC(bool enable) { | 653 int32_t WebRtcAudioDeviceImpl::SetAGC(bool enable) { |
| 635 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetAGC() " | 654 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetAGC() " << "NOT IMPLEMENTED"; |
| 636 << "NOT IMPLEMENTED"; | |
| 637 return -1; | 655 return -1; |
| 638 } | 656 } |
| 639 | 657 |
| 640 bool WebRtcAudioDeviceImpl::AGC() const { | 658 bool WebRtcAudioDeviceImpl::AGC() const { |
| 641 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::AGC() " | 659 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::AGC() " << "NOT IMPLEMENTED"; |
| 642 << "NOT IMPLEMENTED"; | |
| 643 return false; | 660 return false; |
| 644 } | 661 } |
| 645 | 662 |
| 646 int32_t WebRtcAudioDeviceImpl::SetWaveOutVolume(uint16_t volume_left, | 663 int32_t WebRtcAudioDeviceImpl::SetWaveOutVolume(uint16_t volume_left, |
| 647 uint16_t volume_right) { | 664 uint16_t volume_right) { |
| 648 NOTIMPLEMENTED(); | 665 NOTIMPLEMENTED(); |
| 649 return -1; | 666 return -1; |
| 650 } | 667 } |
| 651 int32_t WebRtcAudioDeviceImpl::WaveOutVolume( | 668 int32_t WebRtcAudioDeviceImpl::WaveOutVolume( |
| 652 uint16_t* volume_left, | 669 uint16_t* volume_left, |
| 653 uint16_t* volume_right) const { | 670 uint16_t* volume_right) const { |
| 654 NOTIMPLEMENTED(); | 671 NOTIMPLEMENTED(); |
| 655 return -1; | 672 return -1; |
| 656 } | 673 } |
| 657 | 674 |
| 658 int32_t WebRtcAudioDeviceImpl::SpeakerIsAvailable(bool* available) { | 675 int32_t WebRtcAudioDeviceImpl::SpeakerIsAvailable(bool* available) { |
| 659 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SpeakerIsAvailable() " | 676 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SpeakerIsAvailable() " |
| 660 << "NOT IMPLEMENTED"; | 677 << "NOT IMPLEMENTED"; |
| 661 *available = true; | 678 *available = true; |
| 662 return 0; | 679 return 0; |
| 663 } | 680 } |
| 664 | 681 |
| 665 int32_t WebRtcAudioDeviceImpl::InitSpeaker() { | 682 int32_t WebRtcAudioDeviceImpl::InitSpeaker() { |
| 666 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitSpeaker() " | 683 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitSpeaker() " |
| 667 << "NOT IMPLEMENTED"; | 684 << "NOT IMPLEMENTED"; |
| 668 return 0; | 685 return 0; |
| 669 } | 686 } |
| 670 | 687 |
| 671 bool WebRtcAudioDeviceImpl::SpeakerIsInitialized() const { | 688 bool WebRtcAudioDeviceImpl::SpeakerIsInitialized() const { |
| 672 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SpeakerIsInitialized() " | 689 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SpeakerIsInitialized() " |
| 673 << "NOT IMPLEMENTED"; | 690 << "NOT IMPLEMENTED"; |
| 674 return true; | 691 return true; |
| 675 } | 692 } |
| 676 | 693 |
| 677 int32_t WebRtcAudioDeviceImpl::MicrophoneIsAvailable(bool* available) { | 694 int32_t WebRtcAudioDeviceImpl::MicrophoneIsAvailable(bool* available) { |
| 678 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::MicrophoneIsAvailable() " | 695 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::MicrophoneIsAvailable() " |
| 679 << "NOT IMPLEMENTED"; | 696 << "NOT IMPLEMENTED"; |
| 680 *available = true; | 697 *available = true; |
| 681 return 0; | 698 return 0; |
| 682 } | 699 } |
| 683 | 700 |
| 684 int32_t WebRtcAudioDeviceImpl::InitMicrophone() { | 701 int32_t WebRtcAudioDeviceImpl::InitMicrophone() { |
| 685 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitMicrophone() " | 702 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::InitMicrophone() " |
| 686 << "NOT IMPLEMENTED"; | 703 << "NOT IMPLEMENTED"; |
| 687 return 0; | 704 return 0; |
| 688 } | 705 } |
| 689 | 706 |
| 690 bool WebRtcAudioDeviceImpl::MicrophoneIsInitialized() const { | 707 bool WebRtcAudioDeviceImpl::MicrophoneIsInitialized() const { |
| 691 NOTIMPLEMENTED(); | 708 NOTIMPLEMENTED(); |
| 692 return true; | 709 return true; |
| 693 } | 710 } |
| 694 | 711 |
| 695 int32_t WebRtcAudioDeviceImpl::SpeakerVolumeIsAvailable( | 712 int32_t WebRtcAudioDeviceImpl::SpeakerVolumeIsAvailable( |
| 696 bool* available) { | 713 bool* available) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 return -1; | 752 return -1; |
| 736 } | 753 } |
| 737 | 754 |
| 738 int32_t WebRtcAudioDeviceImpl::MicrophoneVolume(uint32_t* volume) const { | 755 int32_t WebRtcAudioDeviceImpl::MicrophoneVolume(uint32_t* volume) const { |
| 739 NOTIMPLEMENTED(); | 756 NOTIMPLEMENTED(); |
| 740 return -1; | 757 return -1; |
| 741 } | 758 } |
| 742 | 759 |
| 743 int32_t WebRtcAudioDeviceImpl::MaxMicrophoneVolume( | 760 int32_t WebRtcAudioDeviceImpl::MaxMicrophoneVolume( |
| 744 uint32_t* max_volume) const { | 761 uint32_t* max_volume) const { |
| 745 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::MaxMicrophoneVolume() " | 762 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::MaxMicrophoneVolume() " |
| 746 << "NOT IMPLEMENTED"; | 763 << "NOT IMPLEMENTED"; |
| 747 return -1; | 764 return -1; |
| 748 } | 765 } |
| 749 | 766 |
| 750 int32_t WebRtcAudioDeviceImpl::MinMicrophoneVolume( | 767 int32_t WebRtcAudioDeviceImpl::MinMicrophoneVolume( |
| 751 uint32_t* min_volume) const { | 768 uint32_t* min_volume) const { |
| 752 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::MinMicrophoneVolume() " | 769 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::MinMicrophoneVolume() " |
| 753 << "NOT IMPLEMENTED"; | 770 << "NOT IMPLEMENTED"; |
| 754 return -1; | 771 return -1; |
| 755 } | 772 } |
| 756 | 773 |
| 757 int32_t WebRtcAudioDeviceImpl::MicrophoneVolumeStepSize( | 774 int32_t WebRtcAudioDeviceImpl::MicrophoneVolumeStepSize( |
| 758 uint16_t* step_size) const { | 775 uint16_t* step_size) const { |
| 759 NOTIMPLEMENTED(); | 776 NOTIMPLEMENTED(); |
| 760 return -1; | 777 return -1; |
| 761 } | 778 } |
| 762 | 779 |
| 763 int32_t WebRtcAudioDeviceImpl::SpeakerMuteIsAvailable(bool* available) { | 780 int32_t WebRtcAudioDeviceImpl::SpeakerMuteIsAvailable(bool* available) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 NOTIMPLEMENTED(); | 817 NOTIMPLEMENTED(); |
| 801 return -1; | 818 return -1; |
| 802 } | 819 } |
| 803 | 820 |
| 804 int32_t WebRtcAudioDeviceImpl::MicrophoneBoost(bool* enabled) const { | 821 int32_t WebRtcAudioDeviceImpl::MicrophoneBoost(bool* enabled) const { |
| 805 NOTIMPLEMENTED(); | 822 NOTIMPLEMENTED(); |
| 806 return -1; | 823 return -1; |
| 807 } | 824 } |
| 808 | 825 |
| 809 int32_t WebRtcAudioDeviceImpl::StereoPlayoutIsAvailable(bool* available) const { | 826 int32_t WebRtcAudioDeviceImpl::StereoPlayoutIsAvailable(bool* available) const { |
| 810 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoPlayoutIsAvailable() " | 827 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoPlayoutIsAvailable() " |
| 811 << "NOT IMPLEMENTED"; | 828 << "NOT IMPLEMENTED"; |
| 812 *available = false; | 829 *available = false; |
| 813 return 0; | 830 return 0; |
| 814 } | 831 } |
| 815 | 832 |
| 816 int32_t WebRtcAudioDeviceImpl::SetStereoPlayout(bool enable) { | 833 int32_t WebRtcAudioDeviceImpl::SetStereoPlayout(bool enable) { |
| 817 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetStereoPlayout() " | 834 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetStereoPlayout() " |
| 818 << "NOT IMPLEMENTED"; | 835 << "NOT IMPLEMENTED"; |
| 819 return 0; | 836 return 0; |
| 820 } | 837 } |
| 821 | 838 |
| 822 int32_t WebRtcAudioDeviceImpl::StereoPlayout(bool* enabled) const { | 839 int32_t WebRtcAudioDeviceImpl::StereoPlayout(bool* enabled) const { |
| 823 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoPlayout() " | 840 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoPlayout() " |
| 824 << "NOT IMPLEMENTED"; | 841 << "NOT IMPLEMENTED"; |
| 825 return 0; | 842 return 0; |
| 826 } | 843 } |
| 827 | 844 |
| 828 int32_t WebRtcAudioDeviceImpl::StereoRecordingIsAvailable( | 845 int32_t WebRtcAudioDeviceImpl::StereoRecordingIsAvailable( |
| 829 bool* available) const { | 846 bool* available) const { |
| 830 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoRecordingIsAvailable() " | 847 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoRecordingIsAvailable() " |
| 831 << "NOT IMPLEMENTED"; | 848 << "NOT IMPLEMENTED"; |
| 832 return 0; | 849 return 0; |
| 833 } | 850 } |
| 834 | 851 |
| 835 int32_t WebRtcAudioDeviceImpl::SetStereoRecording(bool enable) { | 852 int32_t WebRtcAudioDeviceImpl::SetStereoRecording(bool enable) { |
| 836 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetStereoRecording() " | 853 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::SetStereoRecording() " |
| 837 << "NOT IMPLEMENTED"; | 854 << "NOT IMPLEMENTED"; |
| 838 return -1; | 855 return -1; |
| 839 } | 856 } |
| 840 | 857 |
| 841 int32_t WebRtcAudioDeviceImpl::StereoRecording(bool* enabled) const { | 858 int32_t WebRtcAudioDeviceImpl::StereoRecording(bool* enabled) const { |
| 842 VLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoRecording() " | 859 DVLOG(2) << "WARNING: WebRtcAudioDeviceImpl::StereoRecording() " |
| 843 << "NOT IMPLEMENTED"; | 860 << "NOT IMPLEMENTED"; |
| 844 return -1; | 861 return -1; |
| 845 } | 862 } |
| 846 | 863 |
| 847 int32_t WebRtcAudioDeviceImpl::SetRecordingChannel(const ChannelType channel) { | 864 int32_t WebRtcAudioDeviceImpl::SetRecordingChannel(const ChannelType channel) { |
| 848 NOTIMPLEMENTED(); | 865 NOTIMPLEMENTED(); |
| 849 return -1; | 866 return -1; |
| 850 } | 867 } |
| 851 | 868 |
| 852 int32_t WebRtcAudioDeviceImpl::RecordingChannel(ChannelType* channel) const { | 869 int32_t WebRtcAudioDeviceImpl::RecordingChannel(ChannelType* channel) const { |
| 853 NOTIMPLEMENTED(); | 870 NOTIMPLEMENTED(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 } | 961 } |
| 945 | 962 |
| 946 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { | 963 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { |
| 947 NOTIMPLEMENTED(); | 964 NOTIMPLEMENTED(); |
| 948 return -1; | 965 return -1; |
| 949 } | 966 } |
| 950 | 967 |
| 951 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { | 968 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { |
| 952 session_id_ = session_id; | 969 session_id_ = session_id; |
| 953 } | 970 } |
| OLD | NEW |