| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 JOW(void, PeerConnection_nativeNewGetStats) | 281 JOW(void, PeerConnection_nativeNewGetStats) |
| 282 (JNIEnv* jni, jobject j_pc, jobject j_callback) { | 282 (JNIEnv* jni, jobject j_pc, jobject j_callback) { |
| 283 rtc::scoped_refptr<RTCStatsCollectorCallbackWrapper> callback( | 283 rtc::scoped_refptr<RTCStatsCollectorCallbackWrapper> callback( |
| 284 new rtc::RefCountedObject<RTCStatsCollectorCallbackWrapper>(jni, | 284 new rtc::RefCountedObject<RTCStatsCollectorCallbackWrapper>(jni, |
| 285 j_callback)); | 285 j_callback)); |
| 286 ExtractNativePC(jni, j_pc)->GetStats(callback); | 286 ExtractNativePC(jni, j_pc)->GetStats(callback); |
| 287 } | 287 } |
| 288 | 288 |
| 289 JOW(jboolean, PeerConnection_setBitrate) |
| 290 (JNIEnv* jni, jobject j_pc, jobject j_min, jobject j_current, jobject j_max) { |
| 291 webrtc::PeerConnectionInterface::BitrateParameters params; |
| 292 jclass j_integer_class = jni->FindClass("java/lang/Integer"); |
| 293 jmethodID int_value_id = GetMethodID(jni, j_integer_class, "intValue", "()I"); |
| 294 if (!IsNull(jni, j_min)) { |
| 295 int min_value = jni->CallIntMethod(j_min, int_value_id); |
| 296 params.min_bitrate_bps = rtc::Optional<int>(min_value); |
| 297 } |
| 298 if (!IsNull(jni, j_current)) { |
| 299 int current_value = jni->CallIntMethod(j_current, int_value_id); |
| 300 params.current_bitrate_bps = rtc::Optional<int>(current_value); |
| 301 } |
| 302 if (!IsNull(jni, j_max)) { |
| 303 int max_value = jni->CallIntMethod(j_max, int_value_id); |
| 304 params.max_bitrate_bps = rtc::Optional<int>(max_value); |
| 305 } |
| 306 return ExtractNativePC(jni, j_pc)->SetBitrate(params).ok(); |
| 307 } |
| 308 |
| 289 JOW(bool, PeerConnection_nativeStartRtcEventLog) | 309 JOW(bool, PeerConnection_nativeStartRtcEventLog) |
| 290 (JNIEnv* jni, jobject j_pc, int file_descriptor, int max_size_bytes) { | 310 (JNIEnv* jni, jobject j_pc, int file_descriptor, int max_size_bytes) { |
| 291 return ExtractNativePC(jni, j_pc)->StartRtcEventLog(file_descriptor, | 311 return ExtractNativePC(jni, j_pc)->StartRtcEventLog(file_descriptor, |
| 292 max_size_bytes); | 312 max_size_bytes); |
| 293 } | 313 } |
| 294 | 314 |
| 295 JOW(void, PeerConnection_nativeStopRtcEventLog)(JNIEnv* jni, jobject j_pc) { | 315 JOW(void, PeerConnection_nativeStopRtcEventLog)(JNIEnv* jni, jobject j_pc) { |
| 296 ExtractNativePC(jni, j_pc)->StopRtcEventLog(); | 316 ExtractNativePC(jni, j_pc)->StopRtcEventLog(); |
| 297 } | 317 } |
| 298 | 318 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 316 return JavaEnumFromIndexAndClassName(jni, "PeerConnection$IceGatheringState", | 336 return JavaEnumFromIndexAndClassName(jni, "PeerConnection$IceGatheringState", |
| 317 state); | 337 state); |
| 318 } | 338 } |
| 319 | 339 |
| 320 JOW(void, PeerConnection_close)(JNIEnv* jni, jobject j_pc) { | 340 JOW(void, PeerConnection_close)(JNIEnv* jni, jobject j_pc) { |
| 321 ExtractNativePC(jni, j_pc)->Close(); | 341 ExtractNativePC(jni, j_pc)->Close(); |
| 322 return; | 342 return; |
| 323 } | 343 } |
| 324 | 344 |
| 325 } // namespace webrtc_jni | 345 } // namespace webrtc_jni |
| OLD | NEW |