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

Unified Diff: webrtc/api/java/jni/peerconnection_jni.cc

Issue 1923903002: Reland of Delete cricket::VideoFrame methods GetYPlane and GetYPitch. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/objc/public/RTCI420Frame.h ('k') | webrtc/media/base/fakevideorenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/jni/peerconnection_jni.cc
diff --git a/webrtc/api/java/jni/peerconnection_jni.cc b/webrtc/api/java/jni/peerconnection_jni.cc
index cbdcbe0285150fb45dbf5324c0d4bcaef2d7c83b..f7ba6dc117c81b87c6492780386605c738482bb3 100644
--- a/webrtc/api/java/jni/peerconnection_jni.cc
+++ b/webrtc/api/java/jni/peerconnection_jni.cc
@@ -763,20 +763,23 @@
jobject CricketToJavaI420Frame(const cricket::VideoFrame* frame) {
jintArray strides = jni()->NewIntArray(3);
jint* strides_array = jni()->GetIntArrayElements(strides, NULL);
- strides_array[0] = frame->GetYPitch();
- strides_array[1] = frame->GetUPitch();
- strides_array[2] = frame->GetVPitch();
+ strides_array[0] = frame->video_frame_buffer()->StrideY();
+ strides_array[1] = frame->video_frame_buffer()->StrideU();
+ strides_array[2] = frame->video_frame_buffer()->StrideV();
jni()->ReleaseIntArrayElements(strides, strides_array, 0);
jobjectArray planes = jni()->NewObjectArray(3, *j_byte_buffer_class_, NULL);
- jobject y_buffer =
- jni()->NewDirectByteBuffer(const_cast<uint8_t*>(frame->GetYPlane()),
- frame->GetYPitch() * frame->GetHeight());
+ jobject y_buffer = jni()->NewDirectByteBuffer(
+ const_cast<uint8_t*>(frame->video_frame_buffer()->DataY()),
+ frame->video_frame_buffer()->StrideY() *
+ frame->video_frame_buffer()->height());
size_t chroma_size =
((frame->width() + 1) / 2) * ((frame->height() + 1) / 2);
jobject u_buffer = jni()->NewDirectByteBuffer(
- const_cast<uint8_t*>(frame->GetUPlane()), chroma_size);
+ const_cast<uint8_t*>(frame->video_frame_buffer()->DataU()),
+ chroma_size);
jobject v_buffer = jni()->NewDirectByteBuffer(
- const_cast<uint8_t*>(frame->GetVPlane()), chroma_size);
+ const_cast<uint8_t*>(frame->video_frame_buffer()->DataV()),
+ chroma_size);
jni()->SetObjectArrayElement(planes, 0, y_buffer);
jni()->SetObjectArrayElement(planes, 1, u_buffer);
jni()->SetObjectArrayElement(planes, 2, v_buffer);
« no previous file with comments | « talk/app/webrtc/objc/public/RTCI420Frame.h ('k') | webrtc/media/base/fakevideorenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698