Upstream version 10.38.220.0
[platform/framework/web/crosswalk.git] / src / media / base / android / media_codec_bridge.cc
index 92b2791..3cbc9cc 100644 (file)
@@ -104,7 +104,15 @@ ToJavaIntArray(JNIEnv* env, scoped_ptr<jint[]> native_array, int size) {
 // static
 bool MediaCodecBridge::IsAvailable() {
   // MediaCodec is only available on JB and greater.
-  return base::android::BuildInfo::GetInstance()->sdk_int() >= 16;
+  if (base::android::BuildInfo::GetInstance()->sdk_int() < 16)
+    return false;
+  // Blacklist some devices on Jellybean as for MediaCodec support is buggy.
+  // http://crbug.com/365494.
+  if (base::android::BuildInfo::GetInstance()->sdk_int() == 16) {
+    std::string model(base::android::BuildInfo::GetInstance()->model());
+    return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000";
+  }
+  return true;
 }
 
 // static
@@ -176,7 +184,8 @@ bool MediaCodecBridge::IsKnownUnaccelerated(const std::string& mime_type,
       // It would be nice if MediaCodecInfo externalized some notion of
       // HW-acceleration but it doesn't. Android Media guidance is that the
       // prefix below is always used for SW decoders, so that's what we use.
-      return StartsWithASCII(codecs_info[i].name, "OMX.google.", true);
+      if (!StartsWithASCII(codecs_info[i].name, "OMX.google.", true))
+        return false;
     }
   }
   return true;