Commit e4385dbb authored by Thomas Guillem's avatar Thomas Guillem

mediacodec: fix interlaced support detection

We need to know it before MediaCodec is started.
parent 47fa89f2
...@@ -416,7 +416,6 @@ static int Stop(mc_api *api) ...@@ -416,7 +416,6 @@ static int Stop(mc_api *api)
JNIEnv *env; JNIEnv *env;
api->b_direct_rendering = false; api->b_direct_rendering = false;
api->b_support_interlaced = false;
GET_ENV(); GET_ENV();
...@@ -574,9 +573,7 @@ static int Start(mc_api *api, AWindowHandler *p_awh, const char *psz_name, ...@@ -574,9 +573,7 @@ static int Start(mc_api *api, AWindowHandler *p_awh, const char *psz_name,
jfields.buffer_info_ctor); jfields.buffer_info_ctor);
p_sys->buffer_info = (*env)->NewGlobalRef(env, jbuffer_info); 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_direct_rendering = b_direct_rendering;
api->b_support_interlaced = jfields.get_input_buffer && jfields.get_output_buffer;
i_ret = VLC_SUCCESS; i_ret = VLC_SUCCESS;
msg_Dbg(api->p_obj, "MediaCodec via JNI opened"); msg_Dbg(api->p_obj, "MediaCodec via JNI opened");
...@@ -846,5 +843,8 @@ int MediaCodecJni_Init(mc_api *api) ...@@ -846,5 +843,8 @@ int MediaCodecJni_Init(mc_api *api)
api->get_out = GetOutput; api->get_out = GetOutput;
api->release_out = ReleaseOutput; 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; return VLC_SUCCESS;
} }
...@@ -272,7 +272,6 @@ static int Stop(mc_api *api) ...@@ -272,7 +272,6 @@ static int Stop(mc_api *api)
mc_api_sys *p_sys = api->p_sys; mc_api_sys *p_sys = api->p_sys;
api->b_direct_rendering = false; api->b_direct_rendering = false;
api->b_support_interlaced = false;
if (p_sys->p_codec) if (p_sys->p_codec)
{ {
...@@ -341,7 +340,6 @@ static int Start(mc_api *api, AWindowHandler *p_awh, const char *psz_name, ...@@ -341,7 +340,6 @@ static int Start(mc_api *api, AWindowHandler *p_awh, const char *psz_name,
api->b_started = true; api->b_started = true;
api->b_direct_rendering = !!p_anw; api->b_direct_rendering = !!p_anw;
api->b_support_interlaced = true;
i_ret = VLC_SUCCESS; i_ret = VLC_SUCCESS;
msg_Dbg(api->p_obj, "MediaCodec via NDK opened"); msg_Dbg(api->p_obj, "MediaCodec via NDK opened");
...@@ -523,5 +521,7 @@ int MediaCodecNdk_Init(mc_api *api) ...@@ -523,5 +521,7 @@ int MediaCodecNdk_Init(mc_api *api)
api->put_in = PutInput; api->put_in = PutInput;
api->get_out = GetOutput; api->get_out = GetOutput;
api->release_out = ReleaseOutput; api->release_out = ReleaseOutput;
api->b_support_interlaced = true;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment