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

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

Issue 342933002: Fix wrong result from IsKnownUnaccelerated() even if there are H/W acceleratable codecs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_bridge.h" 5 #include "media/base/android/media_codec_bridge.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 std::string codec_type = AndroidMimeTypeToCodecType(mime_type); 170 std::string codec_type = AndroidMimeTypeToCodecType(mime_type);
171 std::vector<media::MediaCodecBridge::CodecsInfo> codecs_info = 171 std::vector<media::MediaCodecBridge::CodecsInfo> codecs_info =
172 MediaCodecBridge::GetCodecsInfo(); 172 MediaCodecBridge::GetCodecsInfo();
173 for (size_t i = 0; i < codecs_info.size(); ++i) { 173 for (size_t i = 0; i < codecs_info.size(); ++i) {
174 if (codecs_info[i].codecs == codec_type && 174 if (codecs_info[i].codecs == codec_type &&
175 codecs_info[i].direction == direction) { 175 codecs_info[i].direction == direction) {
176 // It would be nice if MediaCodecInfo externalized some notion of 176 // It would be nice if MediaCodecInfo externalized some notion of
177 // HW-acceleration but it doesn't. Android Media guidance is that the 177 // HW-acceleration but it doesn't. Android Media guidance is that the
178 // prefix below is always used for SW decoders, so that's what we use. 178 // prefix below is always used for SW decoders, so that's what we use.
179 return StartsWithASCII(codecs_info[i].name, "OMX.google.", true); 179 if (!StartsWithASCII(codecs_info[i].name, "OMX.google.", true))
180 return false;
180 } 181 }
181 } 182 }
182 return true; 183 return true;
183 } 184 }
184 185
185 MediaCodecBridge::MediaCodecBridge(const std::string& mime, 186 MediaCodecBridge::MediaCodecBridge(const std::string& mime,
186 bool is_secure, 187 bool is_secure,
187 MediaCodecDirection direction) { 188 MediaCodecDirection direction) {
188 JNIEnv* env = AttachCurrentThread(); 189 JNIEnv* env = AttachCurrentThread();
189 CHECK(env); 190 CHECK(env);
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 JNIEnv* env = AttachCurrentThread(); 738 JNIEnv* env = AttachCurrentThread();
738 return Java_MediaCodecBridge_isAdaptivePlaybackSupported( 739 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(
739 env, media_codec(), width, height); 740 env, media_codec(), width, height);
740 } 741 }
741 742
742 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { 743 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) {
743 return RegisterNativesImpl(env); 744 return RegisterNativesImpl(env);
744 } 745 }
745 746
746 } // namespace media 747 } // 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