Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 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 | |
| 11 | #import <Foundation/Foundation.h> |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 12 | |
Mirko Bonadei | 19640aa | 2020-10-19 16:12:43 +0200 | [diff] [blame] | 13 | #import "sdk/objc/api/peerconnection/RTCIceCandidate.h" |
| 14 | #import "sdk/objc/api/peerconnection/RTCSessionDescription.h" |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 15 | |
| 16 | typedef enum { |
| 17 | kARDSignalingMessageTypeCandidate, |
Honghai Zhang | da2ba4d | 2016-05-23 11:53:14 -0700 | [diff] [blame] | 18 | kARDSignalingMessageTypeCandidateRemoval, |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 19 | kARDSignalingMessageTypeOffer, |
| 20 | kARDSignalingMessageTypeAnswer, |
| 21 | kARDSignalingMessageTypeBye, |
| 22 | } ARDSignalingMessageType; |
| 23 | |
| 24 | @interface ARDSignalingMessage : NSObject |
| 25 | |
| 26 | @property(nonatomic, readonly) ARDSignalingMessageType type; |
| 27 | |
| 28 | + (ARDSignalingMessage *)messageFromJSONString:(NSString *)jsonString; |
| 29 | - (NSData *)JSONData; |
| 30 | |
| 31 | @end |
| 32 | |
| 33 | @interface ARDICECandidateMessage : ARDSignalingMessage |
| 34 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 35 | @property(nonatomic, readonly) RTC_OBJC_TYPE(RTCIceCandidate) * candidate; |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 36 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 37 | - (instancetype)initWithCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate; |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 38 | |
| 39 | @end |
| 40 | |
Honghai Zhang | da2ba4d | 2016-05-23 11:53:14 -0700 | [diff] [blame] | 41 | @interface ARDICECandidateRemovalMessage : ARDSignalingMessage |
| 42 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 43 | @property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *candidates; |
Honghai Zhang | da2ba4d | 2016-05-23 11:53:14 -0700 | [diff] [blame] | 44 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 45 | - (instancetype)initWithRemovedCandidates:(NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *)candidates; |
Honghai Zhang | da2ba4d | 2016-05-23 11:53:14 -0700 | [diff] [blame] | 46 | |
| 47 | @end |
| 48 | |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 49 | @interface ARDSessionDescriptionMessage : ARDSignalingMessage |
| 50 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 51 | @property(nonatomic, readonly) RTC_OBJC_TYPE(RTCSessionDescription) * sessionDescription; |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 52 | |
Mirko Bonadei | a81e9c8 | 2020-05-04 16:14:32 +0200 | [diff] [blame] | 53 | - (instancetype)initWithDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)description; |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 54 | |
| 55 | @end |
| 56 | |
| 57 | @interface ARDByeMessage : ARDSignalingMessage |
| 58 | @end |