[vlc-commits] mediacodec: also set quirks from MediaCodec_GetName()
Thomas Guillem
git at videolan.org
Wed Oct 30 08:15:52 CET 2019
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 29 11:00:23 2019 +0100| [1d50de8c5359cec5ac536f0441a2d718a3d8f28c] | committer: Thomas Guillem
mediacodec: also set quirks from MediaCodec_GetName()
(cherry picked from commit 556d28188bc91bc7f7f46ecb2885048129bd3c4c)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=1d50de8c5359cec5ac536f0441a2d718a3d8f28c
---
modules/codec/omxil/mediacodec_jni.c | 19 ++++++++++---------
modules/codec/omxil/mediacodec_ndk.c | 13 ++++++-------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/modules/codec/omxil/mediacodec_jni.c b/modules/codec/omxil/mediacodec_jni.c
index 2ef6f60637..e8f6b09bd5 100644
--- a/modules/codec/omxil/mediacodec_jni.c
+++ b/modules/codec/omxil/mediacodec_jni.c
@@ -39,7 +39,7 @@
#include "mediacodec.h"
char* MediaCodec_GetName(vlc_object_t *p_obj, const char *psz_mime,
- int profile, bool *p_adaptive);
+ int profile, int *p_quirks);
#define THREAD_NAME "mediacodec_jni"
@@ -318,7 +318,7 @@ struct mc_api_sys
* MediaCodec_GetName
*****************************************************************************/
char* MediaCodec_GetName(vlc_object_t *p_obj, const char *psz_mime,
- int profile, bool *p_adaptive)
+ int profile, int *p_quirks)
{
JNIEnv *env;
int num_codecs;
@@ -453,8 +453,10 @@ char* MediaCodec_GetName(vlc_object_t *p_obj, const char *psz_mime,
{
memcpy(psz_name, name_ptr, name_len);
psz_name[name_len] = '\0';
+
+ if (b_adaptive)
+ *p_quirks |= MC_API_VIDEO_QUIRKS_ADAPTIVE;
}
- *p_adaptive = b_adaptive;
}
loopclean:
if (name)
@@ -988,19 +990,18 @@ static void Clean(mc_api *api)
static int Configure(mc_api *api, int i_profile)
{
free(api->psz_name);
- bool b_adaptive;
+
+ api->i_quirks = 0;
api->psz_name = MediaCodec_GetName(api->p_obj, api->psz_mime,
- i_profile, &b_adaptive);
+ i_profile, &api->i_quirks);
if (!api->psz_name)
return MC_API_ERROR;
- api->i_quirks = OMXCodec_GetQuirks(api->i_cat, api->i_codec, api->psz_name,
- strlen(api->psz_name));
+ api->i_quirks |= OMXCodec_GetQuirks(api->i_cat, api->i_codec, api->psz_name,
+ strlen(api->psz_name));
/* Allow interlaced picture after API 21 */
if (jfields.get_input_buffer && jfields.get_output_buffer)
api->i_quirks |= MC_API_VIDEO_QUIRKS_SUPPORT_INTERLACED;
- if (b_adaptive)
- api->i_quirks |= MC_API_VIDEO_QUIRKS_ADAPTIVE;
return 0;
}
diff --git a/modules/codec/omxil/mediacodec_ndk.c b/modules/codec/omxil/mediacodec_ndk.c
index e276347b43..773bb5a9db 100644
--- a/modules/codec/omxil/mediacodec_ndk.c
+++ b/modules/codec/omxil/mediacodec_ndk.c
@@ -39,7 +39,7 @@
#include "mediacodec.h"
char* MediaCodec_GetName(vlc_object_t *p_obj, const char *psz_mime,
- int hxxx_profile, bool *p_adaptive);
+ int hxxx_profile, int *p_quirks);
#define THREAD_NAME "mediacodec_ndk"
@@ -613,17 +613,16 @@ static void Clean(mc_api *api)
static int Configure(mc_api * api, int i_profile)
{
free(api->psz_name);
- bool b_adaptive;
+
+ api->i_quirks = 0;
api->psz_name = MediaCodec_GetName(api->p_obj, api->psz_mime,
- i_profile, &b_adaptive);
+ i_profile, &api->i_quirks);
if (!api->psz_name)
return MC_API_ERROR;
- api->i_quirks = OMXCodec_GetQuirks(api->i_cat, api->i_codec, api->psz_name,
- strlen(api->psz_name));
+ api->i_quirks |= OMXCodec_GetQuirks(api->i_cat, api->i_codec, api->psz_name,
+ strlen(api->psz_name));
/* Allow interlaced picture after API 21 */
api->i_quirks |= MC_API_VIDEO_QUIRKS_SUPPORT_INTERLACED;
- if (b_adaptive)
- api->i_quirks |= MC_API_VIDEO_QUIRKS_ADAPTIVE;
return 0;
}
More information about the vlc-commits
mailing list