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

Unified Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 8588030: Refactor the Get*Hardware* routines a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « content/renderer/media/audio_hardware.cc ('k') | content/renderer/media/webrtc_audio_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_device_impl.cc
===================================================================
--- content/renderer/media/webrtc_audio_device_impl.cc (revision 110480)
+++ content/renderer/media/webrtc_audio_device_impl.cc (working copy)
@@ -7,22 +7,13 @@
#include "base/bind.h"
#include "base/string_util.h"
#include "base/win/windows_version.h"
-#include "content/common/view_messages.h"
+#include "content/renderer/media/audio_hardware.h"
#include "content/renderer/render_thread_impl.h"
#include "media/audio/audio_util.h"
static const int64 kMillisecondsBetweenProcessCalls = 5000;
static const char kVersion[] = "WebRTC AudioDevice 1.0.0.Chrome";
-static int GetAudioInputHardwareSampleRate() {
- static double input_sample_rate = 0;
- if (!input_sample_rate) {
- RenderThreadImpl::current()->Send(
- new ViewHostMsg_GetHardwareInputSampleRate(&input_sample_rate));
- }
- return static_cast<int>(input_sample_rate);
-}
-
WebRtcAudioDeviceImpl::WebRtcAudioDeviceImpl()
: ref_count_(0),
render_loop_(base::MessageLoopProxy::current()),
@@ -290,12 +281,13 @@
// Ask the browser for the default audio output hardware sample-rate.
// This request is based on a synchronous IPC message.
int output_sample_rate =
- static_cast<int>(AudioDevice::GetAudioHardwareSampleRate());
+ static_cast<int>(audio_hardware::GetOutputSampleRate());
DVLOG(1) << "Audio output hardware sample rate: " << output_sample_rate;
// Ask the browser for the default audio input hardware sample-rate.
// This request is based on a synchronous IPC message.
- int input_sample_rate = GetAudioInputHardwareSampleRate();
+ int input_sample_rate =
+ static_cast<int>(audio_hardware::GetInputSampleRate());
DVLOG(1) << "Audio input hardware sample rate: " << input_sample_rate;
int input_channels = 0;
« no previous file with comments | « content/renderer/media/audio_hardware.cc ('k') | content/renderer/media/webrtc_audio_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698