Update native plugin dll for turn servers and video.
This CL was modified from work of sharifferdous@ (intern supervised by lliuu@)
BUG=webrtc:7389
Review-Url: https://codereview.webrtc.org/2987723002
Cr-Commit-Position: refs/heads/master@{#19146}
diff --git a/webrtc/examples/unityplugin/unity_plugin_apis.h b/webrtc/examples/unityplugin/unity_plugin_apis.h
index bcd1af3..ee7d709 100644
--- a/webrtc/examples/unityplugin/unity_plugin_apis.h
+++ b/webrtc/examples/unityplugin/unity_plugin_apis.h
@@ -15,16 +15,22 @@
#include <stdint.h>
-// Defintions of callback functions.
-typedef void (*VIDEOFRAMEREADY_CALLBACK)(uint8_t* buffer,
- uint32_t width,
- uint32_t height,
- uint32_t stride);
+// Definitions of callback functions.
+typedef void (*I420FRAMEREADY_CALLBACK)(const uint8_t* data_y,
+ const uint8_t* data_u,
+ const uint8_t* data_v,
+ int stride_y,
+ int stride_u,
+ int stride_v,
+ uint32_t width,
+ uint32_t height);
typedef void (*LOCALDATACHANNELREADY_CALLBACK)();
typedef void (*DATAFROMEDATECHANNELREADY_CALLBACK)(const char* msg);
typedef void (*FAILURE_CALLBACK)(const char* msg);
-typedef void (*LOCALSDPREADYTOSEND_CALLBACK)(const char* msg);
-typedef void (*ICECANDIDATEREADYTOSEND_CALLBACK)(const char* msg);
+typedef void (*LOCALSDPREADYTOSEND_CALLBACK)(const char* type, const char* sdp);
+typedef void (*ICECANDIDATEREADYTOSEND_CALLBACK)(const char* candidate,
+ const int sdp_mline_index,
+ const char* sdp_mid);
typedef void (*AUDIOBUSREADY_CALLBACK)(const void* audio_data,
int bits_per_sample,
int sample_rate,
@@ -34,7 +40,10 @@
#define WEBRTC_PLUGIN_API __declspec(dllexport)
extern "C" {
// Create a peerconnection and return a unique peer connection id.
-WEBRTC_PLUGIN_API int CreatePeerConnection();
+WEBRTC_PLUGIN_API int CreatePeerConnection(const char** turn_urls,
+ const int no_of_urls,
+ const char* username,
+ const char* credential);
// Close a peerconnection.
WEBRTC_PLUGIN_API bool ClosePeerConnection(int peer_connection_id);
// Add a audio stream. If audio_only is true, the stream only has an audio
@@ -54,11 +63,23 @@
WEBRTC_PLUGIN_API bool SetAudioControl(int peer_connection_id,
bool is_mute,
bool is_record);
+// Set remote sdp.
+WEBRTC_PLUGIN_API bool SetRemoteDescription(int peer_connection_id,
+ const char* type,
+ const char* sdp);
+// Add ice candidate.
+WEBRTC_PLUGIN_API bool AddIceCandidate(const int peer_connection_id,
+ const char* candidate,
+ const int sdp_mlineindex,
+ const char* sdp_mid);
// Register callback functions.
-WEBRTC_PLUGIN_API bool RegisterOnVideoFramReady(
+WEBRTC_PLUGIN_API bool RegisterOnLocalI420FrameReady(
int peer_connection_id,
- VIDEOFRAMEREADY_CALLBACK callback);
+ I420FRAMEREADY_CALLBACK callback);
+WEBRTC_PLUGIN_API bool RegisterOnRemoteI420FrameReady(
+ int peer_connection_id,
+ I420FRAMEREADY_CALLBACK callback);
WEBRTC_PLUGIN_API bool RegisterOnLocalDataChannelReady(
int peer_connection_id,
LOCALDATACHANNELREADY_CALLBACK callback);
@@ -75,9 +96,6 @@
WEBRTC_PLUGIN_API bool RegisterOnIceCandiateReadytoSend(
int peer_connection_id,
ICECANDIDATEREADYTOSEND_CALLBACK callback);
-WEBRTC_PLUGIN_API int ReceivedSdp(int peer_connection_id, const char* sdp);
-WEBRTC_PLUGIN_API bool ReceivedIceCandidate(int peer_connection_id,
- const char* ice_candidate);
}
#endif // WEBRTC_EXAMPLES_UNITYPLUGIN_UNITY_PLUGIN_APIS_H_