[vlc-commits] mediacodec: let the GL vout handle the rotation

Thomas Guillem git at videolan.org
Mon Jan 27 13:41:22 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 27 11:39:10 2020 +0100| [d7ada2805c9187c0115951d7db829c5b043dc288] | committer: Thomas Guillem

mediacodec: let the GL vout handle the rotation

Avoid double rotation from MediaCodec and interop_android.

This fixes 90° videos that are flipped horizontally with the recent vout_helper
changes.

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

 modules/codec/omxil/mediacodec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 762560b0aa..f6b98458f4 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -887,7 +887,11 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
                 goto bailout;
             }
 
-            if (p_sys->api.b_support_rotation)
+            android_video_context_t *avctx =
+                vlc_video_context_GetPrivate(p_sys->video.ctx,
+                                             VLC_VIDEO_CONTEXT_AWINDOW);
+
+            if (p_sys->api.b_support_rotation && avctx->id == AWindow_Video)
             {
                 switch (p_dec->fmt_in.video.orientation)
                 {
@@ -906,7 +910,10 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
                 }
             }
             else
+            {
+                /* Let the GL vout handle the rotation */
                 p_sys->video.i_angle = 0;
+            }
 
         }
         p_sys->cat = VIDEO_ES;



More information about the vlc-commits mailing list