| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
| 12 | 12 |
| 13 #import "WebRTC/RTCPeerConnection.h" | 13 #import "WebRTC/RTCPeerConnection.h" |
| 14 #import "WebRTC/RTCVideoTrack.h" | 14 #import "WebRTC/RTCVideoTrack.h" |
| 15 | 15 |
| 16 typedef NS_ENUM(NSInteger, ARDAppClientState) { | 16 typedef NS_ENUM(NSInteger, ARDAppClientState) { |
| 17 // Disconnected from servers. | 17 // Disconnected from servers. |
| 18 kARDAppClientStateDisconnected, | 18 kARDAppClientStateDisconnected, |
| 19 // Connecting to servers. | 19 // Connecting to servers. |
| 20 kARDAppClientStateConnecting, | 20 kARDAppClientStateConnecting, |
| 21 // Connected to servers. | 21 // Connected to servers. |
| 22 kARDAppClientStateConnected, | 22 kARDAppClientStateConnected, |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 @class ARDAppClient; | 25 @class ARDAppClient; |
| 26 @class RTCMediaConstraints; |
| 27 |
| 26 // The delegate is informed of pertinent events and will be called on the | 28 // The delegate is informed of pertinent events and will be called on the |
| 27 // main queue. | 29 // main queue. |
| 28 @protocol ARDAppClientDelegate <NSObject> | 30 @protocol ARDAppClientDelegate <NSObject> |
| 29 | 31 |
| 30 - (void)appClient:(ARDAppClient *)client | 32 - (void)appClient:(ARDAppClient *)client |
| 31 didChangeState:(ARDAppClientState)state; | 33 didChangeState:(ARDAppClientState)state; |
| 32 | 34 |
| 33 - (void)appClient:(ARDAppClient *)client | 35 - (void)appClient:(ARDAppClient *)client |
| 34 didChangeConnectionState:(RTCIceConnectionState)state; | 36 didChangeConnectionState:(RTCIceConnectionState)state; |
| 35 | 37 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 | 51 |
| 50 // Handles connections to the AppRTC server for a given room. Methods on this | 52 // Handles connections to the AppRTC server for a given room. Methods on this |
| 51 // class should only be called from the main queue. | 53 // class should only be called from the main queue. |
| 52 @interface ARDAppClient : NSObject | 54 @interface ARDAppClient : NSObject |
| 53 | 55 |
| 54 // If |shouldGetStats| is true, stats will be reported in 1s intervals through | 56 // If |shouldGetStats| is true, stats will be reported in 1s intervals through |
| 55 // the delegate. | 57 // the delegate. |
| 56 @property(nonatomic, assign) BOOL shouldGetStats; | 58 @property(nonatomic, assign) BOOL shouldGetStats; |
| 57 @property(nonatomic, readonly) ARDAppClientState state; | 59 @property(nonatomic, readonly) ARDAppClientState state; |
| 58 @property(nonatomic, weak) id<ARDAppClientDelegate> delegate; | 60 @property(nonatomic, weak) id<ARDAppClientDelegate> delegate; |
| 59 | |
| 60 // Convenience constructor since all expected use cases will need a delegate | 61 // Convenience constructor since all expected use cases will need a delegate |
| 61 // in order to receive remote tracks. | 62 // in order to receive remote tracks. |
| 62 - (instancetype)initWithDelegate:(id<ARDAppClientDelegate>)delegate; | 63 - (instancetype)initWithDelegate:(id<ARDAppClientDelegate>)delegate; |
| 63 | 64 |
| 65 // Sets camera constraints. |
| 66 - (void)setCameraConstraints:(RTCMediaConstraints *)mediaConstraints; |
| 67 |
| 64 // Establishes a connection with the AppRTC servers for the given room id. | 68 // Establishes a connection with the AppRTC servers for the given room id. |
| 65 // If |isLoopback| is true, the call will connect to itself. | 69 // If |isLoopback| is true, the call will connect to itself. |
| 66 // If |isAudioOnly| is true, video will be disabled for the call. | 70 // If |isAudioOnly| is true, video will be disabled for the call. |
| 67 // If |shouldMakeAecDump| is true, an aecdump will be created for the call. | 71 // If |shouldMakeAecDump| is true, an aecdump will be created for the call. |
| 68 // If |shouldUseLevelControl| is true, the level controller will be used | 72 // If |shouldUseLevelControl| is true, the level controller will be used |
| 69 // in the call. | 73 // in the call. |
| 70 - (void)connectToRoomWithId:(NSString *)roomId | 74 - (void)connectToRoomWithId:(NSString *)roomId |
| 71 isLoopback:(BOOL)isLoopback | 75 isLoopback:(BOOL)isLoopback |
| 72 isAudioOnly:(BOOL)isAudioOnly | 76 isAudioOnly:(BOOL)isAudioOnly |
| 73 shouldMakeAecDump:(BOOL)shouldMakeAecDump | 77 shouldMakeAecDump:(BOOL)shouldMakeAecDump |
| 74 shouldUseLevelControl:(BOOL)shouldUseLevelControl; | 78 shouldUseLevelControl:(BOOL)shouldUseLevelControl; |
| 75 | 79 |
| 76 // Disconnects from the AppRTC servers and any connected clients. | 80 // Disconnects from the AppRTC servers and any connected clients. |
| 77 - (void)disconnect; | 81 - (void)disconnect; |
| 78 | 82 |
| 79 @end | 83 @end |
| OLD | NEW |