1 /* 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef SDK_ANDROID_SRC_JNI_PC_ICE_CANDIDATE_H_ 12 #define SDK_ANDROID_SRC_JNI_PC_ICE_CANDIDATE_H_ 13 14 #include <vector> 15 16 #include "api/data_channel_interface.h" 17 #include "api/jsep.h" 18 #include "api/jsep_ice_candidate.h" 19 #include "api/peer_connection_interface.h" 20 #include "api/rtp_parameters.h" 21 #include "rtc_base/ssl_identity.h" 22 #include "sdk/android/src/jni/jni_helpers.h" 23 24 namespace webrtc { 25 namespace jni { 26 27 cricket::Candidate JavaToNativeCandidate(JNIEnv* jni, 28 const JavaRef<jobject>& j_candidate); 29 30 ScopedJavaLocalRef<jobject> NativeToJavaCandidate( 31 JNIEnv* env, 32 const cricket::Candidate& candidate); 33 34 ScopedJavaLocalRef<jobject> NativeToJavaIceCandidate( 35 JNIEnv* env, 36 const IceCandidateInterface& candidate); 37 38 ScopedJavaLocalRef<jobjectArray> NativeToJavaCandidateArray( 39 JNIEnv* jni, 40 const std::vector<cricket::Candidate>& candidates); 41 42 /***************************************************** 43 * Below are all things that go into RTCConfiguration. 44 *****************************************************/ 45 PeerConnectionInterface::IceTransportsType JavaToNativeIceTransportsType( 46 JNIEnv* jni, 47 const JavaRef<jobject>& j_ice_transports_type); 48 49 PeerConnectionInterface::BundlePolicy JavaToNativeBundlePolicy( 50 JNIEnv* jni, 51 const JavaRef<jobject>& j_bundle_policy); 52 53 PeerConnectionInterface::RtcpMuxPolicy JavaToNativeRtcpMuxPolicy( 54 JNIEnv* jni, 55 const JavaRef<jobject>& j_rtcp_mux_policy); 56 57 PeerConnectionInterface::TcpCandidatePolicy JavaToNativeTcpCandidatePolicy( 58 JNIEnv* jni, 59 const JavaRef<jobject>& j_tcp_candidate_policy); 60 61 PeerConnectionInterface::CandidateNetworkPolicy 62 JavaToNativeCandidateNetworkPolicy( 63 JNIEnv* jni, 64 const JavaRef<jobject>& j_candidate_network_policy); 65 66 rtc::KeyType JavaToNativeKeyType(JNIEnv* jni, 67 const JavaRef<jobject>& j_key_type); 68 69 PeerConnectionInterface::ContinualGatheringPolicy 70 JavaToNativeContinualGatheringPolicy( 71 JNIEnv* jni, 72 const JavaRef<jobject>& j_gathering_policy); 73 74 webrtc::PortPrunePolicy JavaToNativePortPrunePolicy( 75 JNIEnv* jni, 76 const JavaRef<jobject>& j_port_prune_policy); 77 78 PeerConnectionInterface::TlsCertPolicy JavaToNativeTlsCertPolicy( 79 JNIEnv* jni, 80 const JavaRef<jobject>& j_ice_server_tls_cert_policy); 81 82 absl::optional<rtc::AdapterType> JavaToNativeNetworkPreference( 83 JNIEnv* jni, 84 const JavaRef<jobject>& j_network_preference); 85 86 } // namespace jni 87 } // namespace webrtc 88 89 #endif // SDK_ANDROID_SRC_JNI_PC_ICE_CANDIDATE_H_ 90