[vlc-commits] mediacodec: add an option to enable hwdec

Thomas Guillem git at videolan.org
Mon Apr 23 08:58:45 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Apr 20 16:41:25 2018 +0200| [c805ab1b00b150832ffb4583ba9aa6d4a19bdd71] | committer: Thomas Guillem

mediacodec: add an option to enable hwdec

Use --no-mediacodec to disable hardware-accelerated video decoding on Android.

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

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

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index bfcc06da1b..a5650b2d6e 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -166,6 +166,9 @@ static void RemoveInflightPictures(decoder_t *);
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
+#define MEDIACODEC_ENABLE_TEXT N_("Enable Hardware decoder")
+#define MEDIACODEC_ENABLE_LONGTEXT N_("Use MediaCodec for hardware-accelerated video decoding")
+
 #define DIRECTRENDERING_TEXT "Android direct rendering"
 #define DIRECTRENDERING_LONGTEXT \
     "Enable Android direct rendering using opaque buffers."
@@ -183,6 +186,8 @@ vlc_module_begin ()
     set_subcategory(SUBCAT_INPUT_VCODEC)
     set_section(N_("Decoding"), NULL)
     set_capability("video decoder", 800)
+    add_bool("mediacodec", true, MEDIACODEC_ENABLE_TEXT,
+             MEDIACODEC_ENABLE_LONGTEXT, false)
     add_bool(CFG_PREFIX "dr", true,
              DIRECTRENDERING_TEXT, DIRECTRENDERING_LONGTEXT, true)
     add_bool(CFG_PREFIX "audio", false,
@@ -534,6 +539,10 @@ static void StopMediaCodec(decoder_t *p_dec)
 static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
 {
     decoder_t *p_dec = (decoder_t *)p_this;
+
+    if (!var_InheritBool(p_dec, "mediacodec"))
+        return VLC_EGENERIC;
+
     decoder_sys_t *p_sys;
     int i_ret;
     int i_profile = p_dec->fmt_in.i_profile;



More information about the vlc-commits mailing list