| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |