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

Side by Side Diff: webrtc/api/android/jni/peerconnection_jni.cc

Issue 2287223002: Reland of Delete method cricket::VideoFrame::Copy. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 | « talk/app/webrtc/objc/RTCI420Frame.mm ('k') | webrtc/media/base/videoframe.h » ('j') | 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 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 // VideoRenderer.renderFrameDone(). 763 // VideoRenderer.renderFrameDone().
764 jni()->CallVoidMethod(*j_callbacks_, j_render_frame_id_, j_frame); 764 jni()->CallVoidMethod(*j_callbacks_, j_render_frame_id_, j_frame);
765 CHECK_EXCEPTION(jni()); 765 CHECK_EXCEPTION(jni());
766 } 766 }
767 767
768 private: 768 private:
769 // Make a shallow copy of |frame| to be used with Java. The callee has 769 // Make a shallow copy of |frame| to be used with Java. The callee has
770 // ownership of the frame, and the frame should be released with 770 // ownership of the frame, and the frame should be released with
771 // VideoRenderer.releaseNativeFrame(). 771 // VideoRenderer.releaseNativeFrame().
772 static jlong javaShallowCopy(const cricket::VideoFrame* frame) { 772 static jlong javaShallowCopy(const cricket::VideoFrame* frame) {
773 return jlongFromPointer(frame->Copy()); 773 return jlongFromPointer(new cricket::WebRtcVideoFrame(
774 frame->video_frame_buffer(), frame->rotation(), frame->timestamp_us()));
774 } 775 }
775 776
776 // Return a VideoRenderer.I420Frame referring to the data in |frame|. 777 // Return a VideoRenderer.I420Frame referring to the data in |frame|.
777 jobject CricketToJavaI420Frame(const cricket::VideoFrame* frame) { 778 jobject CricketToJavaI420Frame(const cricket::VideoFrame* frame) {
778 jintArray strides = jni()->NewIntArray(3); 779 jintArray strides = jni()->NewIntArray(3);
779 jint* strides_array = jni()->GetIntArrayElements(strides, NULL); 780 jint* strides_array = jni()->GetIntArrayElements(strides, NULL);
780 strides_array[0] = frame->video_frame_buffer()->StrideY(); 781 strides_array[0] = frame->video_frame_buffer()->StrideY();
781 strides_array[1] = frame->video_frame_buffer()->StrideU(); 782 strides_array[1] = frame->video_frame_buffer()->StrideU();
782 strides_array[2] = frame->video_frame_buffer()->StrideV(); 783 strides_array[2] = frame->video_frame_buffer()->StrideV();
783 jni()->ReleaseIntArrayElements(strides, strides_array, 0); 784 jni()->ReleaseIntArrayElements(strides, strides_array, 0);
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2348 return JavaStringFromStdString( 2349 return JavaStringFromStdString(
2349 jni, 2350 jni,
2350 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2351 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2351 } 2352 }
2352 2353
2353 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2354 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2354 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2355 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2355 } 2356 }
2356 2357
2357 } // namespace webrtc_jni 2358 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « talk/app/webrtc/objc/RTCI420Frame.mm ('k') | webrtc/media/base/videoframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698