[vlc-commits] mediacodec: don't try OMX.google.*

Thomas Guillem git at videolan.org
Tue Nov 18 18:07:55 CET 2014


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Nov 18 10:16:35 2014 +0000| [49fc0b18011e38bb1886bd15575e249ed1728977] | committer: Jean-Baptiste Kempf

mediacodec: don't try OMX.google.*

OMX.google.* are software decoders, it's better to use avcodec.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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);



More information about the vlc-commits mailing list