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

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

Issue 2028433002: blacklist some devices with buggy MediaCodec support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ScopedJavaLocalRef<jstring> j_mime = 82 ScopedJavaLocalRef<jstring> j_mime =
83 ConvertUTF8ToJavaString(env, android_mime_type); 83 ConvertUTF8ToJavaString(env, android_mime_type);
84 return Java_MediaCodecUtil_isDecoderSupportedForDevice(env, j_mime.obj()); 84 return Java_MediaCodecUtil_isDecoderSupportedForDevice(env, j_mime.obj());
85 } 85 }
86 86
87 // static 87 // static
88 bool MediaCodecUtil::IsMediaCodecAvailable() { 88 bool MediaCodecUtil::IsMediaCodecAvailable() {
89 // MediaCodec is only available on JB and greater. 89 // MediaCodec is only available on JB and greater.
90 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) 90 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16)
91 return false; 91 return false;
92
93 // Blacklist some devices on Jellybean-MR2 as for MediaCodec support is buggy.
94 // http://crbug.com/615872
95 if (base::android::BuildInfo::GetInstance()->sdk_int() == 18) {
liberato (no reviews please) 2016/05/31 15:37:08 i'd be surprised if api level 17 (JB MR1) weren't
96 std::string model(base::android::BuildInfo::GetInstance()->model());
97 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7100";
98 }
99
100 // Blacklist some devices on KitKat as for MediaCodec support is buggy.
101 // http://crbug.com/615872
102 if (base::android::BuildInfo::GetInstance()->sdk_int() == 19) {
103 std::string model(base::android::BuildInfo::GetInstance()->model());
104 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7100";
105 }
106
92 // Blacklist some devices on Jellybean as for MediaCodec support is buggy. 107 // Blacklist some devices on Jellybean as for MediaCodec support is buggy.
93 // http://crbug.com/365494. 108 // http://crbug.com/365494.
94 if (base::android::BuildInfo::GetInstance()->sdk_int() == 16) { 109 if (base::android::BuildInfo::GetInstance()->sdk_int() == 16) {
95 std::string model(base::android::BuildInfo::GetInstance()->model()); 110 std::string model(base::android::BuildInfo::GetInstance()->model());
96 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000"; 111 return model != "GT-I9100" && model != "GT-I9300" && model != "GT-N7000"
112 && model != "GT-N7100";
97 } 113 }
98 return true; 114 return true;
99 } 115 }
100 116
101 // static 117 // static
102 bool MediaCodecUtil::SupportsSetParameters() { 118 bool MediaCodecUtil::SupportsSetParameters() {
103 // MediaCodec.setParameters() is only available starting with K. 119 // MediaCodec.setParameters() is only available starting with K.
104 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; 120 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19;
105 } 121 }
106 122
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 if (base::StartsWith(model, model_prefixes[i], 253 if (base::StartsWith(model, model_prefixes[i],
238 base::CompareCase::INSENSITIVE_ASCII)) { 254 base::CompareCase::INSENSITIVE_ASCII)) {
239 return false; 255 return false;
240 } 256 }
241 } 257 }
242 258
243 return true; 259 return true;
244 } 260 }
245 261
246 } // namespace media 262 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698