| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() && | 181 return IsMediaCodecAvailable() && IsDecoderSupportedByDevice("vp8"); |
| 182 IsDecoderSupportedByDevice(CodecTypeToAndroidMimeType("vp8")); | |
| 183 } | 182 } |
| 184 | 183 |
| 185 // static | 184 // static |
| 186 bool MediaCodecUtil::IsVp8EncoderAvailable() { | 185 bool MediaCodecUtil::IsVp8EncoderAvailable() { |
| 187 // Currently the vp8 encoder and decoder blacklists cover the same devices, | 186 // Currently the vp8 encoder and decoder blacklists cover the same devices, |
| 188 // but we have a second method for clarity in future issues. | 187 // but we have a second method for clarity in future issues. |
| 189 return IsVp8DecoderAvailable(); | 188 return IsVp8DecoderAvailable(); |
| 190 } | 189 } |
| 191 | 190 |
| 192 // static | 191 // static |
| 193 bool MediaCodecUtil::IsVp9DecoderAvailable() { | 192 bool MediaCodecUtil::IsVp9DecoderAvailable() { |
| 194 return IsMediaCodecAvailable() && | 193 return IsMediaCodecAvailable() && IsDecoderSupportedByDevice("vp9"); |
| 195 IsDecoderSupportedByDevice(CodecTypeToAndroidMimeType("vp9")); | |
| 196 } | 194 } |
| 197 | 195 |
| 198 // static | 196 // static |
| 199 bool MediaCodecUtil::IsSurfaceViewOutputSupported() { | 197 bool MediaCodecUtil::IsSurfaceViewOutputSupported() { |
| 200 // Disable SurfaceView output for the Samsung Galaxy S3; it does not work | 198 // Disable SurfaceView output for the Samsung Galaxy S3; it does not work |
| 201 // well enough for even 360p24 H264 playback. http://crbug.com/602870. | 199 // well enough for even 360p24 H264 playback. http://crbug.com/602870. |
| 202 // | 200 // |
| 203 // Notably this is codec agnostic at present, so any devices added to | 201 // Notably this is codec agnostic at present, so any devices added to |
| 204 // the blacklist will avoid trying to play any codecs on SurfaceView. If | 202 // the blacklist will avoid trying to play any codecs on SurfaceView. If |
| 205 // needed in the future this can be expanded to be codec specific. | 203 // needed in the future this can be expanded to be codec specific. |
| 206 return !base::StartsWith(base::android::BuildInfo::GetInstance()->model(), | 204 return !base::StartsWith(base::android::BuildInfo::GetInstance()->model(), |
| 207 "GT-I9300", base::CompareCase::INSENSITIVE_ASCII); | 205 "GT-I9300", base::CompareCase::INSENSITIVE_ASCII); |
| 208 } | 206 } |
| 209 | 207 |
| 210 } // namespace media | 208 } // namespace media |
| OLD | NEW |