Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 return true; | 238 return true; |
| 239 | 239 |
| 240 return (spec.find("m3u8") != std::string::npos); | 240 return (spec.find("m3u8") != std::string::npos); |
| 241 } | 241 } |
| 242 | 242 |
| 243 // static | 243 // static |
| 244 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) { | 244 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) { |
| 245 return RegisterNativesImpl(env); | 245 return RegisterNativesImpl(env); |
| 246 } | 246 } |
| 247 | 247 |
| 248 // static | |
| 249 bool MediaCodecUtil::PlatformHasOpusSupport() { | |
| 250 return base::android::BuildInfo::GetInstance()->sdk_int() >= 21; | |
| 251 } | |
| 252 | |
| 253 // static | |
| 254 bool MediaCodecUtil::PlatformHasVp9Support() { | |
| 255 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; | |
| 256 } | |
| 257 | |
| 258 bool MediaCodecUtil::IsVp8Blacklisted() { | |
| 259 if (!IsMediaCodecAvailable()) | |
| 260 return false; | |
|
ddorwin
2016/02/16 20:34:36
// Android MediaPlayer will be used. ?
Still, I w
DaleCurtis
2016/02/17 03:01:05
I don't think we need to mention MediaPlayer here,
| |
| 261 | |
| 262 JNIEnv* env = AttachCurrentThread(); | |
| 263 ScopedJavaLocalRef<jstring> j_mime = ConvertUTF8ToJavaString(env, "vp8"); | |
| 264 return Java_MediaCodecUtil_isDecoderSupportedForDevice(env, j_mime.obj()); | |
| 265 } | |
| 266 | |
| 248 } // namespace media | 267 } // namespace media |
| OLD | NEW |