[Android] HWDecoderUtil: per default, only try HW decoders after HoneyComb

Thomas Guillem git at videolan.org
Thu Jan 22 11:54:31 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 22 11:25:56 2015 +0100| [8cc4d74f695969769db70623466a572a7ec54de8] | committer: Thomas Guillem

HWDecoderUtil: per default, only try HW decoders after HoneyComb

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=8cc4d74f695969769db70623466a572a7ec54de8
---

 libvlc/src/org/videolan/libvlc/HWDecoderUtil.java |   27 +++++++++++++--------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/HWDecoderUtil.java b/libvlc/src/org/videolan/libvlc/HWDecoderUtil.java
index 8e0e903..7d48899 100644
--- a/libvlc/src/org/videolan/libvlc/HWDecoderUtil.java
+++ b/libvlc/src/org/videolan/libvlc/HWDecoderUtil.java
@@ -93,18 +93,25 @@ public class HWDecoderUtil {
      * (Always return Dec.ALL after Android 4.3)
      */
     public static Decoder getDecoderFromDevice() {
+        /*
+         * Always try MediaCodec after JellyBean MR2,
+         * Try OMX or MediaCodec after HoneyComb depending on device properties.
+         * Otherwise, use software decoder by default.
+         */
         if (LibVlcUtil.isJellyBeanMR2OrLater())
             return Decoder.ALL;
-        for (DecoderBySOC decBySOC : sDecoderBySOCList) {
-            String prop = sSystemPropertyMap.get(decBySOC.key);
-            if (prop == null) {
-                prop = getSystemProperty(decBySOC.key, "none");
-                sSystemPropertyMap.put(decBySOC.key, prop);
-            }
-            if (prop != null) {
-                for (String decProp: decBySOC.list)
-                    if (prop.contains(decProp))
-                        return decBySOC.dec;
+        else if (LibVlcUtil.isHoneycombOrLater()) {
+            for (DecoderBySOC decBySOC : sDecoderBySOCList) {
+                String prop = sSystemPropertyMap.get(decBySOC.key);
+                if (prop == null) {
+                    prop = getSystemProperty(decBySOC.key, "none");
+                    sSystemPropertyMap.put(decBySOC.key, prop);
+                }
+                if (prop != null) {
+                    for (String decProp: decBySOC.list)
+                        if (prop.contains(decProp))
+                            return decBySOC.dec;
+                }
             }
         }
         return Decoder.UNKNOWN;



More information about the Android mailing list