[vlc-commits] Revert "codec/mediacodec: update the surface when a new vout is requested"

Thomas Guillem git at videolan.org
Tue Dec 20 11:28:25 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Dec 20 10:55:56 2016 +0100| [b48b7fe78e4d34f7a957634386ef6908e964584f] | committer: Thomas Guillem

Revert "codec/mediacodec: update the surface when a new vout is requested"

This was not fully tested, and it doesn't work on number of devices.
This partially reverts commit 3aff6aace986c1d9d94c919c2dc4b17cdcb78332.

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

 modules/codec/omxil/mediacodec.c | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index d662028..5f7179e 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -1067,9 +1067,6 @@ static int Video_ProcessOutput(decoder_t *p_dec, mc_api_out *p_out,
             i_width = p_out->conf.video.width;
             i_height = p_out->conf.video.height;
         }
-        bool b_video_changed =
-            (unsigned) i_width != p_dec->fmt_out.video.i_width ||
-            (unsigned) i_height != p_dec->fmt_out.video.i_height;
 
         p_dec->fmt_out.video.i_visible_width =
         p_dec->fmt_out.video.i_width = i_width;
@@ -1091,27 +1088,8 @@ static int Video_ProcessOutput(decoder_t *p_dec, mc_api_out *p_out,
             p_sys->video.i_stride = p_dec->fmt_out.video.i_width;
         }
 
-        if (p_sys->api->b_direct_rendering)
-        {
-            if (b_video_changed)
-            {
-                /* p_surface/p_jsurface can change when the vout is updated */
-                if (UpdateOpaqueVout(p_dec) != VLC_SUCCESS)
-                    return -1;
-
-                if (p_sys->api->set_output_surface(p_sys->api,
-                        p_sys->video.p_surface, p_sys->video.p_jsurface) != 0)
-                {
-                    /* Corner case: not able to update directly the new surface
-                     * to MediaCodec: ask for a restart */
-                    msg_Warn(p_dec, "The vout changed and the output surface "
-                             "could not be updated: restarting MediaCodec");
-                    p_sys->i_decode_flags |= DECODE_FLAG_RESTART;
-                    return 0;
-                }
-            }
-        }
-        else if (decoder_UpdateVideoFormat(p_dec) != 0)
+        if (!p_sys->api->b_direct_rendering
+         && decoder_UpdateVideoFormat(p_dec) != 0)
         {
             msg_Err(p_dec, "decoder_UpdateVideoFormat failed");
             return -1;



More information about the vlc-commits mailing list