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