| 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 { |
| 15 namespace jni { |
| 15 | 16 |
| 16 JNI_FUNCTION_DECLARATION(jboolean, | 17 JNI_FUNCTION_DECLARATION(jboolean, |
| 17 DtmfSender_nativeCanInsertDtmf, | 18 DtmfSender_nativeCanInsertDtmf, |
| 18 JNIEnv* jni, | 19 JNIEnv* jni, |
| 19 jclass, | 20 jclass, |
| 20 jlong j_dtmf_sender_pointer) { | 21 jlong j_dtmf_sender_pointer) { |
| 21 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 22 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 22 ->CanInsertDtmf(); | 23 ->CanInsertDtmf(); |
| 23 } | 24 } |
| 24 | 25 |
| 25 JNI_FUNCTION_DECLARATION(jboolean, | 26 JNI_FUNCTION_DECLARATION(jboolean, |
| 26 DtmfSender_nativeInsertDtmf, | 27 DtmfSender_nativeInsertDtmf, |
| 27 JNIEnv* jni, | 28 JNIEnv* jni, |
| 28 jclass, | 29 jclass, |
| 29 jlong j_dtmf_sender_pointer, | 30 jlong j_dtmf_sender_pointer, |
| 30 jstring tones, | 31 jstring tones, |
| 31 jint duration, | 32 jint duration, |
| 32 jint inter_tone_gap) { | 33 jint inter_tone_gap) { |
| 33 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 34 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 34 ->InsertDtmf(JavaToStdString(jni, tones), duration, inter_tone_gap); | 35 ->InsertDtmf(JavaToStdString(jni, tones), duration, inter_tone_gap); |
| 35 } | 36 } |
| 36 | 37 |
| 37 JNI_FUNCTION_DECLARATION(jstring, | 38 JNI_FUNCTION_DECLARATION(jstring, |
| 38 DtmfSender_nativeTones, | 39 DtmfSender_nativeTones, |
| 39 JNIEnv* jni, | 40 JNIEnv* jni, |
| 40 jclass, | 41 jclass, |
| 41 jlong j_dtmf_sender_pointer) { | 42 jlong j_dtmf_sender_pointer) { |
| 42 return JavaStringFromStdString( | 43 return JavaStringFromStdString( |
| 43 jni, reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 44 jni, |
| 44 ->tones()); | 45 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->tones()); |
| 45 } | 46 } |
| 46 | 47 |
| 47 JNI_FUNCTION_DECLARATION(jint, | 48 JNI_FUNCTION_DECLARATION(jint, |
| 48 DtmfSender_nativeDuration, | 49 DtmfSender_nativeDuration, |
| 49 JNIEnv* jni, | 50 JNIEnv* jni, |
| 50 jclass, | 51 jclass, |
| 51 jlong j_dtmf_sender_pointer) { | 52 jlong j_dtmf_sender_pointer) { |
| 52 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 53 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 53 ->duration(); | 54 ->duration(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 JNI_FUNCTION_DECLARATION(jint, | 57 JNI_FUNCTION_DECLARATION(jint, |
| 57 DtmfSender_nativeInterToneGap, | 58 DtmfSender_nativeInterToneGap, |
| 58 JNIEnv* jni, | 59 JNIEnv* jni, |
| 59 jclass, | 60 jclass, |
| 60 jlong j_dtmf_sender_pointer) { | 61 jlong j_dtmf_sender_pointer) { |
| 61 return reinterpret_cast<webrtc::DtmfSenderInterface*>(j_dtmf_sender_pointer) | 62 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) |
| 62 ->inter_tone_gap(); | 63 ->inter_tone_gap(); |
| 63 } | 64 } |
| 64 | 65 |
| 65 } // namespace webrtc_jni | 66 } // namespace jni |
| 67 } // namespace webrtc |
| OLD | NEW |