| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 |
| 11 #include "webrtc/api/dtmfsenderinterface.h" | 11 #include "webrtc/api/dtmfsenderinterface.h" |
| 12 #include "webrtc/sdk/android/src/jni/jni_helpers.h" | 12 #include "webrtc/sdk/android/src/jni/jni_helpers.h" |
| 13 | 13 |
| 14 namespace webrtc_jni { | 14 namespace webrtc_jni { |
| 15 | 15 |
| 16 JOW(jboolean, DtmfSender_nativeCanInsertDtmf) | 16 JNI_FUNCTION_DECLARATION(jboolean, |
| 17 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { | 17 DtmfSender_nativeCanInsertDtmf, |
| 18 JNIEnv* jni, |
| 19 jclass, |
| 20 jlong j_dtmf_sender_pointer) { |
| 18 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 21 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 19 ->CanInsertDtmf(); | 22 ->CanInsertDtmf(); |
| 20 } | 23 } |
| 21 | 24 |
| 22 JOW(jboolean, DtmfSender_nativeInsertDtmf) | 25 JNI_FUNCTION_DECLARATION(jboolean, |
| 23 (JNIEnv* jni, | 26 DtmfSender_nativeInsertDtmf, |
| 24 jclass, | 27 JNIEnv* jni, |
| 25 jlong j_dtmf_sender_pointer, | 28 jclass, |
| 26 jstring tones, | 29 jlong j_dtmf_sender_pointer, |
| 27 jint duration, | 30 jstring tones, |
| 28 jint inter_tone_gap) { | 31 jint duration, |
| 32 jint inter_tone_gap) { |
| 29 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 33 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 30 ->InsertDtmf(JavaToStdString(jni, tones), duration, inter_tone_gap); | 34 ->InsertDtmf(JavaToStdString(jni, tones), duration, inter_tone_gap); |
| 31 } | 35 } |
| 32 | 36 |
| 33 JOW(jstring, DtmfSender_nativeTones) | 37 JNI_FUNCTION_DECLARATION(jstring, |
| 34 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { | 38 DtmfSender_nativeTones, |
| 39 JNIEnv* jni, |
| 40 jclass, |
| 41 jlong j_dtmf_sender_pointer) { |
| 35 return JavaStringFromStdString( | 42 return JavaStringFromStdString( |
| 36 jni, reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 43 jni, reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 37 ->tones()); | 44 ->tones()); |
| 38 } | 45 } |
| 39 | 46 |
| 40 JOW(jint, DtmfSender_nativeDuration) | 47 JNI_FUNCTION_DECLARATION(jint, |
| 41 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { | 48 DtmfSender_nativeDuration, |
| 49 JNIEnv* jni, |
| 50 jclass, |
| 51 jlong j_dtmf_sender_pointer) { |
| 42 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 52 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 43 ->duration(); | 53 ->duration(); |
| 44 } | 54 } |
| 45 | 55 |
| 46 JOW(jint, DtmfSender_nativeInterToneGap) | 56 JNI_FUNCTION_DECLARATION(jint, |
| 47 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { | 57 DtmfSender_nativeInterToneGap, |
| 58 JNIEnv* jni, |
| 59 jclass, |
| 60 jlong j_dtmf_sender_pointer) { |
| 48 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 61 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 49 ->inter_tone_gap(); | 62 ->inter_tone_gap(); |
| 50 } | 63 } |
| 51 | 64 |
| 52 JOW(void, DtmfSender_free) | 65 JNI_FUNCTION_DECLARATION(void, |
| 53 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { | 66 DtmfSender_free, |
| 67 JNIEnv* jni, |
| 68 jclass, |
| 69 jlong j_dtmf_sender_pointer) { |
| 54 reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 70 reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 55 ->Release(); | 71 ->Release(); |
| 56 } | 72 } |
| 57 | 73 |
| 58 } // namespace webrtc_jni | 74 } // namespace webrtc_jni |
| OLD | NEW |