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

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: 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 (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 JOW(void, WrappedNativeI420Buffer_nativeAddRef)
50 (JNIEnv* jni, jclass, jlong j_buffer_pointer) {
51 reinterpret_cast<webrtc::VideoFrameBuffer*>(j_buffer_pointer)->AddRef();
52 }
53
54 JOW(void, WrappedNativeI420Buffer_nativeRelease)
55 (JNIEnv* jni, jclass, jlong j_buffer_pointer) {
56 reinterpret_cast<webrtc::VideoFrameBuffer*>(j_buffer_pointer)->Release();
57 }
58
59 } // namespace webrtc_jni 49 } // namespace webrtc_jni
OLDNEW
« webrtc/sdk/android/src/jni/jni_helpers.cc ('K') | « 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