| 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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 static_cast<MediaCodecVideoDecoderFactory*> | 1366 static_cast<MediaCodecVideoDecoderFactory*> |
| 1367 (owned_factory->decoder_factory()); | 1367 (owned_factory->decoder_factory()); |
| 1368 if (decoder_factory && | 1368 if (decoder_factory && |
| 1369 jni->IsInstanceOf(remote_egl_context, j_eglbase14_context_class)) { | 1369 jni->IsInstanceOf(remote_egl_context, j_eglbase14_context_class)) { |
| 1370 LOG(LS_INFO) << "Set EGL context for HW decoding."; | 1370 LOG(LS_INFO) << "Set EGL context for HW decoding."; |
| 1371 decoder_factory->SetEGLContext(jni, remote_egl_context); | 1371 decoder_factory->SetEGLContext(jni, remote_egl_context); |
| 1372 } | 1372 } |
| 1373 #endif | 1373 #endif |
| 1374 } | 1374 } |
| 1375 | 1375 |
| 1376 static std::string | |
| 1377 GetJavaEnumName(JNIEnv* jni, const std::string& className, jobject j_enum) { | |
| 1378 jclass enumClass = FindClass(jni, className.c_str()); | |
| 1379 jmethodID nameMethod = | |
| 1380 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); | |
| 1381 jstring name = | |
| 1382 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod)); | |
| 1383 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for " | |
| 1384 << className << ".name"; | |
| 1385 return JavaToStdString(jni, name); | |
| 1386 } | |
| 1387 | |
| 1388 static PeerConnectionInterface::IceTransportsType | 1376 static PeerConnectionInterface::IceTransportsType |
| 1389 JavaIceTransportsTypeToNativeType(JNIEnv* jni, jobject j_ice_transports_type) { | 1377 JavaIceTransportsTypeToNativeType(JNIEnv* jni, jobject j_ice_transports_type) { |
| 1390 std::string enum_name = GetJavaEnumName( | 1378 std::string enum_name = GetJavaEnumName( |
| 1391 jni, "org/webrtc/PeerConnection$IceTransportsType", | 1379 jni, "org/webrtc/PeerConnection$IceTransportsType", |
| 1392 j_ice_transports_type); | 1380 j_ice_transports_type); |
| 1393 | 1381 |
| 1394 if (enum_name == "ALL") | 1382 if (enum_name == "ALL") |
| 1395 return PeerConnectionInterface::kAll; | 1383 return PeerConnectionInterface::kAll; |
| 1396 | 1384 |
| 1397 if (enum_name == "RELAY") | 1385 if (enum_name == "RELAY") |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 return JavaStringFromStdString( | 2135 return JavaStringFromStdString( |
| 2148 jni, | 2136 jni, |
| 2149 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2137 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
| 2150 } | 2138 } |
| 2151 | 2139 |
| 2152 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2140 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
| 2153 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2141 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
| 2154 } | 2142 } |
| 2155 | 2143 |
| 2156 } // namespace webrtc_jni | 2144 } // namespace webrtc_jni |
| OLD | NEW |