webrtc_m130/sdk/android/src/jni/pc/java_native_conversion.h
Magnus Jedvert 43d069a2cd Revert "Android: Generate JNI code for stats"
This reverts commit aede67a199ae0552074bfec4bb03cc9a6a5fba0f.

Reason for revert: Causes error:
JNI ERROR (app bug): local reference table overflow (max=512)'

Original change's description:
> Android: Generate JNI code for stats
> 
> This CL also unifies the functions for converting from C++ to Java, and
> generates the boiler plate for converting C++ vectors to Java arrays.
> 
> Bug: webrtc:8278
> Change-Id: I262e9162beae8a64ba0e8b6a27e1081207b03961
> Reviewed-on: https://webrtc-review.googlesource.com/26020
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20918}

TBR=magjed@webrtc.org,sakal@webrtc.org

Change-Id: Ieb26ed8577bd489a4dd4f7542d16a7d0e11f409f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8278
Reviewed-on: https://webrtc-review.googlesource.com/26900
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20926}
2017-11-29 10:09:10 +00:00

111 lines
3.9 KiB
C++

/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_
#define SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_
#include <vector>
#include "api/datachannelinterface.h"
#include "api/jsep.h"
#include "api/jsepicecandidate.h"
#include "api/mediastreaminterface.h"
#include "api/mediatypes.h"
#include "api/peerconnectioninterface.h"
#include "api/rtpparameters.h"
#include "rtc_base/sslidentity.h"
#include "sdk/android/src/jni/jni_helpers.h"
// This file contains helper methods for converting between simple C++ and Java
// PeerConnection-related structures. Similar to some methods in jni_helpers.h,
// but specifically for structures tied to the PeerConnection API.
namespace webrtc {
namespace jni {
cricket::MediaType JavaToNativeMediaType(JNIEnv* jni, jobject j_media_type);
jobject NativeToJavaMediaType(JNIEnv* jni, cricket::MediaType media_type);
cricket::Candidate JavaToNativeCandidate(JNIEnv* jni, jobject j_candidate);
jobject NativeToJavaCandidate(JNIEnv* env, const cricket::Candidate& candidate);
jobject NativeToJavaCandidate(JNIEnv* env,
const IceCandidateInterface& candidate);
jobjectArray NativeToJavaCandidateArray(
JNIEnv* jni,
const std::vector<cricket::Candidate>& candidates);
SessionDescriptionInterface* JavaToNativeSessionDescription(JNIEnv* jni,
jobject j_sdp);
jobject NativeToJavaSessionDescription(JNIEnv* jni,
const SessionDescriptionInterface* desc);
PeerConnectionFactoryInterface::Options
JavaToNativePeerConnectionFactoryOptions(JNIEnv* jni, jobject options);
/*****************************************************
* Below are all things that go into RTCConfiguration.
*****************************************************/
PeerConnectionInterface::IceTransportsType JavaToNativeIceTransportsType(
JNIEnv* jni,
jobject j_ice_transports_type);
PeerConnectionInterface::BundlePolicy JavaToNativeBundlePolicy(
JNIEnv* jni,
jobject j_bundle_policy);
PeerConnectionInterface::RtcpMuxPolicy JavaToNativeRtcpMuxPolicy(
JNIEnv* jni,
jobject j_rtcp_mux_policy);
PeerConnectionInterface::TcpCandidatePolicy JavaToNativeTcpCandidatePolicy(
JNIEnv* jni,
jobject j_tcp_candidate_policy);
PeerConnectionInterface::CandidateNetworkPolicy
JavaToNativeCandidateNetworkPolicy(JNIEnv* jni,
jobject j_candidate_network_policy);
rtc::KeyType JavaToNativeKeyType(JNIEnv* jni, jobject j_key_type);
PeerConnectionInterface::ContinualGatheringPolicy
JavaToNativeContinualGatheringPolicy(JNIEnv* jni, jobject j_gathering_policy);
PeerConnectionInterface::TlsCertPolicy JavaToNativeTlsCertPolicy(
JNIEnv* jni,
jobject j_ice_server_tls_cert_policy);
void JavaToNativeIceServers(JNIEnv* jni,
jobject j_ice_servers,
PeerConnectionInterface::IceServers* ice_servers);
void JavaToNativeRTCConfiguration(
JNIEnv* jni,
jobject j_rtc_config,
PeerConnectionInterface::RTCConfiguration* rtc_config);
/*********************************************************
* RtpParameters, used for RtpSender and RtpReceiver APIs.
*********************************************************/
void JavaToNativeRtpParameters(JNIEnv* jni,
jobject j_parameters,
RtpParameters* parameters);
jobject NativeToJavaRtpParameters(JNIEnv* jni, const RtpParameters& parameters);
} // namespace jni
} // namespace webrtc
#endif // SDK_ANDROID_SRC_JNI_PC_JAVA_NATIVE_CONVERSION_H_