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 | |
| 13 | #import "WebRTC/RTCIceCandidate.h" |
| 14 | #import "WebRTC/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 | |
hjon | 79858f8 | 2016-03-13 22:08:26 -0700 | [diff] [blame] | 35 | @property(nonatomic, readonly) RTCIceCandidate *candidate; |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 36 | |
hjon | 79858f8 | 2016-03-13 22:08:26 -0700 | [diff] [blame] | 37 | - (instancetype)initWithCandidate:(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 | |
| 43 | @property(nonatomic, readonly) NSArray<RTCIceCandidate *> *candidates; |
| 44 | |
| 45 | - (instancetype)initWithRemovedCandidates: |
| 46 | (NSArray<RTCIceCandidate *> *)candidates; |
| 47 | |
| 48 | @end |
| 49 | |
Donald E Curtis | a873644 | 2015-08-05 15:48:13 -0700 | [diff] [blame] | 50 | @interface ARDSessionDescriptionMessage : ARDSignalingMessage |
| 51 | |
| 52 | @property(nonatomic, readonly) RTCSessionDescription *sessionDescription; |
| 53 | |
| 54 | - (instancetype)initWithDescription:(RTCSessionDescription *)description; |
| 55 | |
| 56 | @end |
| 57 | |
| 58 | @interface ARDByeMessage : ARDSignalingMessage |
| 59 | @end |