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

Side by Side Diff: media/audio/linux/alsa_output.h

Issue 113923: Change default audio device from "plug:default" to "default". (Closed)
Patch Set: Capitlizing PCM, just for scherkus. Created 11 years, 7 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
« no previous file with comments | « no previous file | media/audio/linux/alsa_output.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // Creates an output stream based on the ALSA PCM interface. The current 5 // Creates an output stream based on the ALSA PCM interface. The current
6 // implementation creates one thread per ALSA playback handle that is 6 // implementation creates one thread per ALSA playback handle that is
7 // responsible for synchronously pulling data from the audio data source. 7 // responsible for synchronously pulling data from the audio data source.
8 // 8 //
9 // This output stream buffers in two places: 9 // This output stream buffers in two places:
10 // (1) In the ALSA device 10 // (1) In the ALSA device
(...skipping 25 matching lines...) Expand all
36 #include "base/scoped_ptr.h" 36 #include "base/scoped_ptr.h"
37 #include "base/thread.h" 37 #include "base/thread.h"
38 #include "media/audio/audio_output.h" 38 #include "media/audio/audio_output.h"
39 39
40 class Thread; 40 class Thread;
41 41
42 class AlsaPCMOutputStream : 42 class AlsaPCMOutputStream :
43 public AudioOutputStream, 43 public AudioOutputStream,
44 public base::RefCountedThreadSafe<AlsaPCMOutputStream> { 44 public base::RefCountedThreadSafe<AlsaPCMOutputStream> {
45 public: 45 public:
46 // Set to "plug:default" which should allow ALSA to do whatever is 46 // Set to "default" which should avoid locking the sound device and allow
47 // necessary to simulate an audio device capable of handling our PCMs. 47 // ALSA to multiplex sound from different processes that want to write PCM
48 // data.
48 static const char* kDefaultDevice; 49 static const char* kDefaultDevice;
49 50
50 // Create a PCM Output stream for the ALSA device identified by 51 // Create a PCM Output stream for the ALSA device identified by
51 // |device_name|. If unsure of hte device_name, use kDefaultDevice. 52 // |device_name|. If unsure of hte device_name, use kDefaultDevice.
52 AlsaPCMOutputStream(const std::string& device_name, 53 AlsaPCMOutputStream(const std::string& device_name,
53 int min_buffer_ms, 54 int min_buffer_ms,
54 AudioManager::Format format, 55 AudioManager::Format format,
55 int channels, 56 int channels,
56 int sample_rate, 57 int sample_rate,
57 char bits_per_sample); 58 char bits_per_sample);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // FillAlsaDeviceBuffer() methods. 157 // FillAlsaDeviceBuffer() methods.
157 bool device_write_suspended_; 158 bool device_write_suspended_;
158 159
159 // Flag indicating that the resources are already cleaned. 160 // Flag indicating that the resources are already cleaned.
160 bool resources_released_; 161 bool resources_released_;
161 162
162 DISALLOW_COPY_AND_ASSIGN(AlsaPCMOutputStream); 163 DISALLOW_COPY_AND_ASSIGN(AlsaPCMOutputStream);
163 }; 164 };
164 165
165 #endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_ 166 #endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/linux/alsa_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698