| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 JOW(void, DataChannel_unregisterObserverNative)( | 849 JOW(void, DataChannel_unregisterObserverNative)( |
| 850 JNIEnv* jni, jobject j_dc, jlong native_observer) { | 850 JNIEnv* jni, jobject j_dc, jlong native_observer) { |
| 851 ExtractNativeDC(jni, j_dc)->UnregisterObserver(); | 851 ExtractNativeDC(jni, j_dc)->UnregisterObserver(); |
| 852 delete reinterpret_cast<DataChannelObserverWrapper*>(native_observer); | 852 delete reinterpret_cast<DataChannelObserverWrapper*>(native_observer); |
| 853 } | 853 } |
| 854 | 854 |
| 855 JOW(jstring, DataChannel_label)(JNIEnv* jni, jobject j_dc) { | 855 JOW(jstring, DataChannel_label)(JNIEnv* jni, jobject j_dc) { |
| 856 return JavaStringFromStdString(jni, ExtractNativeDC(jni, j_dc)->label()); | 856 return JavaStringFromStdString(jni, ExtractNativeDC(jni, j_dc)->label()); |
| 857 } | 857 } |
| 858 | 858 |
| 859 JOW(jint, DataChannel_id)(JNIEnv* jni, jobject j_dc) { |
| 860 int id = ExtractNativeDC(jni, j_dc)->id(); |
| 861 RTC_CHECK_LE(id, std::numeric_limits<int32_t>::max()) |
| 862 << "id overflowed jint!"; |
| 863 return static_cast<jint>(id); |
| 864 } |
| 865 |
| 859 JOW(jobject, DataChannel_state)(JNIEnv* jni, jobject j_dc) { | 866 JOW(jobject, DataChannel_state)(JNIEnv* jni, jobject j_dc) { |
| 860 return JavaEnumFromIndex( | 867 return JavaEnumFromIndex( |
| 861 jni, "DataChannel$State", ExtractNativeDC(jni, j_dc)->state()); | 868 jni, "DataChannel$State", ExtractNativeDC(jni, j_dc)->state()); |
| 862 } | 869 } |
| 863 | 870 |
| 864 JOW(jlong, DataChannel_bufferedAmount)(JNIEnv* jni, jobject j_dc) { | 871 JOW(jlong, DataChannel_bufferedAmount)(JNIEnv* jni, jobject j_dc) { |
| 865 uint64_t buffered_amount = ExtractNativeDC(jni, j_dc)->buffered_amount(); | 872 uint64_t buffered_amount = ExtractNativeDC(jni, j_dc)->buffered_amount(); |
| 866 RTC_CHECK_LE(buffered_amount, std::numeric_limits<int64_t>::max()) | 873 RTC_CHECK_LE(buffered_amount, std::numeric_limits<int64_t>::max()) |
| 867 << "buffered_amount overflowed jlong!"; | 874 << "buffered_amount overflowed jlong!"; |
| 868 return static_cast<jlong>(buffered_amount); | 875 return static_cast<jlong>(buffered_amount); |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2399 return JavaStringFromStdString( | 2406 return JavaStringFromStdString( |
| 2400 jni, | 2407 jni, |
| 2401 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2408 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
| 2402 } | 2409 } |
| 2403 | 2410 |
| 2404 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2411 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
| 2405 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2412 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
| 2406 } | 2413 } |
| 2407 | 2414 |
| 2408 } // namespace webrtc_jni | 2415 } // namespace webrtc_jni |
| OLD | NEW |