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

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

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
« no previous file with comments | « webrtc/sdk/android/src/jni/pc/rtpsender_jni.cc ('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 (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 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 28 matching lines...) Expand all
39 jobject j_wrapped_native_i420_buffer = jni->NewObject( 39 jobject j_wrapped_native_i420_buffer = jni->NewObject(
40 j_wrapped_native_i420_buffer_class, j_wrapped_native_i420_buffer_ctor_id, 40 j_wrapped_native_i420_buffer_class, j_wrapped_native_i420_buffer_ctor_id,
41 i420_buffer->width(), i420_buffer->height(), y_buffer, 41 i420_buffer->width(), i420_buffer->height(), y_buffer,
42 i420_buffer->StrideY(), u_buffer, i420_buffer->StrideU(), v_buffer, 42 i420_buffer->StrideY(), u_buffer, i420_buffer->StrideU(), v_buffer,
43 i420_buffer->StrideV(), jlongFromPointer(i420_buffer.get())); 43 i420_buffer->StrideV(), jlongFromPointer(i420_buffer.get()));
44 CHECK_EXCEPTION(jni); 44 CHECK_EXCEPTION(jni);
45 45
46 return j_wrapped_native_i420_buffer; 46 return j_wrapped_native_i420_buffer;
47 } 47 }
48 48
49 JNI_FUNCTION_DECLARATION(void,
50 WrappedNativeI420Buffer_nativeAddRef,
51 JNIEnv* jni,
52 jclass,
53 jlong j_buffer_pointer) {
54 reinterpret_cast<webrtc::VideoFrameBuffer*>(j_buffer_pointer)->AddRef();
55 }
56
57 JNI_FUNCTION_DECLARATION(void,
58 WrappedNativeI420Buffer_nativeRelease,
59 JNIEnv* jni,
60 jclass,
61 jlong j_buffer_pointer) {
62 reinterpret_cast<webrtc::VideoFrameBuffer*>(j_buffer_pointer)->Release();
63 }
64
65 } // namespace webrtc_jni 49 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « webrtc/sdk/android/src/jni/pc/rtpsender_jni.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698