Chromium Code Reviews| Index: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
| diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
| index bf66aa389479c15944876acd463e0a2253652ea2..cdb6660682e6b6c2302ed42da26523fcc87e8cfc 100644 |
| --- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
| +++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java |
| @@ -222,20 +222,26 @@ class MediaCodecBridge { |
| boolean adaptivePlaybackSupported = false; |
| try { |
| // |isSecure| only applies to video decoders. |
| - if (mime.startsWith("video") && isSecure && direction == MEDIA_CODEC_DECODER) { |
| + if (mime.startsWith("video") && direction == MEDIA_CODEC_DECODER) { |
| String decoderName = getDecoderNameForMime(mime); |
| if (decoderName == null) { |
| return null; |
| } |
| - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
| - // To work around an issue that we cannot get the codec info from the secure |
| - // decoder, create an insecure decoder first so that we can query its codec |
| - // info. http://b/15587335. |
| - MediaCodec insecureCodec = MediaCodec.createByCodecName(decoderName); |
| - adaptivePlaybackSupported = codecSupportsAdaptivePlayback(insecureCodec, mime); |
| - insecureCodec.release(); |
| + if (isSecure) { |
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
| + // To work around an issue that we cannot get the codec info from the |
| + // secure decoder, create an insecure decoder first so that we can query |
| + // its codec info. http://b/15587335. |
| + MediaCodec insecureCodec = MediaCodec.createByCodecName(decoderName); |
| + adaptivePlaybackSupported = |
| + codecSupportsAdaptivePlayback(insecureCodec, mime); |
| + insecureCodec.release(); |
| + } |
| + mediaCodec = MediaCodec.createByCodecName(decoderName + ".secure"); |
| + } else { |
| + mediaCodec = MediaCodec.createByCodecName(decoderName); |
|
qinmin
2014/09/26 05:00:28
Are you sure this will not cause any other issues?
AlexGlaznev
2014/09/26 18:01:37
No, I am not 100% sure. But I know, that current w
qinmin
2014/09/26 22:45:55
Can you explain why CreateDecoderByType() will end
|
| + adaptivePlaybackSupported = codecSupportsAdaptivePlayback(mediaCodec, mime); |
| } |
| - mediaCodec = MediaCodec.createByCodecName(decoderName + ".secure"); |
| } else { |
| if (direction == MEDIA_CODEC_ENCODER) { |
| mediaCodec = MediaCodec.createEncoderByType(mime); |