/// <summary> /// /// </summary> /// <param name="candidateInfo"></param> public RTCIceCandidate(RTCIceCandidateInit candidateInfo = null) { candidateInfo = candidateInfo ?? new RTCIceCandidateInit(); if (candidateInfo.sdpMLineIndex == null && candidateInfo.sdpMid == null) { throw new ArgumentException("sdpMid and sdpMLineIndex are both null"); } RTCIceCandidateInitInternal option = (RTCIceCandidateInitInternal)candidateInfo; RTCErrorType error = NativeMethods.CreateIceCandidate(ref option, out self); if (error != RTCErrorType.None) { throw new ArgumentException( $"create candidate is failed. error type:{error}, " + $"candidate:{candidateInfo.candidate}\n" + $"sdpMid:{candidateInfo.sdpMid}\n" + $"sdpMLineIndex:{candidateInfo.sdpMLineIndex}\n"); } NativeMethods.IceCandidateGetCandidate(self, out _candidate); }
public static extern RTCErrorType CreateIceCandidate(ref RTCIceCandidateInitInternal options, out IntPtr candidate);