10e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org/* 20e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * libjingle 352348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org * Copyright 2014, Google Inc. 40e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * 50e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * Redistribution and use in source and binary forms, with or without 60e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * modification, are permitted provided that the following conditions are met: 70e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * 80e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * 1. Redistributions of source code must retain the above copyright notice, 90e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * this list of conditions and the following disclaimer. 100e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * 2. Redistributions in binary form must reproduce the above copyright notice, 110e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * this list of conditions and the following disclaimer in the documentation 120e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * and/or other materials provided with the distribution. 130e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * 3. The name of the author may not be used to endorse or promote products 140e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * derived from this software without specific prior written permission. 150e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * 160e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 170e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 180e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 190e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 200e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 210e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 220e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 230e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 240e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 250e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 260e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org */ 270e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org 2852348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org#import <Foundation/Foundation.h> 290e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org 3052348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org// Used to log messages to destination like UI. 3152348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@protocol APPRTCLogger<NSObject> 3252348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)logMessage:(NSString*)message; 330e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org@end 340e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org 356e2c318450409ed8a96e9acfee1bebb4aa72a5b2henrike@webrtc.org@class RTCVideoTrack; 3652348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@class APPRTCConnectionManager; 3752348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org 3852348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org// Used to provide AppRTC connection information. 3952348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@protocol APPRTCConnectionManagerDelegate<NSObject> 4052348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org 4152348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)connectionManager:(APPRTCConnectionManager*)manager 4252348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org didReceiveLocalVideoTrack:(RTCVideoTrack*)localVideoTrack; 4352348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org 4452348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)connectionManager:(APPRTCConnectionManager*)manager 4552348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org didReceiveRemoteVideoTrack:(RTCVideoTrack*)remoteVideoTrack; 4652348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org 4752348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)connectionManagerDidReceiveHangup:(APPRTCConnectionManager*)manager; 4852348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org 4952348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)connectionManager:(APPRTCConnectionManager*)manager 5052348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org didErrorWithMessage:(NSString*)errorMessage; 5152348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org 5252348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@end 530e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org 5452348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org// Abstracts the network connection aspect of AppRTC. The delegate will receive 5552348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org// information about connection status as changes occur. 5652348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@interface APPRTCConnectionManager : NSObject 570e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org 5852348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@property(nonatomic, weak) id<APPRTCConnectionManagerDelegate> delegate; 5952348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org@property(nonatomic, weak) id<APPRTCLogger> logger; 600e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org 6152348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (instancetype)initWithDelegate:(id<APPRTCConnectionManagerDelegate>)delegate 6252348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org logger:(id<APPRTCLogger>)logger; 6352348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (BOOL)connectToRoomWithURL:(NSURL*)url; 6452348f6729702ec8888955b7aa5d6b47a4727e6atkchin@webrtc.org- (void)disconnect; 656e2c318450409ed8a96e9acfee1bebb4aa72a5b2henrike@webrtc.org 660e118e7129884fbea117e78d6f2068139a414dbhenrike@webrtc.org@end 67