ARDSignalingMessage.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 2014 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #import <Foundation/Foundation.h>
  11. #import <WebRTC/RTCIceCandidate.h>
  12. #import <WebRTC/RTCSessionDescription.h>
  13. typedef enum {
  14. kARDSignalingMessageTypeCandidate,
  15. kARDSignalingMessageTypeCandidateRemoval,
  16. kARDSignalingMessageTypeOffer,
  17. kARDSignalingMessageTypeAnswer,
  18. kARDSignalingMessageTypeBye,
  19. } ARDSignalingMessageType;
  20. @interface ARDSignalingMessage : NSObject
  21. @property(nonatomic, readonly) ARDSignalingMessageType type;
  22. + (ARDSignalingMessage *)messageFromJSONString:(NSString *)jsonString;
  23. - (NSData *)JSONData;
  24. @end
  25. @interface ARDICECandidateMessage : ARDSignalingMessage
  26. @property(nonatomic, readonly) RTC_OBJC_TYPE(RTCIceCandidate) * candidate;
  27. - (instancetype)initWithCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate;
  28. @end
  29. @interface ARDICECandidateRemovalMessage : ARDSignalingMessage
  30. @property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *candidates;
  31. - (instancetype)initWithRemovedCandidates:(NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *)candidates;
  32. @end
  33. @interface ARDSessionDescriptionMessage : ARDSignalingMessage
  34. @property(nonatomic, readonly) RTC_OBJC_TYPE(RTCSessionDescription) * sessionDescription;
  35. - (instancetype)initWithDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)description;
  36. @end
  37. @interface ARDByeMessage : ARDSignalingMessage
  38. @end