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; |
15 class AudioManagerAndroid; | 16 class AudioManagerAndroid; |
16 | 17 |
17 // Implements PCM audio input support for Android using the Java AudioRecord | 18 // Implements PCM audio input support for Android using the Java AudioRecord |
18 // interface. Most of the work is done by its Java counterpart in | 19 // 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 | 20 // 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 | 21 // thread but recorded audio buffers are delivered on a thread managed by |
21 // the Java class. | 22 // the Java class. |
22 // | 23 // |
23 // The Java class makes use of AudioEffect features which are first available | 24 // 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. | 25 // 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... |
57 base::android::ScopedJavaGlobalRef<jobject> j_audio_record_; | 58 base::android::ScopedJavaGlobalRef<jobject> j_audio_record_; |
58 | 59 |
59 // This is the only member accessed by both the Audio Manager and Java | 60 // This is the only member accessed by both the Audio Manager and Java |
60 // threads. Explanations for why we do not require explicit synchronization | 61 // threads. Explanations for why we do not require explicit synchronization |
61 // are given in the implementation. | 62 // are given in the implementation. |
62 AudioInputCallback* callback_; | 63 AudioInputCallback* callback_; |
63 | 64 |
64 // Owned by j_audio_record_. | 65 // Owned by j_audio_record_. |
65 uint8* direct_buffer_address_; | 66 uint8* direct_buffer_address_; |
66 | 67 |
| 68 scoped_ptr<media::AudioBus> audio_bus_; |
| 69 int bytes_per_sample_; |
| 70 |
67 DISALLOW_COPY_AND_ASSIGN(AudioRecordInputStream); | 71 DISALLOW_COPY_AND_ASSIGN(AudioRecordInputStream); |
68 }; | 72 }; |
69 | 73 |
70 } // namespace media | 74 } // namespace media |
71 | 75 |
72 #endif // MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ | 76 #endif // MEDIA_AUDIO_ANDROID_AUDIO_RECORD_INPUT_H_ |
OLD | NEW |