| Index: webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
|
| diff --git a/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m b/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
|
| index ef38138319ac56b2e9655eaec5cedef932cbd2f7..7e06612e6a56017306dacc0a0c1e2b839c4545d0 100644
|
| --- a/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
|
| +++ b/webrtc/examples/objc/AppRTCMobile/ARDAppClient.m
|
| @@ -12,6 +12,7 @@
|
|
|
| #import "WebRTC/RTCAVFoundationVideoSource.h"
|
| #import "WebRTC/RTCAudioTrack.h"
|
| +#import "WebRTC/RTCCameraVideoCapturer.h"
|
| #import "WebRTC/RTCConfiguration.h"
|
| #import "WebRTC/RTCFileLogger.h"
|
| #import "WebRTC/RTCIceServer.h"
|
| @@ -21,6 +22,7 @@
|
| #import "WebRTC/RTCPeerConnectionFactory.h"
|
| #import "WebRTC/RTCRtpSender.h"
|
| #import "WebRTC/RTCTracing.h"
|
| +#import "WebRTC/RTCVideoTrack.h"
|
|
|
| #import "ARDAppEngineClient.h"
|
| #import "ARDJoinResponse.h"
|
| @@ -100,6 +102,7 @@ static int const kKbpsMultiplier = 1000;
|
| RTCFileLogger *_fileLogger;
|
| ARDTimerProxy *_statsTimer;
|
| ARDSettingsModel *_settings;
|
| + RTCVideoTrack *_localVideoTrack;
|
| }
|
|
|
| @synthesize shouldGetStats = _shouldGetStats;
|
| @@ -305,6 +308,7 @@ static int const kKbpsMultiplier = 1000;
|
| _isInitiator = NO;
|
| _hasReceivedSdp = NO;
|
| _messageQueue = [NSMutableArray array];
|
| + _localVideoTrack = nil;
|
| #if defined(WEBRTC_IOS)
|
| [_factory stopAecDump];
|
| [_peerConnection stopRtcEventLog];
|
| @@ -666,10 +670,10 @@ static int const kKbpsMultiplier = 1000;
|
| RTCRtpSender *sender =
|
| [_peerConnection senderWithKind:kRTCMediaStreamTrackKindVideo
|
| streamId:kARDMediaStreamId];
|
| - RTCVideoTrack *track = [self createLocalVideoTrack];
|
| - if (track) {
|
| - sender.track = track;
|
| - [_delegate appClient:self didReceiveLocalVideoTrack:track];
|
| + _localVideoTrack = [self createLocalVideoTrack];
|
| + if (_localVideoTrack) {
|
| + sender.track = _localVideoTrack;
|
| + [_delegate appClient:self didReceiveLocalVideoTrack:_localVideoTrack];
|
| }
|
|
|
| return sender;
|
| @@ -716,10 +720,9 @@ static int const kKbpsMultiplier = 1000;
|
| // trying to open a local stream.
|
| #if !TARGET_IPHONE_SIMULATOR
|
| if (!_isAudioOnly) {
|
| - RTCMediaConstraints *cameraConstraints =
|
| - [self cameraConstraints];
|
| - RTCAVFoundationVideoSource *source =
|
| - [_factory avFoundationVideoSourceWithConstraints:cameraConstraints];
|
| + RTCVideoSource *source = [_factory videoSource];
|
| + RTCCameraVideoCapturer *capturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:source];
|
| + [_delegate appClient:self didCreateLocalCapturer:capturer];
|
| localVideoTrack =
|
| [_factory videoTrackWithSource:source
|
| trackId:kARDVideoTrackId];
|
| @@ -764,13 +767,6 @@ static int const kKbpsMultiplier = 1000;
|
| return constraints;
|
| }
|
|
|
| -- (RTCMediaConstraints *)cameraConstraints {
|
| - RTCMediaConstraints *cameraConstraints = [[RTCMediaConstraints alloc]
|
| - initWithMandatoryConstraints:nil
|
| - optionalConstraints:[_settings currentMediaConstraintFromStoreAsRTCDictionary]];
|
| - return cameraConstraints;
|
| -}
|
| -
|
| - (RTCMediaConstraints *)defaultAnswerConstraints {
|
| return [self defaultOfferConstraints];
|
| }
|
|
|