Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: media/base/android/media_codec_util.cc

Issue 1560953002: Implement fallback from WMPI to WMPA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only include MediaCodecUtil on Android. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_codec_util.cc
diff --git a/media/base/android/media_codec_util.cc b/media/base/android/media_codec_util.cc
index c5f70221c5e709683e27183314cb8d62a79b5934..7650ecd7f7813a11352163f4f099d073ddef58a6 100644
--- a/media/base/android/media_codec_util.cc
+++ b/media/base/android/media_codec_util.cc
@@ -15,6 +15,7 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "jni/MediaCodecUtil_jni.h"
+#include "url/gurl.h"
using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF8;
@@ -219,6 +220,27 @@ bool MediaCodecUtil::IsKnownUnaccelerated(const std::string& mime_type,
}
// static
+bool MediaCodecUtil::IsHLSPath(const GURL& url) {
+ if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
+ return false;
+
+ std::string path = url.path();
+ return base::EndsWith(path, ".m3u8", base::CompareCase::INSENSITIVE_ASCII);
+}
+
+// static
+bool MediaCodecUtil::IsHLSURL(const GURL& url) {
+ if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
+ return false;
+
+ std::string spec = url.spec();
+ if (base::EndsWith(spec, ".m3u8", base::CompareCase::INSENSITIVE_ASCII))
+ return true;
+
+ return (spec.find("m3u8") != std::string::npos);
+}
+
+// static
bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) {
return RegisterNativesImpl(env);
}
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698