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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/android/media_codec_util.h" 5 #include "media/base/android/media_codec_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "base/android/build_info.h" 11 #include "base/android/build_info.h"
12 #include "base/android/jni_android.h" 12 #include "base/android/jni_android.h"
13 #include "base/android/jni_array.h" 13 #include "base/android/jni_array.h"
14 #include "base/android/jni_string.h" 14 #include "base/android/jni_string.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "jni/MediaCodecUtil_jni.h" 17 #include "jni/MediaCodecUtil_jni.h"
18 #include "url/gurl.h"
18 19
19 using base::android::AttachCurrentThread; 20 using base::android::AttachCurrentThread;
20 using base::android::ConvertJavaStringToUTF8; 21 using base::android::ConvertJavaStringToUTF8;
21 using base::android::ConvertUTF8ToJavaString; 22 using base::android::ConvertUTF8ToJavaString;
22 using base::android::JavaIntArrayToIntVector; 23 using base::android::JavaIntArrayToIntVector;
23 using base::android::ScopedJavaLocalRef; 24 using base::android::ScopedJavaLocalRef;
24 25
25 namespace media { 26 namespace media {
26 27
27 // static 28 // static
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 base::CompareCase::SENSITIVE) || 213 base::CompareCase::SENSITIVE) ||
213 base::StartsWith(codec_name, "OMX.MTK.", 214 base::StartsWith(codec_name, "OMX.MTK.",
214 base::CompareCase::SENSITIVE) || 215 base::CompareCase::SENSITIVE) ||
215 base::StartsWith(codec_name, "OMX.Exynos.", 216 base::StartsWith(codec_name, "OMX.Exynos.",
216 base::CompareCase::SENSITIVE)); 217 base::CompareCase::SENSITIVE));
217 } 218 }
218 return true; 219 return true;
219 } 220 }
220 221
221 // static 222 // static
223 bool MediaCodecUtil::IsHLSPath(const GURL& url) {
224 if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
225 return false;
226
227 std::string path = url.path();
228 return base::EndsWith(path, ".m3u8", base::CompareCase::INSENSITIVE_ASCII);
229 }
230
231 // static
232 bool MediaCodecUtil::IsHLSURL(const GURL& url) {
233 if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile())
234 return false;
235
236 std::string spec = url.spec();
237 if (base::EndsWith(spec, ".m3u8", base::CompareCase::INSENSITIVE_ASCII))
238 return true;
239
240 return (spec.find("m3u8") != std::string::npos);
241 }
242
243 // static
222 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) { 244 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) {
223 return RegisterNativesImpl(env); 245 return RegisterNativesImpl(env);
224 } 246 }
225 247
226 } // namespace media 248 } // namespace media
OLDNEW
« 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