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

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

Issue 235723003: Use larger buffer sizes for lower power on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test on other platforms. Created 6 years, 8 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
« no previous file with comments | « no previous file | media/audio/cras/audio_manager_cras.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/audio_renderer_mixer_manager.h" 5 #include "content/renderer/media/audio_renderer_mixer_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "content/renderer/media/audio_device_factory.h" 9 #include "content/renderer/media/audio_device_factory.h"
10 #include "media/audio/audio_output_device.h" 10 #include "media/audio/audio_output_device.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 int sample_rate = params.sample_rate(); 60 int sample_rate = params.sample_rate();
61 #else 61 #else
62 int sample_rate = hardware_config_->GetOutputSampleRate(); 62 int sample_rate = hardware_config_->GetOutputSampleRate();
63 #endif 63 #endif
64 64
65 // Create output parameters based on the audio hardware configuration for 65 // Create output parameters based on the audio hardware configuration for
66 // passing on to the output sink. Force to 16-bit output for now since we 66 // passing on to the output sink. Force to 16-bit output for now since we
67 // know that works well for WebAudio and WebRTC. 67 // know that works well for WebAudio and WebRTC.
68 media::AudioParameters output_params( 68 media::AudioParameters output_params(
69 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, params.channel_layout(), 69 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, params.channel_layout(),
70 sample_rate, 16, hardware_config_->GetOutputBufferSize()); 70 sample_rate, 16, hardware_config_->GetHighLatencyBufferSize());
71 71
72 // If we've created invalid output parameters, simply pass on the input params 72 // If we've created invalid output parameters, simply pass on the input params
73 // and let the browser side handle automatic fallback. 73 // and let the browser side handle automatic fallback.
74 if (!output_params.IsValid()) 74 if (!output_params.IsValid())
75 output_params = params; 75 output_params = params;
76 76
77 media::AudioRendererMixer* mixer; 77 media::AudioRendererMixer* mixer;
78 if (sink_for_testing_) { 78 if (sink_for_testing_) {
79 mixer = new media::AudioRendererMixer( 79 mixer = new media::AudioRendererMixer(
80 params, output_params, sink_for_testing_); 80 params, output_params, sink_for_testing_);
(...skipping 19 matching lines...) Expand all
100 100
101 // Only remove the mixer if AudioRendererMixerManager is the last owner. 101 // Only remove the mixer if AudioRendererMixerManager is the last owner.
102 it->second.ref_count--; 102 it->second.ref_count--;
103 if (it->second.ref_count == 0) { 103 if (it->second.ref_count == 0) {
104 delete it->second.mixer; 104 delete it->second.mixer;
105 mixers_.erase(it); 105 mixers_.erase(it);
106 } 106 }
107 } 107 }
108 108
109 } // namespace content 109 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/audio/cras/audio_manager_cras.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698