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

Unified Diff: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java

Issue 605883002: Fix wrong selection of VP8 video decoder on some Samsung devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/android/media_codec_bridge.cc » ('j') | media/base/android/media_codec_bridge.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | media/base/android/media_codec_bridge.cc » ('j') | media/base/android/media_codec_bridge.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698