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

Side by Side Diff: media/audio/linux/alsa_wrapper.cc

Issue 275022: Move Alsa device opening into the audio thread, and add in support for multi-channel audio. (Closed)
Patch Set: Fix up the unittests since we not only downmix for a very small set of channels. Created 11 years, 2 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 | « media/audio/linux/alsa_wrapper.h ('k') | media/audio/linux/audio_manager_linux.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 #include "media/audio/linux/alsa_wrapper.h" 5 #include "media/audio/linux/alsa_wrapper.h"
6 6
7 #include <alsa/asoundlib.h> 7 #include <alsa/asoundlib.h>
8 8
9 AlsaWrapper::AlsaWrapper() { 9 AlsaWrapper::AlsaWrapper() {
10 } 10 }
11 11
12 AlsaWrapper::~AlsaWrapper() { 12 AlsaWrapper::~AlsaWrapper() {
13 } 13 }
14 14
15 int AlsaWrapper::PcmOpen(snd_pcm_t** handle, const char* name, 15 int AlsaWrapper::PcmOpen(snd_pcm_t** handle, const char* name,
16 snd_pcm_stream_t stream, int mode) { 16 snd_pcm_stream_t stream, int mode) {
17 return snd_pcm_open(handle, name, stream, mode); 17 return snd_pcm_open(handle, name, stream, mode);
18 } 18 }
19 19
20 int AlsaWrapper::DeviceNameHint(int card, const char* iface, void*** hints) {
21 return snd_device_name_hint(card, iface, hints);
22 }
23
24 char* AlsaWrapper::DeviceNameGetHint(const void* hint, const char* id) {
25 return snd_device_name_get_hint(hint, id);
26 }
27
28 int AlsaWrapper::DeviceNameFreeHint(void** hints) {
29 return snd_device_name_free_hint(hints);
30 }
31
20 int AlsaWrapper::PcmClose(snd_pcm_t* handle) { 32 int AlsaWrapper::PcmClose(snd_pcm_t* handle) {
21 return snd_pcm_close(handle); 33 return snd_pcm_close(handle);
22 } 34 }
23 35
24 int AlsaWrapper::PcmPrepare(snd_pcm_t* handle) { 36 int AlsaWrapper::PcmPrepare(snd_pcm_t* handle) {
25 return snd_pcm_prepare(handle); 37 return snd_pcm_prepare(handle);
26 } 38 }
27 39
28 int AlsaWrapper::PcmDrop(snd_pcm_t* handle) { 40 int AlsaWrapper::PcmDrop(snd_pcm_t* handle) {
29 return snd_pcm_drop(handle); 41 return snd_pcm_drop(handle);
(...skipping 25 matching lines...) Expand all
55 soft_resample, latency); 67 soft_resample, latency);
56 } 68 }
57 69
58 snd_pcm_sframes_t AlsaWrapper::PcmAvailUpdate(snd_pcm_t* handle) { 70 snd_pcm_sframes_t AlsaWrapper::PcmAvailUpdate(snd_pcm_t* handle) {
59 return snd_pcm_avail_update(handle); 71 return snd_pcm_avail_update(handle);
60 } 72 }
61 73
62 const char* AlsaWrapper::StrError(int errnum) { 74 const char* AlsaWrapper::StrError(int errnum) {
63 return snd_strerror(errnum); 75 return snd_strerror(errnum);
64 } 76 }
OLDNEW
« no previous file with comments | « media/audio/linux/alsa_wrapper.h ('k') | media/audio/linux/audio_manager_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698