[vlc-commits] mediacodec: Pass the aspect ratio values through from the packetizer
Martin Storsjö
git at videolan.org
Fri Feb 7 19:44:36 CET 2014
vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Feb 6 14:52:07 2014 +0200| [a181625435216e69cf14f64d172d66fe6fbad05a] | committer: Martin Storsjö
mediacodec: Pass the aspect ratio values through from the packetizer
There is no way in the MediaCodec API for the decoder to signal
these values to the caller, at least none that is publicly
documented.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a181625435216e69cf14f64d172d66fe6fbad05a
---
modules/codec/omxil/android_mediacodec.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index 499f1f5..c36bdc9 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -692,6 +692,15 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block)
return NULL;
}
+ /* Use the aspect ratio provided by the input (ie read from packetizer).
+ * Don't check the current value of the aspect ratio in fmt_out, since we
+ * want to allow changes in it to propagate. */
+ if (p_dec->fmt_in.video.i_sar_num != 0 && p_dec->fmt_in.video.i_sar_den != 0)
+ {
+ p_dec->fmt_out.video.i_sar_num = p_dec->fmt_in.video.i_sar_num;
+ p_dec->fmt_out.video.i_sar_den = p_dec->fmt_in.video.i_sar_den;
+ }
+
jlong timeout = 0;
const int max_polling_attempts = 50;
int attempts = 0;
More information about the vlc-commits
mailing list