ISignaling.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. using Unity.WebRTC;
  2. namespace Unity.RenderStreaming.Signaling
  3. {
  4. public delegate void OnStartHandler(ISignaling signaling);
  5. public delegate void OnConnectHandler(ISignaling signaling, string connectionId, bool polite);
  6. public delegate void OnDisconnectHandler(ISignaling signaling, string connectionId);
  7. public delegate void OnOfferHandler(ISignaling signaling, DescData e);
  8. public delegate void OnAnswerHandler(ISignaling signaling, DescData e);
  9. public delegate void OnIceCandidateHandler(ISignaling signaling, CandidateData e);
  10. public interface ISignaling
  11. {
  12. void Start();
  13. void Stop();
  14. event OnStartHandler OnStart;
  15. event OnConnectHandler OnCreateConnection;
  16. event OnDisconnectHandler OnDestroyConnection;
  17. event OnOfferHandler OnOffer;
  18. event OnAnswerHandler OnAnswer;
  19. event OnIceCandidateHandler OnIceCandidate;
  20. string Url { get; }
  21. void OpenConnection(string connectionId);
  22. void CloseConnection(string connectionId);
  23. void SendOffer(string connectionId, RTCSessionDescription offer);
  24. void SendAnswer(string connectionId, RTCSessionDescription answer);
  25. void SendCandidate(string connectionId, RTCIceCandidate candidate);
  26. }
  27. }