| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 static_cast<MediaCodecVideoDecoderFactory*> | 1387 static_cast<MediaCodecVideoDecoderFactory*> |
| 1388 (owned_factory->decoder_factory()); | 1388 (owned_factory->decoder_factory()); |
| 1389 if (decoder_factory && | 1389 if (decoder_factory && |
| 1390 jni->IsInstanceOf(remote_egl_context, j_eglbase14_context_class)) { | 1390 jni->IsInstanceOf(remote_egl_context, j_eglbase14_context_class)) { |
| 1391 LOG(LS_INFO) << "Set EGL context for HW decoding."; | 1391 LOG(LS_INFO) << "Set EGL context for HW decoding."; |
| 1392 decoder_factory->SetEGLContext(jni, remote_egl_context); | 1392 decoder_factory->SetEGLContext(jni, remote_egl_context); |
| 1393 } | 1393 } |
| 1394 #endif | 1394 #endif |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 static std::string | |
| 1398 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { | |
| 1399 jclass enumClass = FindClass(jni, className.c_str()); | |
| 1400 jmethodID nameMethod = | |
| 1401 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); | |
| 1402 jstring name = | |
| 1403 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod)); | |
| 1404 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for " | |
| 1405 << className << ".name"; | |
| 1406 return JavaToStdString(jni, name); | |
| 1407 } | |
| 1408 | |
| 1409 static PeerConnectionInterface::IceTransportsType | 1397 static PeerConnectionInterface::IceTransportsType |
| 1410 JavaIceTransportsTypeToNativeType(JNIEnv* jni, jobject j_ice_transports_type) { | 1398 JavaIceTransportsTypeToNativeType(JNIEnv* jni, jobject j_ice_transports_type) { |
| 1411 std::string enum_name = GetJavaEnumName( | 1399 std::string enum_name = GetJavaEnumName( |
| 1412 jni, "org/webrtc/PeerConnection$IceTransportsType", | 1400 jni, "org/webrtc/PeerConnection$IceTransportsType", |
| 1413 j_ice_transports_type); | 1401 j_ice_transports_type); |
| 1414 | 1402 |
| 1415 if (enum_name == "ALL") | 1403 if (enum_name == "ALL") |
| 1416 return PeerConnectionInterface::kAll; | 1404 return PeerConnectionInterface::kAll; |
| 1417 | 1405 |
| 1418 if (enum_name == "RELAY") | 1406 if (enum_name == "RELAY") |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2168 return JavaStringFromStdString( | 2156 return JavaStringFromStdString( |
| 2169 jni, | 2157 jni, |
| 2170 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2158 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
| 2171 } | 2159 } |
| 2172 | 2160 |
| 2173 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2161 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
| 2174 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2162 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
| 2175 } | 2163 } |
| 2176 | 2164 |
| 2177 } // namespace webrtc_jni | 2165 } // namespace webrtc_jni |
| OLD | NEW |