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

Side by Side Diff: webrtc/sdk/android/api/org/webrtc/PeerConnection.java

Issue 3003213002: Android: Add common function for adding/releasing native reference (Closed)
Patch Set: Rebase Created 3 years, 3 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
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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 398 }
399 localStreams.clear(); 399 localStreams.clear();
400 for (RtpSender sender : senders) { 400 for (RtpSender sender : senders) {
401 sender.dispose(); 401 sender.dispose();
402 } 402 }
403 senders.clear(); 403 senders.clear();
404 for (RtpReceiver receiver : receivers) { 404 for (RtpReceiver receiver : receivers) {
405 receiver.dispose(); 405 receiver.dispose();
406 } 406 }
407 receivers.clear(); 407 receivers.clear();
408 freePeerConnection(nativePeerConnection); 408 JniCommon.nativeReleaseRef(nativePeerConnection);
409 freeObserver(nativeObserver); 409 freeObserver(nativeObserver);
410 } 410 }
411 411
412 private static native void freePeerConnection(long nativePeerConnection);
413
414 private static native void freeObserver(long nativeObserver); 412 private static native void freeObserver(long nativeObserver);
415 413
416 public native boolean nativeSetConfiguration(RTCConfiguration config, long nat iveObserver); 414 public native boolean nativeSetConfiguration(RTCConfiguration config, long nat iveObserver);
417 415
418 private native boolean nativeAddIceCandidate( 416 private native boolean nativeAddIceCandidate(
419 String sdpMid, int sdpMLineIndex, String iceCandidateSdp); 417 String sdpMid, int sdpMLineIndex, String iceCandidateSdp);
420 418
421 private native boolean nativeRemoveIceCandidates(final IceCandidate[] candidat es); 419 private native boolean nativeRemoveIceCandidates(final IceCandidate[] candidat es);
422 420
423 private native boolean nativeAddLocalStream(long nativeStream); 421 private native boolean nativeAddLocalStream(long nativeStream);
424 422
425 private native void nativeRemoveLocalStream(long nativeStream); 423 private native void nativeRemoveLocalStream(long nativeStream);
426 424
427 private native boolean nativeOldGetStats(StatsObserver observer, long nativeTr ack); 425 private native boolean nativeOldGetStats(StatsObserver observer, long nativeTr ack);
428 426
429 private native void nativeNewGetStats(RTCStatsCollectorCallback callback); 427 private native void nativeNewGetStats(RTCStatsCollectorCallback callback);
430 428
431 private native RtpSender nativeCreateSender(String kind, String stream_id); 429 private native RtpSender nativeCreateSender(String kind, String stream_id);
432 430
433 private native List<RtpSender> nativeGetSenders(); 431 private native List<RtpSender> nativeGetSenders();
434 432
435 private native List<RtpReceiver> nativeGetReceivers(); 433 private native List<RtpReceiver> nativeGetReceivers();
436 434
437 private native boolean nativeStartRtcEventLog(int file_descriptor, int max_siz e_bytes); 435 private native boolean nativeStartRtcEventLog(int file_descriptor, int max_siz e_bytes);
438 436
439 private native void nativeStopRtcEventLog(); 437 private native void nativeStopRtcEventLog();
440 } 438 }
OLDNEW
« no previous file with comments | « webrtc/sdk/android/api/org/webrtc/MediaStreamTrack.java ('k') | webrtc/sdk/android/api/org/webrtc/RtpReceiver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698