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

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

Issue 160497: Reimplement the AlsaPcmOutputStream and fix the threading issues. (Closed)
Patch Set: Address Andrew's comments. Diff aginst Patch 8 please. Created 11 years, 4 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.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "media/audio/linux/alsa_wrapper.h"
6
7 #include <alsa/asoundlib.h>
8
9 AlsaWrapper::AlsaWrapper() {
10 }
11
12 AlsaWrapper::~AlsaWrapper() {
13 }
14
15 int AlsaWrapper::PcmOpen(snd_pcm_t** handle, const char* name,
16 snd_pcm_stream_t stream, int mode) {
17 return snd_pcm_open(handle, name, stream, mode);
18 }
19
20 int AlsaWrapper::PcmClose(snd_pcm_t* handle) {
21 return snd_pcm_close(handle);
22 }
23
24 int AlsaWrapper::PcmPrepare(snd_pcm_t* handle) {
25 return snd_pcm_prepare(handle);
26 }
27
28 int AlsaWrapper::PcmDrop(snd_pcm_t* handle) {
29 return snd_pcm_drop(handle);
30 }
31
32 snd_pcm_sframes_t AlsaWrapper::PcmWritei(snd_pcm_t* handle,
33 const void* buffer,
34 snd_pcm_uframes_t size) {
35 return snd_pcm_writei(handle, buffer, size);
36 }
37
38 int AlsaWrapper::PcmRecover(snd_pcm_t* handle, int err, int silent) {
39 return snd_pcm_recover(handle, err, silent);
40 }
41
42 const char* AlsaWrapper::PcmName(snd_pcm_t* handle) {
43 return snd_pcm_name(handle);
44 }
45
46 int AlsaWrapper::PcmSetParams(snd_pcm_t* handle, snd_pcm_format_t format,
47 snd_pcm_access_t access, unsigned int channels,
48 unsigned int rate, int soft_resample,
49 unsigned int latency) {
50 return snd_pcm_set_params(handle, format, access, channels, rate,
51 soft_resample, latency);
52 }
53
54 snd_pcm_sframes_t AlsaWrapper::PcmAvailUpdate(snd_pcm_t* handle) {
55 return snd_pcm_avail_update(handle);
56 }
57
58 const char* AlsaWrapper::StrError(int errnum) {
59 return snd_strerror(errnum);
60 }
OLDNEW
« no previous file with comments | « media/audio/linux/alsa_wrapper.h ('k') | media/audio/linux/audio_manager_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698