[vlc-commits] mediacodec: fix interlaced support detection

Thomas Guillem git at videolan.org
Fri Jul 24 16:34:14 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 24 16:32:47 2015 +0200| [e4385dbb40638fa1d34acad3bb8aa59b8e7b4073] | committer: Thomas Guillem

mediacodec: fix interlaced support detection

We need to know it before MediaCodec is started.

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

 modules/codec/omxil/mediacodec_jni.c |    6 +++---
 modules/codec/omxil/mediacodec_ndk.c |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/codec/omxil/mediacodec_jni.c b/modules/codec/omxil/mediacodec_jni.c
index 71318a0..5d659e4 100644
--- a/modules/codec/omxil/mediacodec_jni.c
+++ b/modules/codec/omxil/mediacodec_jni.c
@@ -416,7 +416,6 @@ static int Stop(mc_api *api)
     JNIEnv *env;
 
     api->b_direct_rendering = false;
-    api->b_support_interlaced = false;
 
     GET_ENV();
 
@@ -574,9 +573,7 @@ static int Start(mc_api *api, AWindowHandler *p_awh, const char *psz_name,
                                      jfields.buffer_info_ctor);
     p_sys->buffer_info = (*env)->NewGlobalRef(env, jbuffer_info);
 
-    /* Allow interlaced picture only after API 21 */
     api->b_direct_rendering = b_direct_rendering;
-    api->b_support_interlaced = jfields.get_input_buffer && jfields.get_output_buffer;
     i_ret = VLC_SUCCESS;
     msg_Dbg(api->p_obj, "MediaCodec via JNI opened");
 
@@ -846,5 +843,8 @@ int MediaCodecJni_Init(mc_api *api)
     api->get_out = GetOutput;
     api->release_out = ReleaseOutput;
 
+    /* Allow interlaced picture only after API 21 */
+    api->b_support_interlaced = jfields.get_input_buffer
+                                && jfields.get_output_buffer;
     return VLC_SUCCESS;
 }
diff --git a/modules/codec/omxil/mediacodec_ndk.c b/modules/codec/omxil/mediacodec_ndk.c
index 31ea3fa..e434aa0 100644
--- a/modules/codec/omxil/mediacodec_ndk.c
+++ b/modules/codec/omxil/mediacodec_ndk.c
@@ -272,7 +272,6 @@ static int Stop(mc_api *api)
     mc_api_sys *p_sys = api->p_sys;
 
     api->b_direct_rendering = false;
-    api->b_support_interlaced = false;
 
     if (p_sys->p_codec)
     {
@@ -341,7 +340,6 @@ static int Start(mc_api *api, AWindowHandler *p_awh, const char *psz_name,
 
     api->b_started = true;
     api->b_direct_rendering = !!p_anw;
-    api->b_support_interlaced = true;
     i_ret = VLC_SUCCESS;
 
     msg_Dbg(api->p_obj, "MediaCodec via NDK opened");
@@ -523,5 +521,7 @@ int MediaCodecNdk_Init(mc_api *api)
     api->put_in = PutInput;
     api->get_out = GetOutput;
     api->release_out = ReleaseOutput;
+
+    api->b_support_interlaced = true;
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list