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

Side by Side Diff: webrtc/sdk/android/src/java/org/webrtc/WrappedNativeI420Buffer.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 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 @Override 84 @Override
85 public VideoFrame.I420Buffer toI420() { 85 public VideoFrame.I420Buffer toI420() {
86 retain(); 86 retain();
87 return this; 87 return this;
88 } 88 }
89 89
90 @Override 90 @Override
91 public void retain() { 91 public void retain() {
92 nativeAddRef(nativeBuffer); 92 JniCommon.nativeAddRef(nativeBuffer);
93 } 93 }
94 94
95 @Override 95 @Override
96 public void release() { 96 public void release() {
97 nativeRelease(nativeBuffer); 97 JniCommon.nativeReleaseRef(nativeBuffer);
98 } 98 }
99 99
100 @Override 100 @Override
101 public VideoFrame.Buffer cropAndScale( 101 public VideoFrame.Buffer cropAndScale(
102 int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int s caleHeight) { 102 int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int s caleHeight) {
103 return VideoFrame.cropAndScaleI420( 103 return VideoFrame.cropAndScaleI420(
104 this, cropX, cropY, cropWidth, cropHeight, scaleWidth, scaleHeight); 104 this, cropX, cropY, cropWidth, cropHeight, scaleWidth, scaleHeight);
105 } 105 }
106
107 private static native long nativeAddRef(long nativeBuffer);
108 private static native long nativeRelease(long nativeBuffer);
109 } 106 }
OLDNEW
« no previous file with comments | « webrtc/sdk/android/src/java/org/webrtc/JniCommon.java ('k') | webrtc/sdk/android/src/jni/jni_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698