From d1587ad244af3388c1282a715cdf05032ba0c2fc Mon Sep 17 00:00:00 2001 From: magjed Date: Mon, 6 Mar 2017 05:20:49 -0800 Subject: [PATCH] Android HW decoder: Don't check slice_height for texture output The check: 'RTC_CHECK_GE(slice_height, height);' has been observed to fail after a reconfig. It looks like |slice_height| is still using the previous resolution. |slice_height| isn't used for texture output and hopefully this issue is texture specific. This CL only extracts and checks |slice_height| when it's actually used. BUG=b/35932686 Review-Url: https://codereview.webrtc.org/2736603003 Cr-Commit-Position: refs/heads/master@{#17065} --- webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc b/webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc index eb50e2e160..d30e94c58f 100644 --- a/webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc +++ b/webrtc/sdk/android/src/jni/androidmediadecoder_jni.cc @@ -726,10 +726,6 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs( j_color_format_field_); int width = GetIntField(jni, *j_media_codec_video_decoder_, j_width_field_); int height = GetIntField(jni, *j_media_codec_video_decoder_, j_height_field_); - int stride = GetIntField(jni, *j_media_codec_video_decoder_, j_stride_field_); - int slice_height = GetIntField(jni, *j_media_codec_video_decoder_, - j_slice_height_field_); - RTC_CHECK_GE(slice_height, height); rtc::scoped_refptr frame_buffer; int64_t presentation_timestamps_ms = 0; @@ -767,6 +763,10 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs( } else { // Extract data from Java ByteBuffer and create output yuv420 frame - // for non surface decoding only. + int stride = + GetIntField(jni, *j_media_codec_video_decoder_, j_stride_field_); + const int slice_height = + GetIntField(jni, *j_media_codec_video_decoder_, j_slice_height_field_); const int output_buffer_index = GetIntField( jni, j_decoder_output_buffer, j_info_index_field_); const int output_buffer_offset = GetIntField( @@ -782,6 +782,7 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs( decode_time_ms = GetLongField(jni, j_decoder_output_buffer, j_byte_buffer_decode_time_ms_field_); + RTC_CHECK_GE(slice_height, height); if (output_buffer_size < width * height * 3 / 2) { ALOGE << "Insufficient output buffer size: " << output_buffer_size; @@ -870,7 +871,6 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs( if (frames_decoded_ < frames_decoded_logged_) { ALOGD << "Decoder frame out # " << frames_decoded_ << ". " << width << " x " << height << - ". " << stride << " x " << slice_height << ". Color: " << color_format << ". TS: " << presentation_timestamps_ms << ". DecTime: " << (int)decode_time_ms <<