[vlc-devel] [PATCH] mediacodec: don't try OMX.google.*
Thomas Guillem
thomas at gllm.fr
Tue Nov 18 12:16:35 CET 2014
OMX.google.* are software decoders, it's better to use avcodec.
---
modules/codec/omxil/android_mediacodec.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index 574bebe..5cc0e27 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -409,7 +409,13 @@ static int OpenDecoder(vlc_object_t *p_this)
jobject types = (*env)->CallObjectMethod(env, info, p_sys->get_supported_types);
int num_types = (*env)->GetArrayLength(env, types);
+ jobject name = (*env)->CallObjectMethod(env, info, p_sys->get_name);
+ jsize name_len = (*env)->GetStringUTFLength(env, name);
+ const char *name_ptr = (*env)->GetStringUTFChars(env, name, NULL);
bool found = false;
+
+ if (!strncmp(name_ptr, "OMX.google.", __MIN(11, name_len)))
+ continue;
for (int j = 0; j < num_types && !found; j++) {
jobject type = (*env)->GetObjectArrayElement(env, types, j);
if (!jstrcmp(env, type, mime)) {
@@ -435,9 +441,6 @@ static int OpenDecoder(vlc_object_t *p_this)
(*env)->DeleteLocalRef(env, type);
}
if (found) {
- jobject name = (*env)->CallObjectMethod(env, info, p_sys->get_name);
- jsize name_len = (*env)->GetStringUTFLength(env, name);
- const char *name_ptr = (*env)->GetStringUTFChars(env, name, NULL);
msg_Dbg(p_dec, "using %.*s", name_len, name_ptr);
p_sys->name = malloc(name_len + 1);
memcpy(p_sys->name, name_ptr, name_len);
--
2.1.1
More information about the vlc-devel
mailing list