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

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

Issue 3299005: Implement audio recording for Linux via ALSA. (Closed)
Patch Set: . Created 10 years, 3 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 int AlsaWrapper::PcmDelay(snd_pcm_t* handle, snd_pcm_sframes_t* delay) { 44 int AlsaWrapper::PcmDelay(snd_pcm_t* handle, snd_pcm_sframes_t* delay) {
45 return snd_pcm_delay(handle, delay); 45 return snd_pcm_delay(handle, delay);
46 } 46 }
47 47
48 snd_pcm_sframes_t AlsaWrapper::PcmWritei(snd_pcm_t* handle, 48 snd_pcm_sframes_t AlsaWrapper::PcmWritei(snd_pcm_t* handle,
49 const void* buffer, 49 const void* buffer,
50 snd_pcm_uframes_t size) { 50 snd_pcm_uframes_t size) {
51 return snd_pcm_writei(handle, buffer, size); 51 return snd_pcm_writei(handle, buffer, size);
52 } 52 }
53 53
54 snd_pcm_sframes_t AlsaWrapper::PcmReadi(snd_pcm_t* handle,
55 void* buffer,
56 snd_pcm_uframes_t size) {
57 return snd_pcm_readi(handle, buffer, size);
58 }
59
54 int AlsaWrapper::PcmRecover(snd_pcm_t* handle, int err, int silent) { 60 int AlsaWrapper::PcmRecover(snd_pcm_t* handle, int err, int silent) {
55 return snd_pcm_recover(handle, err, silent); 61 return snd_pcm_recover(handle, err, silent);
56 } 62 }
57 63
58 const char* AlsaWrapper::PcmName(snd_pcm_t* handle) { 64 const char* AlsaWrapper::PcmName(snd_pcm_t* handle) {
59 return snd_pcm_name(handle); 65 return snd_pcm_name(handle);
60 } 66 }
61 67
62 int AlsaWrapper::PcmSetParams(snd_pcm_t* handle, snd_pcm_format_t format, 68 int AlsaWrapper::PcmSetParams(snd_pcm_t* handle, snd_pcm_format_t format,
63 snd_pcm_access_t access, unsigned int channels, 69 snd_pcm_access_t access, unsigned int channels,
(...skipping 12 matching lines...) Expand all
76 return snd_pcm_avail_update(handle); 82 return snd_pcm_avail_update(handle);
77 } 83 }
78 84
79 snd_pcm_state_t AlsaWrapper::PcmState(snd_pcm_t* handle) { 85 snd_pcm_state_t AlsaWrapper::PcmState(snd_pcm_t* handle) {
80 return snd_pcm_state(handle); 86 return snd_pcm_state(handle);
81 } 87 }
82 88
83 const char* AlsaWrapper::StrError(int errnum) { 89 const char* AlsaWrapper::StrError(int errnum) {
84 return snd_strerror(errnum); 90 return snd_strerror(errnum);
85 } 91 }
92
93 int AlsaWrapper::PcmStart(snd_pcm_t* handle) {
94 return snd_pcm_start(handle);
95 }
96
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698