| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |