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 AudioBus; | |
16 class AudioManagerAndroid; | 15 class AudioManagerAndroid; |
17 | 16 |
18 // Implements PCM audio input support for Android using the Java AudioRecord | 17 // Implements PCM audio input support for Android using the Java AudioRecord |
19 // 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 |
20 // 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 |
21 // 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 |
22 // the Java class. | 21 // the Java class. |
23 // | 22 // |
24 // The Java class makes use of AudioEffect features which are first available | 23 // The Java class makes use of AudioEffect features which are first available |
25 // in Jelly Bean. It should not be instantiated running against earlier SDKs. | 24 // in Jelly Bean. It should not be instantiated running against earlier SDKs. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 base::android::ScopedJavaGlobalRef<jobject> j_audio_record_; | 57 base::android::ScopedJavaGlobalRef<jobject> j_audio_record_; |
59 | 58 |
60 // This is the only member accessed by both the Audio Manager and Java | 59 // This is the only member accessed by both the Audio Manager and Java |
61 // threads. Explanations for why we do not require explicit synchronization | 60 // threads. Explanations for why we do not require explicit synchronization |
62 // are given in the implementation. | 61 // are given in the implementation. |
63 AudioInputCallback* callback_; | 62 AudioInputCallback* callback_; |
64 | 63 |
65 // Owned by j_audio_record_. | 64 // Owned by j_audio_record_. |
66 uint8* direct_buffer_address_; | 65 uint8* direct_buffer_address_; |
67 | 66 |
68 scoped_ptr<media::AudioBus> audio_bus_; | |
69 int bytes_per_sample_; | |
70 | |
71 DISALLOW_COPY_AND_ASSIGN(AudioRecordInputStream); | 67 DISALLOW_COPY_AND_ASSIGN(AudioRecordInputStream); |
72 }; | 68 }; |
73 | 69 |
74 } // namespace media | 70 } // namespace media |
75 | 71 |
76 #endif // MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ | 72 #endif // MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ |
OLD | NEW |