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

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

Issue 1767733002: Fix incorrect stride information reported by some HW decoders. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/jni/androidmediadecoder_jni.cc
diff --git a/webrtc/api/java/jni/androidmediadecoder_jni.cc b/webrtc/api/java/jni/androidmediadecoder_jni.cc
index 7c303e8fc311eeefb0a8bb4610047230e74cba42..b65300a50e9ff5ba4c9ce2f61edfd3b2c739acc9 100644
--- a/webrtc/api/java/jni/androidmediadecoder_jni.cc
+++ b/webrtc/api/java/jni/androidmediadecoder_jni.cc
@@ -710,6 +710,12 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs(
ALOGE << "Insufficient output buffer size: " << output_buffer_size;
return false;
}
+ if (output_buffer_size < stride * height * 3 / 2 &&
+ slice_height == height && stride > width) {
+ // Some codecs (Exynos) incorrectly report stride information for
+ // output byte buffer, so actual stride value need to be corrected.
+ stride = output_buffer_size * 2 / (height * 3);
+ }
jobjectArray output_buffers = reinterpret_cast<jobjectArray>(GetObjectField(
jni, *j_media_codec_video_decoder_, j_output_buffers_field_));
jobject output_buffer =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698