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

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

Issue 1838353004: cricket::VideoFrame cleanup. New width() and height(). Deleted GetChroma* methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: TODO comments. Formatting tweak. Created 4 years, 9 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/api/objc/RTCVideoFrame.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 0e5dd9ad6e672c607dc64f8d27bd1e18976c81f9..cfd7d3acdd3e9a4bfd25b687b41533429c056e63 100644
--- a/webrtc/api/java/jni/peerconnection_jni.cc
+++ b/webrtc/api/java/jni/peerconnection_jni.cc
@@ -771,16 +771,18 @@ class JavaVideoRendererWrapper
jobject y_buffer =
jni()->NewDirectByteBuffer(const_cast<uint8_t*>(frame->GetYPlane()),
frame->GetYPitch() * frame->GetHeight());
+ size_t chroma_size =
+ ((frame->width() + 1) / 2) * ((frame->height() + 1) / 2);
jobject u_buffer = jni()->NewDirectByteBuffer(
- const_cast<uint8_t*>(frame->GetUPlane()), frame->GetChromaSize());
+ const_cast<uint8_t*>(frame->GetUPlane()), chroma_size);
jobject v_buffer = jni()->NewDirectByteBuffer(
- const_cast<uint8_t*>(frame->GetVPlane()), frame->GetChromaSize());
+ const_cast<uint8_t*>(frame->GetVPlane()), chroma_size);
jni()->SetObjectArrayElement(planes, 0, y_buffer);
jni()->SetObjectArrayElement(planes, 1, u_buffer);
jni()->SetObjectArrayElement(planes, 2, v_buffer);
return jni()->NewObject(
*j_frame_class_, j_i420_frame_ctor_id_,
- frame->GetWidth(), frame->GetHeight(),
+ frame->width(), frame->height(),
static_cast<int>(frame->GetVideoRotation()),
strides, planes, javaShallowCopy(frame));
}
@@ -793,7 +795,7 @@ class JavaVideoRendererWrapper
jni()->SetFloatArrayRegion(sampling_matrix, 0, 16, handle->sampling_matrix);
return jni()->NewObject(
*j_frame_class_, j_texture_frame_ctor_id_,
- frame->GetWidth(), frame->GetHeight(),
+ frame->width(), frame->height(),
static_cast<int>(frame->GetVideoRotation()),
handle->oes_texture_id, sampling_matrix, javaShallowCopy(frame));
}
« no previous file with comments | « talk/app/webrtc/objc/public/RTCI420Frame.h ('k') | webrtc/api/objc/RTCVideoFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698