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

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

Issue 15563004: Improved AGC update scheme for the audio backend in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Start/Stop APIs for the AGC part Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/cras/cras_input.cc ('k') | media/audio/linux/alsa_input.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ 5 #ifndef MEDIA_AUDIO_LINUX_ALSA_INPUT_H_
6 #define MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ 6 #define MEDIA_AUDIO_LINUX_ALSA_INPUT_H_
7 7
8 #include <alsa/asoundlib.h> 8 #include <alsa/asoundlib.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "media/audio/audio_input_stream_impl.h" 16 #include "media/audio/agc_audio_stream.h"
17 #include "media/audio/audio_io.h" 17 #include "media/audio/audio_io.h"
18 #include "media/audio/audio_parameters.h" 18 #include "media/audio/audio_parameters.h"
19 19
20 namespace media { 20 namespace media {
21 21
22 class AlsaWrapper; 22 class AlsaWrapper;
23 class AudioManagerLinux; 23 class AudioManagerLinux;
24 24
25 // Provides an input stream for audio capture based on the ALSA PCM interface. 25 // Provides an input stream for audio capture based on the ALSA PCM interface.
26 // This object is not thread safe and all methods should be invoked in the 26 // This object is not thread safe and all methods should be invoked in the
27 // thread that created the object. 27 // thread that created the object.
28 class AlsaPcmInputStream : public AudioInputStreamImpl { 28 class AlsaPcmInputStream : public AgcAudioStream<AudioInputStream> {
29 public: 29 public:
30 // Pass this to the constructor if you want to attempt auto-selection 30 // Pass this to the constructor if you want to attempt auto-selection
31 // of the audio recording device. 31 // of the audio recording device.
32 static const char kAutoSelectDevice[]; 32 static const char kAutoSelectDevice[];
33 33
34 // Create a PCM Output stream for the ALSA device identified by 34 // Create a PCM Output stream for the ALSA device identified by
35 // |device_name|. If unsure of what to use for |device_name|, use 35 // |device_name|. If unsure of what to use for |device_name|, use
36 // |kAutoSelectDevice|. 36 // |kAutoSelectDevice|.
37 AlsaPcmInputStream(AudioManagerLinux* audio_manager, 37 AlsaPcmInputStream(AudioManagerLinux* audio_manager,
38 const std::string& device_name, 38 const std::string& device_name,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; 83 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_;
84 scoped_ptr<uint8[]> audio_buffer_; // Buffer used for reading audio data. 84 scoped_ptr<uint8[]> audio_buffer_; // Buffer used for reading audio data.
85 bool read_callback_behind_schedule_; 85 bool read_callback_behind_schedule_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); 87 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream);
88 }; 88 };
89 89
90 } // namespace media 90 } // namespace media
91 91
92 #endif // MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ 92 #endif // MEDIA_AUDIO_LINUX_ALSA_INPUT_H_
OLDNEW
« no previous file with comments | « media/audio/cras/cras_input.cc ('k') | media/audio/linux/alsa_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698