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

Side by Side Diff: media/base/android/media_codec_bridge.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_bridge.h" 5 #include "media/base/android/media_codec_bridge.h"
6 6
7 7
8 #include "base/android/build_info.h" 8 #include "base/android/build_info.h"
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 DVLOG(1) << __PRETTY_FUNCTION__ << "Default codec for " << mime_type << 239 DVLOG(1) << __PRETTY_FUNCTION__ << "Default codec for " << mime_type <<
240 " : " << codec_name; 240 " : " << codec_name;
241 // It would be nice if MediaCodecInfo externalized some notion of 241 // It would be nice if MediaCodecInfo externalized some notion of
242 // HW-acceleration but it doesn't. Android Media guidance is that the 242 // HW-acceleration but it doesn't. Android Media guidance is that the
243 // "OMX.google" prefix is always used for SW decoders, so that's what we 243 // "OMX.google" prefix is always used for SW decoders, so that's what we
244 // use. "OMX.SEC.*" codec is Samsung software implementation - report it 244 // use. "OMX.SEC.*" codec is Samsung software implementation - report it
245 // as unaccelerated as well. Also temporary blacklist Exynos and MediaTek 245 // as unaccelerated as well. Also temporary blacklist Exynos and MediaTek
246 // devices while HW decoder video freezes and distortions are 246 // devices while HW decoder video freezes and distortions are
247 // investigated - http://crbug.com/446974. 247 // investigated - http://crbug.com/446974.
248 if (codec_name.length() > 0) { 248 if (codec_name.length() > 0) {
249 return (base::StartsWithASCII(codec_name, "OMX.google.", true) || 249 return (base::StartsWith(codec_name, "OMX.google.",
250 base::StartsWithASCII(codec_name, "OMX.SEC.", true) || 250 base::CompareCase::SENSITIVE) ||
251 base::StartsWithASCII(codec_name, "OMX.MTK.", true) || 251 base::StartsWith(codec_name, "OMX.SEC.",
252 base::StartsWithASCII(codec_name, "OMX.Exynos.", true)); 252 base::CompareCase::SENSITIVE) ||
253 base::StartsWith(codec_name, "OMX.MTK.",
254 base::CompareCase::SENSITIVE) ||
255 base::StartsWith(codec_name, "OMX.Exynos.",
256 base::CompareCase::SENSITIVE));
253 } 257 }
254 return true; 258 return true;
255 } 259 }
256 260
257 MediaCodecBridge::MediaCodecBridge(const std::string& mime, 261 MediaCodecBridge::MediaCodecBridge(const std::string& mime,
258 bool is_secure, 262 bool is_secure,
259 MediaCodecDirection direction) { 263 MediaCodecDirection direction) {
260 JNIEnv* env = AttachCurrentThread(); 264 JNIEnv* env = AttachCurrentThread();
261 CHECK(env); 265 CHECK(env);
262 DCHECK(!mime.empty()); 266 DCHECK(!mime.empty());
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 JNIEnv* env = AttachCurrentThread(); 841 JNIEnv* env = AttachCurrentThread();
838 return Java_MediaCodecBridge_isAdaptivePlaybackSupported( 842 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(
839 env, media_codec(), width, height); 843 env, media_codec(), width, height);
840 } 844 }
841 845
842 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { 846 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) {
843 return RegisterNativesImpl(env); 847 return RegisterNativesImpl(env);
844 } 848 }
845 849
846 } // namespace media 850 } // namespace media
OLDNEW
« no previous file with comments | « ios/net/clients/crn_forwarding_network_client_factory_unittest.mm ('k') | media/base/android/media_player_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698