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

Side by Side Diff: media/base/audio_hardware_config.h

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 | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/base/audio_hardware_config.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef MEDIA_BASE_AUDIO_HARDWARE_CONFIG_H_ 5 #ifndef MEDIA_BASE_AUDIO_HARDWARE_CONFIG_H_
6 #define MEDIA_BASE_AUDIO_HARDWARE_CONFIG_H_ 6 #define MEDIA_BASE_AUDIO_HARDWARE_CONFIG_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "media/audio/audio_parameters.h" 10 #include "media/audio/audio_parameters.h"
(...skipping 23 matching lines...) Expand all
34 media::AudioParameters GetInputConfig() const; 34 media::AudioParameters GetInputConfig() const;
35 media::AudioParameters GetOutputConfig() const; 35 media::AudioParameters GetOutputConfig() const;
36 36
37 // Allows callers to update the cached values for either input or output. The 37 // Allows callers to update the cached values for either input or output. The
38 // values are paired under the assumption that these values will only be set 38 // values are paired under the assumption that these values will only be set
39 // after an input or output device change respectively. Safe to call from 39 // after an input or output device change respectively. Safe to call from
40 // any thread. 40 // any thread.
41 void UpdateInputConfig(const media::AudioParameters& input_params); 41 void UpdateInputConfig(const media::AudioParameters& input_params);
42 void UpdateOutputConfig(const media::AudioParameters& output_params); 42 void UpdateOutputConfig(const media::AudioParameters& output_params);
43 43
44 // For clients which don't need low latency, a larger buffer size should be
45 // used to save power and CPU resources.
46 int GetHighLatencyBufferSize() const;
47
44 private: 48 private:
45 // Cached values; access is protected by |config_lock_|. 49 // Cached values; access is protected by |config_lock_|.
46 mutable base::Lock config_lock_; 50 mutable base::Lock config_lock_;
47 media::AudioParameters input_params_; 51 media::AudioParameters input_params_;
48 media::AudioParameters output_params_; 52 media::AudioParameters output_params_;
49 53
50 DISALLOW_COPY_AND_ASSIGN(AudioHardwareConfig); 54 DISALLOW_COPY_AND_ASSIGN(AudioHardwareConfig);
51 }; 55 };
52 56
53 } // namespace media 57 } // namespace media
54 58
55 #endif // MEDIA_BASE_AUDIO_HARDWARE_CONFIG_H_ 59 #endif // MEDIA_BASE_AUDIO_HARDWARE_CONFIG_H_
OLDNEW
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/base/audio_hardware_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698