public WebRtcNative() { p = NewConductor(); #region -- events -- _onRenderLocal = new _OnRenderCallback(_OnRenderLocal); onRenderLocal(p, Marshal.GetFunctionPointerForDelegate(_onRenderLocal)); _onRenderRemote = new _OnRenderCallback(_OnRenderRemote); onRenderRemote(p, Marshal.GetFunctionPointerForDelegate(_onRenderRemote)); _onError = new _OnErrorCallback(_OnError); onError(p, Marshal.GetFunctionPointerForDelegate(_onError)); _onSuccess = new _OnSuccessCallback(_OnSuccess); onSuccess(p, Marshal.GetFunctionPointerForDelegate(_onSuccess)); _onFailure = new _OnFailureCallback(_OnFailure); onFailure(p, Marshal.GetFunctionPointerForDelegate(_onFailure)); _onDataMessage = new _OnDataMessageCallback(_OnDataMessage); onDataMessage(p, Marshal.GetFunctionPointerForDelegate(_onDataMessage)); _onDataBinaryMessage = new _OnDataBinaryMessageCallback(_OnDataBinaryMessage); onDataBinaryMessage(p, Marshal.GetFunctionPointerForDelegate(_onDataBinaryMessage)); _onIceCandidate = new _OnIceCandidateCallback(_OnIceCandidate); onIceCandidate(p, Marshal.GetFunctionPointerForDelegate(_onIceCandidate)); #endregion }
public SpitfireRtc(int minPort, int maxPort) { this.minPort = minPort; this.maxPort = maxPort; p = NewConductor(); #region -- events -- //_onRenderLocal = new _OnRenderCallback(_OnRenderLocal); //onRenderLocal(p, Marshal.GetFunctionPointerForDelegate(_onRenderLocal)); //_onRenderRemote = new _OnRenderCallback(_OnRenderRemote); //onRenderRemote(p, Marshal.GetFunctionPointerForDelegate(_onRenderRemote)); _onError = new _OnErrorCallback(_OnError); onError(p, Marshal.GetFunctionPointerForDelegate(_onError)); _onSuccess = new _OnSuccessCallback(_OnSuccess); onSuccess(p, Marshal.GetFunctionPointerForDelegate(_onSuccess)); _onFailure = new _OnFailureCallback(_OnFailure); onFailure(p, Marshal.GetFunctionPointerForDelegate(_onFailure)); _onDataMessage = new _OnDataMessageCallback(_OnDataMessage); onDataMessage(p, Marshal.GetFunctionPointerForDelegate(_onDataMessage)); _onDataBinaryMessage = new _OnDataBinaryMessageCallback(_OnDataBinaryMessage); onDataBinaryMessage(p, Marshal.GetFunctionPointerForDelegate(_onDataBinaryMessage)); _onIceCandidate = new _OnIceCandidateCallback(_OnIceCandidate); onIceCandidate(p, Marshal.GetFunctionPointerForDelegate(_onIceCandidate)); _onDataChannelStateChange = new _OnDataChannelStateChangedCallback(_OnDataChannelStateChange); onDataChannelStateChange(p, Marshal.GetFunctionPointerForDelegate(_onDataChannelStateChange)); this.OnDataChannelStateChanged += SpitfireRtc_OnDataChannelStateChanged; #endregion }