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

Side by Side Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 10834033: Move AudioDevice and AudioInputDevice to media. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and fixed a few lint issues Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 // Calling Init() multiple times in a row is OK. 416 // Calling Init() multiple times in a row is OK.
417 if (initialized_) 417 if (initialized_)
418 return 0; 418 return 0;
419 419
420 DCHECK(!audio_input_device_); 420 DCHECK(!audio_input_device_);
421 DCHECK(!input_buffer_.get()); 421 DCHECK(!input_buffer_.get());
422 DCHECK(!output_buffer_.get()); 422 DCHECK(!output_buffer_.get());
423 423
424 // TODO(henrika): it could be possible to allow one of the directions (input 424 // TODO(henrika): it could be possible to allow one of the directions (input
425 // or output) to use a non-supported rate. As an example: if only the 425 // or output) to use a non-supported rate. As an example: if only the
426 // output rate is OK, we could finalize Init() and only set up an AudioDevice. 426 // output rate is OK, we could finalize Init() and only set up an
427 // AudioOutputDevice.
427 428
428 // Ask the browser for the default audio output hardware sample-rate. 429 // Ask the browser for the default audio output hardware sample-rate.
429 // This request is based on a synchronous IPC message. 430 // This request is based on a synchronous IPC message.
430 int out_sample_rate = audio_hardware::GetOutputSampleRate(); 431 int out_sample_rate = audio_hardware::GetOutputSampleRate();
431 DVLOG(1) << "Audio output hardware sample rate: " << out_sample_rate; 432 DVLOG(1) << "Audio output hardware sample rate: " << out_sample_rate;
432 AddHistogramSampleRate(kAudioOutput, out_sample_rate); 433 AddHistogramSampleRate(kAudioOutput, out_sample_rate);
433 434
434 // Verify that the reported output hardware sample rate is supported 435 // Verify that the reported output hardware sample rate is supported
435 // on the current platform. 436 // on the current platform.
436 if (std::find(&kValidOutputRates[0], 437 if (std::find(&kValidOutputRates[0],
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 } 1168 }
1168 1169
1169 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { 1170 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const {
1170 NOTIMPLEMENTED(); 1171 NOTIMPLEMENTED();
1171 return -1; 1172 return -1;
1172 } 1173 }
1173 1174
1174 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { 1175 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) {
1175 session_id_ = session_id; 1176 session_id_ = session_id;
1176 } 1177 }
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_device_impl.h ('k') | content/renderer/pepper/pepper_platform_audio_output_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698