OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class JavaAudioRecord { | 46 class JavaAudioRecord { |
47 public: | 47 public: |
48 JavaAudioRecord(NativeRegistration* native_registration, | 48 JavaAudioRecord(NativeRegistration* native_registration, |
49 rtc::scoped_ptr<GlobalRef> audio_track); | 49 rtc::scoped_ptr<GlobalRef> audio_track); |
50 ~JavaAudioRecord(); | 50 ~JavaAudioRecord(); |
51 | 51 |
52 int InitRecording(int sample_rate, int channels); | 52 int InitRecording(int sample_rate, int channels); |
53 bool StartRecording(); | 53 bool StartRecording(); |
54 bool StopRecording(); | 54 bool StopRecording(); |
55 bool EnableBuiltInAEC(bool enable); | 55 bool EnableBuiltInAEC(bool enable); |
| 56 bool EnableBuiltInAGC(bool enable); |
| 57 bool EnableBuiltInNS(bool enable); |
56 | 58 |
57 private: | 59 private: |
58 rtc::scoped_ptr<GlobalRef> audio_record_; | 60 rtc::scoped_ptr<GlobalRef> audio_record_; |
59 jmethodID init_recording_; | 61 jmethodID init_recording_; |
60 jmethodID start_recording_; | 62 jmethodID start_recording_; |
61 jmethodID stop_recording_; | 63 jmethodID stop_recording_; |
62 jmethodID enable_built_in_aec_; | 64 jmethodID enable_built_in_aec_; |
| 65 jmethodID enable_built_in_agc_; |
| 66 jmethodID enable_built_in_ns_; |
63 }; | 67 }; |
64 | 68 |
65 explicit AudioRecordJni(AudioManager* audio_manager); | 69 explicit AudioRecordJni(AudioManager* audio_manager); |
66 ~AudioRecordJni(); | 70 ~AudioRecordJni(); |
67 | 71 |
68 int32_t Init(); | 72 int32_t Init(); |
69 int32_t Terminate(); | 73 int32_t Terminate(); |
70 | 74 |
71 int32_t InitRecording(); | 75 int32_t InitRecording(); |
72 bool RecordingIsInitialized() const { return initialized_; } | 76 bool RecordingIsInitialized() const { return initialized_; } |
73 | 77 |
74 int32_t StartRecording(); | 78 int32_t StartRecording(); |
75 int32_t StopRecording(); | 79 int32_t StopRecording(); |
76 bool Recording() const { return recording_; } | 80 bool Recording() const { return recording_; } |
77 | 81 |
78 void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer); | 82 void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer); |
79 | 83 |
80 int32_t EnableBuiltInAEC(bool enable); | 84 int32_t EnableBuiltInAEC(bool enable); |
| 85 int32_t EnableBuiltInAGC(bool enable); |
| 86 int32_t EnableBuiltInNS(bool enable); |
81 | 87 |
82 private: | 88 private: |
83 // Called from Java side so we can cache the address of the Java-manged | 89 // Called from Java side so we can cache the address of the Java-manged |
84 // |byte_buffer| in |direct_buffer_address_|. The size of the buffer | 90 // |byte_buffer| in |direct_buffer_address_|. The size of the buffer |
85 // is also stored in |direct_buffer_capacity_in_bytes_|. | 91 // is also stored in |direct_buffer_capacity_in_bytes_|. |
86 // This method will be called by the WebRtcAudioRecord constructor, i.e., | 92 // This method will be called by the WebRtcAudioRecord constructor, i.e., |
87 // on the same thread that this object is created on. | 93 // on the same thread that this object is created on. |
88 static void JNICALL CacheDirectBufferAddress( | 94 static void JNICALL CacheDirectBufferAddress( |
89 JNIEnv* env, jobject obj, jobject byte_buffer, jlong nativeAudioRecord); | 95 JNIEnv* env, jobject obj, jobject byte_buffer, jlong nativeAudioRecord); |
90 void OnCacheDirectBufferAddress(JNIEnv* env, jobject byte_buffer); | 96 void OnCacheDirectBufferAddress(JNIEnv* env, jobject byte_buffer); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 bool recording_; | 154 bool recording_; |
149 | 155 |
150 // Raw pointer handle provided to us in AttachAudioBuffer(). Owned by the | 156 // Raw pointer handle provided to us in AttachAudioBuffer(). Owned by the |
151 // AudioDeviceModuleImpl class and called by AudioDeviceModuleImpl::Create(). | 157 // AudioDeviceModuleImpl class and called by AudioDeviceModuleImpl::Create(). |
152 AudioDeviceBuffer* audio_device_buffer_; | 158 AudioDeviceBuffer* audio_device_buffer_; |
153 }; | 159 }; |
154 | 160 |
155 } // namespace webrtc | 161 } // namespace webrtc |
156 | 162 |
157 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_RECORD_JNI_H_ | 163 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_RECORD_JNI_H_ |
OLD | NEW |