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

Side by Side Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1556743002: Bind a socket to a network if the network handle is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments Created 4 years, 11 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698