OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ANDROID_AUDIO_RECORD_INPUT_H_ | 5 #ifndef MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ |
6 #define MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ | 6 #define MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ |
7 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
11 #include "media/audio/audio_parameters.h" | 11 #include "media/audio/audio_parameters.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 class AudioManagerAndroid; | 15 class AudioManagerAndroid; |
16 | 16 |
17 // Implements PCM audio input support for Android using the Java AudioRecord | 17 // Implements PCM audio input support for Android using the Java AudioRecord |
18 // interface. Most of the work is done by its Java counterpart in | 18 // interface. Most of the work is done by its Java counterpart in |
19 // AudioRecordInput.java. This class is created and lives on the Audio Manager | 19 // AudioRecordInput.java. This class is created and lives on the Audio Manager |
20 // thread but recorded audio buffers are delivered on a thread managed by | 20 // thread but recorded audio buffers are delivered on a thread managed by |
21 // the Java class. | 21 // the Java class. |
| 22 // |
| 23 // The Java class makes use of AudioEffect features which are first available |
| 24 // in Jelly Bean. It should not be instantiated running against earlier SDKs. |
22 class MEDIA_EXPORT AudioRecordInputStream : public AudioInputStream { | 25 class MEDIA_EXPORT AudioRecordInputStream : public AudioInputStream { |
23 public: | 26 public: |
24 AudioRecordInputStream(AudioManagerAndroid* manager, | 27 AudioRecordInputStream(AudioManagerAndroid* manager, |
25 const AudioParameters& params); | 28 const AudioParameters& params); |
26 | 29 |
27 virtual ~AudioRecordInputStream(); | 30 virtual ~AudioRecordInputStream(); |
28 | 31 |
29 // Implementation of AudioInputStream. | 32 // Implementation of AudioInputStream. |
30 virtual bool Open() OVERRIDE; | 33 virtual bool Open() OVERRIDE; |
31 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 34 virtual void Start(AudioInputCallback* callback) OVERRIDE; |
(...skipping 28 matching lines...) Expand all Loading... |
60 | 63 |
61 // Owned by j_audio_record_. | 64 // Owned by j_audio_record_. |
62 uint8* direct_buffer_address_; | 65 uint8* direct_buffer_address_; |
63 | 66 |
64 DISALLOW_COPY_AND_ASSIGN(AudioRecordInputStream); | 67 DISALLOW_COPY_AND_ASSIGN(AudioRecordInputStream); |
65 }; | 68 }; |
66 | 69 |
67 } // namespace media | 70 } // namespace media |
68 | 71 |
69 #endif // MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ | 72 #endif // MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ |
OLD | NEW |