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

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

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_output_unittest.cc ('k') | media/audio/linux/alsa_wrapper.cc » ('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 // AlsaWrapper is a simple stateless class that wraps the alsa library commands
6 // we want to use. It's purpose is to allow injection of a mock so that the
7 // higher level code is testable.
8
9 #include <alsa/asoundlib.h>
10
11 #include "base/basictypes.h"
12
13 class AlsaWrapper {
14 public:
15 AlsaWrapper();
16 virtual ~AlsaWrapper();
17
18 virtual int PcmOpen(snd_pcm_t** handle, const char* name,
19 snd_pcm_stream_t stream, int mode);
20 virtual int PcmClose(snd_pcm_t* handle);
21 virtual int PcmPrepare(snd_pcm_t* handle);
22 virtual int PcmDrop(snd_pcm_t* handle);
23 virtual snd_pcm_sframes_t PcmWritei(snd_pcm_t* handle,
24 const void* buffer,
25 snd_pcm_uframes_t size);
26 virtual int PcmRecover(snd_pcm_t* handle, int err, int silent);
27 virtual int PcmSetParams(snd_pcm_t* handle, snd_pcm_format_t format,
28 snd_pcm_access_t access, unsigned int channels,
29 unsigned int rate, int soft_resample,
30 unsigned int latency);
31 virtual const char* PcmName(snd_pcm_t* handle);
32 virtual snd_pcm_sframes_t PcmAvailUpdate(snd_pcm_t* handle);
33
34 virtual const char* StrError(int errnum);
35
36 private:
37 DISALLOW_COPY_AND_ASSIGN(AlsaWrapper);
38 };
OLDNEW
« no previous file with comments | « media/audio/linux/alsa_output_unittest.cc ('k') | media/audio/linux/alsa_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698