[vlc-commits] mediacodec: Use the input aspect ratio when sizing the direct rendering surface

Martin Storsjö git at videolan.org
Fri Feb 7 19:44:37 CET 2014


vlc | branch: master | Martin Storsjö <martin at martin.st> | Thu Feb  6 14:58:07 2014 +0200| [a50f751742a9122d29963462360a209931466485] | committer: Martin Storsjö

mediacodec: Use the input aspect ratio when sizing the direct rendering surface

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a50f751742a9122d29963462360a209931466485
---

 modules/codec/omxil/android_mediacodec.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index c36bdc9..e7109d2 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -619,9 +619,14 @@ static void GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t **pp_pic)
             int crop_bottom     = GET_INTEGER(format, "crop-bottom");
 
             const char *name = "unknown";
-            if (p_sys->direct_rendering)
-                jni_SetAndroidSurfaceSizeEnv(env, width, height, width, height, 1, 1);
-            else
+            if (p_sys->direct_rendering) {
+                int sar_num = 1, sar_den = 1;
+                if (p_dec->fmt_in.video.i_sar_num != 0 && p_dec->fmt_in.video.i_sar_den != 0) {
+                    sar_num = p_dec->fmt_in.video.i_sar_num;
+                    sar_den = p_dec->fmt_in.video.i_sar_den;
+                }
+                jni_SetAndroidSurfaceSizeEnv(env, width, height, width, height, sar_num, sar_den);
+            } else
                 GetVlcChromaFormat(p_sys->pixel_format, &p_dec->fmt_out.i_codec, &name);
 
             msg_Dbg(p_dec, "output: %d %s, %dx%d stride %d %d, crop %d %d %d %d",



More information about the vlc-commits mailing list