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

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

Issue 1900843003: Fix a bug that mime type isn't passed when checking Codec capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return (spec.find("m3u8") != std::string::npos); 171 return (spec.find("m3u8") != std::string::npos);
172 } 172 }
173 173
174 // static 174 // static
175 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) { 175 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) {
176 return RegisterNativesImpl(env); 176 return RegisterNativesImpl(env);
177 } 177 }
178 178
179 // static 179 // static
180 bool MediaCodecUtil::IsVp8DecoderAvailable() { 180 bool MediaCodecUtil::IsVp8DecoderAvailable() {
181 return IsMediaCodecAvailable() && IsDecoderSupportedByDevice("vp8"); 181 return IsMediaCodecAvailable() &&
182 IsDecoderSupportedByDevice(CodecTypeToAndroidMimeType("vp8"));
182 } 183 }
183 184
184 // static 185 // static
185 bool MediaCodecUtil::IsVp8EncoderAvailable() { 186 bool MediaCodecUtil::IsVp8EncoderAvailable() {
186 // Currently the vp8 encoder and decoder blacklists cover the same devices, 187 // Currently the vp8 encoder and decoder blacklists cover the same devices,
187 // but we have a second method for clarity in future issues. 188 // but we have a second method for clarity in future issues.
188 return IsVp8DecoderAvailable(); 189 return IsVp8DecoderAvailable();
189 } 190 }
190 191
191 // static 192 // static
192 bool MediaCodecUtil::IsVp9DecoderAvailable() { 193 bool MediaCodecUtil::IsVp9DecoderAvailable() {
193 return IsMediaCodecAvailable() && IsDecoderSupportedByDevice("vp9"); 194 return IsMediaCodecAvailable() &&
195 IsDecoderSupportedByDevice(CodecTypeToAndroidMimeType("vp9"));
194 } 196 }
195 197
196 // static 198 // static
197 bool MediaCodecUtil::IsSurfaceViewOutputSupported() { 199 bool MediaCodecUtil::IsSurfaceViewOutputSupported() {
198 // Disable SurfaceView output for the Samsung Galaxy S3; it does not work 200 // Disable SurfaceView output for the Samsung Galaxy S3; it does not work
199 // well enough for even 360p24 H264 playback. http://crbug.com/602870. 201 // well enough for even 360p24 H264 playback. http://crbug.com/602870.
200 // 202 //
201 // Notably this is codec agnostic at present, so any devices added to 203 // Notably this is codec agnostic at present, so any devices added to
202 // the blacklist will avoid trying to play any codecs on SurfaceView. If 204 // the blacklist will avoid trying to play any codecs on SurfaceView. If
203 // needed in the future this can be expanded to be codec specific. 205 // needed in the future this can be expanded to be codec specific.
204 return !base::StartsWith(base::android::BuildInfo::GetInstance()->model(), 206 return !base::StartsWith(base::android::BuildInfo::GetInstance()->model(),
205 "GT-I9300", base::CompareCase::INSENSITIVE_ASCII); 207 "GT-I9300", base::CompareCase::INSENSITIVE_ASCII);
206 } 208 }
207 209
208 } // namespace media 210 } // 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