| 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/mediastreaminterface.h" | 11 #include "webrtc/api/mediastreaminterface.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(jstring, | 17 JNI_FUNCTION_DECLARATION(jstring, |
| 17 MediaStreamTrack_nativeId, | 18 MediaStreamTrack_nativeId, |
| 18 JNIEnv* jni, | 19 JNIEnv* jni, |
| 19 jclass, | 20 jclass, |
| 20 jlong j_p) { | 21 jlong j_p) { |
| 21 return JavaStringFromStdString( | 22 return JavaStringFromStdString( |
| 22 jni, reinterpret_cast<webrtc::MediaStreamTrackInterface*>(j_p)->id()); | 23 jni, reinterpret_cast<MediaStreamTrackInterface*>(j_p)->id()); |
| 23 } | 24 } |
| 24 | 25 |
| 25 JNI_FUNCTION_DECLARATION(jstring, | 26 JNI_FUNCTION_DECLARATION(jstring, |
| 26 MediaStreamTrack_nativeKind, | 27 MediaStreamTrack_nativeKind, |
| 27 JNIEnv* jni, | 28 JNIEnv* jni, |
| 28 jclass, | 29 jclass, |
| 29 jlong j_p) { | 30 jlong j_p) { |
| 30 return JavaStringFromStdString( | 31 return JavaStringFromStdString( |
| 31 jni, reinterpret_cast<webrtc::MediaStreamTrackInterface*>(j_p)->kind()); | 32 jni, reinterpret_cast<MediaStreamTrackInterface*>(j_p)->kind()); |
| 32 } | 33 } |
| 33 | 34 |
| 34 JNI_FUNCTION_DECLARATION(jboolean, | 35 JNI_FUNCTION_DECLARATION(jboolean, |
| 35 MediaStreamTrack_nativeEnabled, | 36 MediaStreamTrack_nativeEnabled, |
| 36 JNIEnv* jni, | 37 JNIEnv* jni, |
| 37 jclass, | 38 jclass, |
| 38 jlong j_p) { | 39 jlong j_p) { |
| 39 return reinterpret_cast<webrtc::MediaStreamTrackInterface*>(j_p)->enabled(); | 40 return reinterpret_cast<MediaStreamTrackInterface*>(j_p)->enabled(); |
| 40 } | 41 } |
| 41 | 42 |
| 42 JNI_FUNCTION_DECLARATION(jobject, | 43 JNI_FUNCTION_DECLARATION(jobject, |
| 43 MediaStreamTrack_nativeState, | 44 MediaStreamTrack_nativeState, |
| 44 JNIEnv* jni, | 45 JNIEnv* jni, |
| 45 jclass, | 46 jclass, |
| 46 jlong j_p) { | 47 jlong j_p) { |
| 47 return JavaEnumFromIndexAndClassName( | 48 return JavaEnumFromIndexAndClassName( |
| 48 jni, "MediaStreamTrack$State", | 49 jni, "MediaStreamTrack$State", |
| 49 reinterpret_cast<webrtc::MediaStreamTrackInterface*>(j_p)->state()); | 50 reinterpret_cast<MediaStreamTrackInterface*>(j_p)->state()); |
| 50 } | 51 } |
| 51 | 52 |
| 52 JNI_FUNCTION_DECLARATION(jboolean, | 53 JNI_FUNCTION_DECLARATION(jboolean, |
| 53 MediaStreamTrack_nativeSetEnabled, | 54 MediaStreamTrack_nativeSetEnabled, |
| 54 JNIEnv* jni, | 55 JNIEnv* jni, |
| 55 jclass, | 56 jclass, |
| 56 jlong j_p, | 57 jlong j_p, |
| 57 jboolean enabled) { | 58 jboolean enabled) { |
| 58 return reinterpret_cast<webrtc::MediaStreamTrackInterface*>(j_p)->set_enabled( | 59 return reinterpret_cast<MediaStreamTrackInterface*>(j_p)->set_enabled( |
| 59 enabled); | 60 enabled); |
| 60 } | 61 } |
| 61 | 62 |
| 62 } // namespace webrtc_jni | 63 } // namespace jni |
| 64 } // namespace webrtc |
| OLD | NEW |