| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 ScopedJavaLocalRef<jobject> j_info( | 115 ScopedJavaLocalRef<jobject> j_info( |
| 116 env, env->GetObjectArrayElement(j_codec_info_array.obj(), i)); | 116 env, env->GetObjectArrayElement(j_codec_info_array.obj(), i)); |
| 117 ScopedJavaLocalRef<jstring> j_codec_type = | 117 ScopedJavaLocalRef<jstring> j_codec_type = |
| 118 Java_CodecInfo_codecType(env, j_info.obj()); | 118 Java_CodecInfo_codecType(env, j_info.obj()); |
| 119 ConvertJavaStringToUTF8(env, j_codec_type.obj(), &mime_type); | 119 ConvertJavaStringToUTF8(env, j_codec_type.obj(), &mime_type); |
| 120 ScopedJavaLocalRef<jstring> j_codec_name = | 120 ScopedJavaLocalRef<jstring> j_codec_name = |
| 121 Java_CodecInfo_codecName(env, j_info.obj()); | 121 Java_CodecInfo_codecName(env, j_info.obj()); |
| 122 CodecsInfo info; | 122 CodecsInfo info; |
| 123 info.codecs = AndroidMimeTypeToCodecType(mime_type); | 123 info.codecs = AndroidMimeTypeToCodecType(mime_type); |
| 124 ConvertJavaStringToUTF8(env, j_codec_name.obj(), &info.name); | 124 ConvertJavaStringToUTF8(env, j_codec_name.obj(), &info.name); |
| 125 info.secure_decoder_supported = | |
| 126 Java_CodecInfo_isSecureDecoderSupported(env, j_info.obj()); | |
| 127 codecs_info->push_back(info); | 125 codecs_info->push_back(info); |
| 128 } | 126 } |
| 129 } | 127 } |
| 130 | 128 |
| 131 // static | 129 // static |
| 132 bool MediaCodecBridge::CanDecode(const std::string& codec, bool is_secure) { | 130 bool MediaCodecBridge::CanDecode(const std::string& codec, bool is_secure) { |
| 133 JNIEnv* env = AttachCurrentThread(); | 131 JNIEnv* env = AttachCurrentThread(); |
| 134 std::string mime = CodecTypeToAndroidMimeType(codec); | 132 std::string mime = CodecTypeToAndroidMimeType(codec); |
| 135 if (mime.empty()) | 133 if (mime.empty()) |
| 136 return false; | 134 return false; |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 bool VideoCodecBridge::IsKnownUnaccelerated(const VideoCodec& codec) { | 535 bool VideoCodecBridge::IsKnownUnaccelerated(const VideoCodec& codec) { |
| 538 return MediaCodecBridge::IsKnownUnaccelerated( | 536 return MediaCodecBridge::IsKnownUnaccelerated( |
| 539 VideoCodecToAndroidMimeType(codec)); | 537 VideoCodecToAndroidMimeType(codec)); |
| 540 } | 538 } |
| 541 | 539 |
| 542 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { | 540 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { |
| 543 return RegisterNativesImpl(env); | 541 return RegisterNativesImpl(env); |
| 544 } | 542 } |
| 545 | 543 |
| 546 } // namespace media | 544 } // namespace media |
| OLD | NEW |