OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_ | 11 #ifndef WEBRTC_SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_ |
12 #define WEBRTC_SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_ | 12 #define WEBRTC_SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_ |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/api/datachannelinterface.h" | 16 #include "webrtc/api/datachannelinterface.h" |
17 #include "webrtc/api/jsep.h" | 17 #include "webrtc/api/jsep.h" |
18 #include "webrtc/api/jsepicecandidate.h" | 18 #include "webrtc/api/jsepicecandidate.h" |
19 #include "webrtc/api/mediastreaminterface.h" | 19 #include "webrtc/api/mediastreaminterface.h" |
20 #include "webrtc/api/mediatypes.h" | 20 #include "webrtc/api/mediatypes.h" |
21 #include "webrtc/api/peerconnectioninterface.h" | 21 #include "webrtc/api/peerconnectioninterface.h" |
22 #include "webrtc/api/rtpparameters.h" | 22 #include "webrtc/api/rtpparameters.h" |
23 #include "webrtc/rtc_base/sslidentity.h" | 23 #include "webrtc/rtc_base/sslidentity.h" |
24 #include "webrtc/sdk/android/src/jni/jni_helpers.h" | 24 #include "webrtc/sdk/android/src/jni/jni_helpers.h" |
25 | 25 |
26 // This file contains helper methods for converting between simple C++ and Java | 26 // This file contains helper methods for converting between simple C++ and Java |
27 // PeerConnection-related structures. Similar to some methods in jni_helpers.h, | 27 // PeerConnection-related structures. Similar to some methods in jni_helpers.h, |
28 // but specifically for structures tied to the PeerConnection API. | 28 // but specifically for structures tied to the PeerConnection API. |
29 | 29 |
30 namespace webrtc_jni { | 30 namespace webrtc { |
| 31 namespace jni { |
31 | 32 |
32 webrtc::DataChannelInit JavaToNativeDataChannelInit(JNIEnv* jni, | 33 DataChannelInit JavaToNativeDataChannelInit(JNIEnv* jni, jobject j_init); |
33 jobject j_init); | |
34 | 34 |
35 cricket::MediaType JavaToNativeMediaType(JNIEnv* jni, jobject j_media_type); | 35 cricket::MediaType JavaToNativeMediaType(JNIEnv* jni, jobject j_media_type); |
36 | 36 |
37 jobject NativeToJavaMediaType(JNIEnv* jni, cricket::MediaType media_type); | 37 jobject NativeToJavaMediaType(JNIEnv* jni, cricket::MediaType media_type); |
38 | 38 |
39 cricket::Candidate JavaToNativeCandidate(JNIEnv* jni, jobject j_candidate); | 39 cricket::Candidate JavaToNativeCandidate(JNIEnv* jni, jobject j_candidate); |
40 | 40 |
41 jobject NativeToJavaCandidate(JNIEnv* jni, | 41 jobject NativeToJavaCandidate(JNIEnv* jni, |
42 jclass* candidate_class, | 42 jclass* candidate_class, |
43 const cricket::Candidate& candidate); | 43 const cricket::Candidate& candidate); |
44 | 44 |
45 jobjectArray NativeToJavaCandidateArray( | 45 jobjectArray NativeToJavaCandidateArray( |
46 JNIEnv* jni, | 46 JNIEnv* jni, |
47 const std::vector<cricket::Candidate>& candidates); | 47 const std::vector<cricket::Candidate>& candidates); |
48 | 48 |
49 webrtc::SessionDescriptionInterface* JavaToNativeSessionDescription( | 49 SessionDescriptionInterface* JavaToNativeSessionDescription(JNIEnv* jni, |
50 JNIEnv* jni, | 50 jobject j_sdp); |
51 jobject j_sdp); | |
52 | 51 |
53 jobject NativeToJavaSessionDescription( | 52 jobject NativeToJavaSessionDescription(JNIEnv* jni, |
54 JNIEnv* jni, | 53 const SessionDescriptionInterface* desc); |
55 const webrtc::SessionDescriptionInterface* desc); | |
56 | 54 |
57 webrtc::PeerConnectionFactoryInterface::Options | 55 PeerConnectionFactoryInterface::Options |
58 JavaToNativePeerConnectionFactoryOptions(JNIEnv* jni, jobject options); | 56 JavaToNativePeerConnectionFactoryOptions(JNIEnv* jni, jobject options); |
59 | 57 |
60 /***************************************************** | 58 /***************************************************** |
61 * Below are all things that go into RTCConfiguration. | 59 * Below are all things that go into RTCConfiguration. |
62 *****************************************************/ | 60 *****************************************************/ |
63 webrtc::PeerConnectionInterface::IceTransportsType | 61 PeerConnectionInterface::IceTransportsType JavaToNativeIceTransportsType( |
64 JavaToNativeIceTransportsType(JNIEnv* jni, jobject j_ice_transports_type); | 62 JNIEnv* jni, |
| 63 jobject j_ice_transports_type); |
65 | 64 |
66 webrtc::PeerConnectionInterface::BundlePolicy JavaToNativeBundlePolicy( | 65 PeerConnectionInterface::BundlePolicy JavaToNativeBundlePolicy( |
67 JNIEnv* jni, | 66 JNIEnv* jni, |
68 jobject j_bundle_policy); | 67 jobject j_bundle_policy); |
69 | 68 |
70 webrtc::PeerConnectionInterface::RtcpMuxPolicy JavaToNativeRtcpMuxPolicy( | 69 PeerConnectionInterface::RtcpMuxPolicy JavaToNativeRtcpMuxPolicy( |
71 JNIEnv* jni, | 70 JNIEnv* jni, |
72 jobject j_rtcp_mux_policy); | 71 jobject j_rtcp_mux_policy); |
73 | 72 |
74 webrtc::PeerConnectionInterface::TcpCandidatePolicy | 73 PeerConnectionInterface::TcpCandidatePolicy JavaToNativeTcpCandidatePolicy( |
75 JavaToNativeTcpCandidatePolicy(JNIEnv* jni, jobject j_tcp_candidate_policy); | 74 JNIEnv* jni, |
| 75 jobject j_tcp_candidate_policy); |
76 | 76 |
77 webrtc::PeerConnectionInterface::CandidateNetworkPolicy | 77 PeerConnectionInterface::CandidateNetworkPolicy |
78 JavaToNativeCandidateNetworkPolicy(JNIEnv* jni, | 78 JavaToNativeCandidateNetworkPolicy(JNIEnv* jni, |
79 jobject j_candidate_network_policy); | 79 jobject j_candidate_network_policy); |
80 | 80 |
81 rtc::KeyType JavaToNativeKeyType(JNIEnv* jni, jobject j_key_type); | 81 rtc::KeyType JavaToNativeKeyType(JNIEnv* jni, jobject j_key_type); |
82 | 82 |
83 webrtc::PeerConnectionInterface::ContinualGatheringPolicy | 83 PeerConnectionInterface::ContinualGatheringPolicy |
84 JavaToNativeContinualGatheringPolicy(JNIEnv* jni, jobject j_gathering_policy); | 84 JavaToNativeContinualGatheringPolicy(JNIEnv* jni, jobject j_gathering_policy); |
85 | 85 |
86 webrtc::PeerConnectionInterface::TlsCertPolicy JavaToNativeTlsCertPolicy( | 86 PeerConnectionInterface::TlsCertPolicy JavaToNativeTlsCertPolicy( |
87 JNIEnv* jni, | 87 JNIEnv* jni, |
88 jobject j_ice_server_tls_cert_policy); | 88 jobject j_ice_server_tls_cert_policy); |
89 | 89 |
90 void JavaToNativeIceServers( | 90 void JavaToNativeIceServers(JNIEnv* jni, |
91 JNIEnv* jni, | 91 jobject j_ice_servers, |
92 jobject j_ice_servers, | 92 PeerConnectionInterface::IceServers* ice_servers); |
93 webrtc::PeerConnectionInterface::IceServers* ice_servers); | |
94 | 93 |
95 void JavaToNativeRTCConfiguration( | 94 void JavaToNativeRTCConfiguration( |
96 JNIEnv* jni, | 95 JNIEnv* jni, |
97 jobject j_rtc_config, | 96 jobject j_rtc_config, |
98 webrtc::PeerConnectionInterface::RTCConfiguration* rtc_config); | 97 PeerConnectionInterface::RTCConfiguration* rtc_config); |
99 | 98 |
100 /********************************************************* | 99 /********************************************************* |
101 * RtpParameters, used for RtpSender and RtpReceiver APIs. | 100 * RtpParameters, used for RtpSender and RtpReceiver APIs. |
102 *********************************************************/ | 101 *********************************************************/ |
103 void JavaToNativeRtpParameters(JNIEnv* jni, | 102 void JavaToNativeRtpParameters(JNIEnv* jni, |
104 jobject j_parameters, | 103 jobject j_parameters, |
105 webrtc::RtpParameters* parameters); | 104 RtpParameters* parameters); |
106 | 105 |
107 jobject NativeToJavaRtpParameters(JNIEnv* jni, | 106 jobject NativeToJavaRtpParameters(JNIEnv* jni, const RtpParameters& parameters); |
108 const webrtc::RtpParameters& parameters); | |
109 | 107 |
110 } // namespace webrtc_jni | 108 } // namespace jni |
| 109 } // namespace webrtc |
111 | 110 |
112 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_ | 111 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_ |
OLD | NEW |