Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: webrtc/sdk/android/src/jni/pc/peerconnection_jni.cc

Issue 2868413004: JNI wrapper for PeerConnection::SetBitrate. (Closed)
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/sdk/android/instrumentationtests/src/org/webrtc/PeerConnectionTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/sdk/android/instrumentationtests/src/org/webrtc/PeerConnectionTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698