| 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 "ARDAppClient+Internal.h" | 11 #import "ARDAppClient+Internal.h" |
| 12 | 12 |
| 13 #if defined(WEBRTC_IOS) | |
| 14 #import "WebRTC/RTCAVFoundationVideoSource.h" | 13 #import "WebRTC/RTCAVFoundationVideoSource.h" |
| 15 #endif | |
| 16 #import "WebRTC/RTCAudioTrack.h" | 14 #import "WebRTC/RTCAudioTrack.h" |
| 17 #import "WebRTC/RTCConfiguration.h" | 15 #import "WebRTC/RTCConfiguration.h" |
| 18 #import "WebRTC/RTCFileLogger.h" | 16 #import "WebRTC/RTCFileLogger.h" |
| 19 #import "WebRTC/RTCIceServer.h" | 17 #import "WebRTC/RTCIceServer.h" |
| 20 #import "WebRTC/RTCLogging.h" | 18 #import "WebRTC/RTCLogging.h" |
| 21 #import "WebRTC/RTCMediaConstraints.h" | 19 #import "WebRTC/RTCMediaConstraints.h" |
| 22 #import "WebRTC/RTCMediaStream.h" | 20 #import "WebRTC/RTCMediaStream.h" |
| 23 #import "WebRTC/RTCPeerConnectionFactory.h" | 21 #import "WebRTC/RTCPeerConnectionFactory.h" |
| 24 #import "WebRTC/RTCRtpSender.h" | 22 #import "WebRTC/RTCRtpSender.h" |
| 25 #import "WebRTC/RTCTracing.h" | 23 #import "WebRTC/RTCTracing.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 46 static NSInteger const kARDAppClientErrorUnknown = -1; | 44 static NSInteger const kARDAppClientErrorUnknown = -1; |
| 47 static NSInteger const kARDAppClientErrorRoomFull = -2; | 45 static NSInteger const kARDAppClientErrorRoomFull = -2; |
| 48 static NSInteger const kARDAppClientErrorCreateSDP = -3; | 46 static NSInteger const kARDAppClientErrorCreateSDP = -3; |
| 49 static NSInteger const kARDAppClientErrorSetSDP = -4; | 47 static NSInteger const kARDAppClientErrorSetSDP = -4; |
| 50 static NSInteger const kARDAppClientErrorInvalidClient = -5; | 48 static NSInteger const kARDAppClientErrorInvalidClient = -5; |
| 51 static NSInteger const kARDAppClientErrorInvalidRoom = -6; | 49 static NSInteger const kARDAppClientErrorInvalidRoom = -6; |
| 52 static NSString * const kARDMediaStreamId = @"ARDAMS"; | 50 static NSString * const kARDMediaStreamId = @"ARDAMS"; |
| 53 static NSString * const kARDAudioTrackId = @"ARDAMSa0"; | 51 static NSString * const kARDAudioTrackId = @"ARDAMSa0"; |
| 54 static NSString * const kARDVideoTrackId = @"ARDAMSv0"; | 52 static NSString * const kARDVideoTrackId = @"ARDAMSv0"; |
| 55 | 53 |
| 56 // TODO(tkchin): Remove guard once rtc_sdk_common_objc compiles on Mac. | |
| 57 #if defined(WEBRTC_IOS) | |
| 58 // TODO(tkchin): Add these as UI options. | 54 // TODO(tkchin): Add these as UI options. |
| 59 static BOOL const kARDAppClientEnableTracing = NO; | 55 static BOOL const kARDAppClientEnableTracing = NO; |
| 60 static BOOL const kARDAppClientEnableRtcEventLog = YES; | 56 static BOOL const kARDAppClientEnableRtcEventLog = YES; |
| 61 static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB. | 57 static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB. |
| 62 #endif | |
| 63 | 58 |
| 64 // We need a proxy to NSTimer because it causes a strong retain cycle. When | 59 // We need a proxy to NSTimer because it causes a strong retain cycle. When |
| 65 // using the proxy, |invalidate| must be called before it properly deallocs. | 60 // using the proxy, |invalidate| must be called before it properly deallocs. |
| 66 @interface ARDTimerProxy : NSObject | 61 @interface ARDTimerProxy : NSObject |
| 67 | 62 |
| 68 - (instancetype)initWithInterval:(NSTimeInterval)interval | 63 - (instancetype)initWithInterval:(NSTimeInterval)interval |
| 69 repeats:(BOOL)repeats | 64 repeats:(BOOL)repeats |
| 70 timerHandler:(void (^)(void))timerHandler; | 65 timerHandler:(void (^)(void))timerHandler; |
| 71 - (void)invalidate; | 66 - (void)invalidate; |
| 72 | 67 |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 RTCAudioTrack *track = [_factory audioTrackWithTrackId:kARDAudioTrackId]; | 690 RTCAudioTrack *track = [_factory audioTrackWithTrackId:kARDAudioTrackId]; |
| 696 sender.track = track; | 691 sender.track = track; |
| 697 return sender; | 692 return sender; |
| 698 } | 693 } |
| 699 | 694 |
| 700 - (RTCVideoTrack *)createLocalVideoTrack { | 695 - (RTCVideoTrack *)createLocalVideoTrack { |
| 701 RTCVideoTrack* localVideoTrack = nil; | 696 RTCVideoTrack* localVideoTrack = nil; |
| 702 // The iOS simulator doesn't provide any sort of camera capture | 697 // The iOS simulator doesn't provide any sort of camera capture |
| 703 // support or emulation (http://goo.gl/rHAnC1) so don't bother | 698 // support or emulation (http://goo.gl/rHAnC1) so don't bother |
| 704 // trying to open a local stream. | 699 // trying to open a local stream. |
| 705 // TODO(tkchin): local video capture for OSX. See | 700 #if !TARGET_IPHONE_SIMULATOR |
| 706 // https://code.google.com/p/webrtc/issues/detail?id=3417. | |
| 707 #if !TARGET_IPHONE_SIMULATOR && TARGET_OS_IPHONE | |
| 708 if (!_isAudioOnly) { | 701 if (!_isAudioOnly) { |
| 709 RTCMediaConstraints *mediaConstraints = | 702 RTCMediaConstraints *mediaConstraints = |
| 710 [self defaultMediaStreamConstraints]; | 703 [self defaultMediaStreamConstraints]; |
| 711 RTCAVFoundationVideoSource *source = | 704 RTCAVFoundationVideoSource *source = |
| 712 [_factory avFoundationVideoSourceWithConstraints:mediaConstraints]; | 705 [_factory avFoundationVideoSourceWithConstraints:mediaConstraints]; |
| 713 localVideoTrack = | 706 localVideoTrack = |
| 714 [_factory videoTrackWithSource:source | 707 [_factory videoTrackWithSource:source |
| 715 trackId:kARDVideoTrackId]; | 708 trackId:kARDVideoTrackId]; |
| 716 } | 709 } |
| 717 #endif | 710 #endif |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 code:kARDAppClientErrorInvalidRoom | 831 code:kARDAppClientErrorInvalidRoom |
| 839 userInfo:@{ | 832 userInfo:@{ |
| 840 NSLocalizedDescriptionKey: @"Invalid room.", | 833 NSLocalizedDescriptionKey: @"Invalid room.", |
| 841 }]; | 834 }]; |
| 842 break; | 835 break; |
| 843 } | 836 } |
| 844 return error; | 837 return error; |
| 845 } | 838 } |
| 846 | 839 |
| 847 @end | 840 @end |
| OLD | NEW |