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

Side by Side Diff: webrtc/sdk/android/api/org/webrtc/RtpSender.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 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return dtmfSender; 75 return dtmfSender;
76 } 76 }
77 77
78 public void dispose() { 78 public void dispose() {
79 if (dtmfSender != null) { 79 if (dtmfSender != null) {
80 dtmfSender.dispose(); 80 dtmfSender.dispose();
81 } 81 }
82 if (cachedTrack != null && ownsTrack) { 82 if (cachedTrack != null && ownsTrack) {
83 cachedTrack.dispose(); 83 cachedTrack.dispose();
84 } 84 }
85 free(nativeRtpSender); 85 JniCommon.nativeReleaseRef(nativeRtpSender);
86 } 86 }
87 87
88 private static native boolean nativeSetTrack(long nativeRtpSender, long native Track); 88 private static native boolean nativeSetTrack(long nativeRtpSender, long native Track);
89 89
90 // This should increment the reference count of the track. 90 // This should increment the reference count of the track.
91 // Will be released in dispose() or setTrack(). 91 // Will be released in dispose() or setTrack().
92 private static native long nativeGetTrack(long nativeRtpSender); 92 private static native long nativeGetTrack(long nativeRtpSender);
93 93
94 // This should increment the reference count of the DTMF sender. 94 // This should increment the reference count of the DTMF sender.
95 // Will be released in dispose(). 95 // Will be released in dispose().
96 private static native long nativeGetDtmfSender(long nativeRtpSender); 96 private static native long nativeGetDtmfSender(long nativeRtpSender);
97 97
98 private static native boolean nativeSetParameters(long nativeRtpSender, RtpPar ameters parameters); 98 private static native boolean nativeSetParameters(long nativeRtpSender, RtpPar ameters parameters);
99 99
100 private static native RtpParameters nativeGetParameters(long nativeRtpSender); 100 private static native RtpParameters nativeGetParameters(long nativeRtpSender);
101 101
102 private static native String nativeId(long nativeRtpSender); 102 private static native String nativeId(long nativeRtpSender);
103
104 private static native void free(long nativeRtpSender);
105 }; 103 };
OLDNEW
« no previous file with comments | « webrtc/sdk/android/api/org/webrtc/RtpReceiver.java ('k') | webrtc/sdk/android/src/java/org/webrtc/JniCommon.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698