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

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

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright years Created 8 years, 9 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
« no previous file with comments | « content/renderer/media/audio_hardware.h ('k') | content/renderer/media/audio_input_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_hardware.cc
diff --git a/content/renderer/media/audio_hardware.cc b/content/renderer/media/audio_hardware.cc
index 8fca8e55f98b7e789cfa7006611a1e33f7e96147..d753a54477df1f8e5cb263f8a264210393c15414 100644
--- a/content/renderer/media/audio_hardware.cc
+++ b/content/renderer/media/audio_hardware.cc
@@ -8,14 +8,14 @@
#include "content/common/view_messages.h"
#include "content/renderer/render_thread_impl.h"
-static double output_sample_rate = 0.0;
-static double input_sample_rate = 0.0;
+static int output_sample_rate = 0;
+static int input_sample_rate = 0;
static size_t output_buffer_size = 0;
-static uint32 input_channel_count = 0;
+static ChannelLayout input_channel_layout = CHANNEL_LAYOUT_NONE;
namespace audio_hardware {
-double GetOutputSampleRate() {
+int GetOutputSampleRate() {
DCHECK(RenderThreadImpl::current() != NULL);
if (!output_sample_rate) {
@@ -25,7 +25,7 @@ double GetOutputSampleRate() {
return output_sample_rate;
}
-double GetInputSampleRate() {
+int GetInputSampleRate() {
DCHECK(RenderThreadImpl::current() != NULL);
if (!input_sample_rate) {
@@ -78,17 +78,17 @@ size_t GetHighLatencyOutputBufferSize(int sample_rate) {
return samples;
}
-uint32 GetInputChannelCount() {
+ChannelLayout GetInputChannelLayout() {
DCHECK(RenderThreadImpl::current() != NULL);
- if (!input_channel_count) {
- uint32 channels = 0;
+ if (input_channel_layout == CHANNEL_LAYOUT_NONE) {
+ ChannelLayout layout = CHANNEL_LAYOUT_NONE;
RenderThreadImpl::current()->Send(
- new ViewHostMsg_GetHardwareInputChannelCount(&channels));
- input_channel_count = channels;
+ new ViewHostMsg_GetHardwareInputChannelLayout(&layout));
+ input_channel_layout = layout;
}
- return input_channel_count;
+ return input_channel_layout;
}
void ResetCache() {
@@ -97,7 +97,7 @@ void ResetCache() {
output_sample_rate = 0.0;
input_sample_rate = 0.0;
output_buffer_size = 0;
- input_channel_count = 0;
+ input_channel_layout = CHANNEL_LAYOUT_NONE;
}
} // namespace audio_hardware
« no previous file with comments | « content/renderer/media/audio_hardware.h ('k') | content/renderer/media/audio_input_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698