OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 "ARDVideoCallViewController.h" | 11 #import "ARDVideoCallViewController.h" |
12 | 12 |
13 #import "webrtc/modules/audio_device/ios/objc/RTCAudioSession.h" | 13 #import "webrtc/modules/audio_device/ios/objc/RTCAudioSession.h" |
14 | 14 |
| 15 #import "ARDAppClient.h" |
| 16 #import "ARDMediaConstraintsModel.h" |
| 17 #import "ARDVideoCallView.h" |
15 #import "WebRTC/RTCAVFoundationVideoSource.h" | 18 #import "WebRTC/RTCAVFoundationVideoSource.h" |
16 #import "WebRTC/RTCDispatcher.h" | 19 #import "WebRTC/RTCDispatcher.h" |
17 #import "WebRTC/RTCLogging.h" | 20 #import "WebRTC/RTCLogging.h" |
18 | 21 #import "WebRTC/RTCMediaConstraints.h" |
19 #import "ARDAppClient.h" | |
20 #import "ARDVideoCallView.h" | |
21 | 22 |
22 @interface ARDVideoCallViewController () <ARDAppClientDelegate, | 23 @interface ARDVideoCallViewController () <ARDAppClientDelegate, |
23 ARDVideoCallViewDelegate> | 24 ARDVideoCallViewDelegate> |
24 @property(nonatomic, strong) RTCVideoTrack *localVideoTrack; | 25 @property(nonatomic, strong) RTCVideoTrack *localVideoTrack; |
25 @property(nonatomic, strong) RTCVideoTrack *remoteVideoTrack; | 26 @property(nonatomic, strong) RTCVideoTrack *remoteVideoTrack; |
26 @property(nonatomic, readonly) ARDVideoCallView *videoCallView; | 27 @property(nonatomic, readonly) ARDVideoCallView *videoCallView; |
27 @end | 28 @end |
28 | 29 |
29 @implementation ARDVideoCallViewController { | 30 @implementation ARDVideoCallViewController { |
30 ARDAppClient *_client; | 31 ARDAppClient *_client; |
31 RTCVideoTrack *_remoteVideoTrack; | 32 RTCVideoTrack *_remoteVideoTrack; |
32 RTCVideoTrack *_localVideoTrack; | 33 RTCVideoTrack *_localVideoTrack; |
33 AVAudioSessionPortOverride _portOverride; | 34 AVAudioSessionPortOverride _portOverride; |
34 } | 35 } |
35 | 36 |
36 @synthesize videoCallView = _videoCallView; | 37 @synthesize videoCallView = _videoCallView; |
37 @synthesize delegate = _delegate; | 38 @synthesize delegate = _delegate; |
38 | 39 |
39 - (instancetype)initForRoom:(NSString *)room | 40 - (instancetype)initForRoom:(NSString *)room |
40 isLoopback:(BOOL)isLoopback | 41 isLoopback:(BOOL)isLoopback |
41 isAudioOnly:(BOOL)isAudioOnly | 42 isAudioOnly:(BOOL)isAudioOnly |
42 shouldMakeAecDump:(BOOL)shouldMakeAecDump | 43 shouldMakeAecDump:(BOOL)shouldMakeAecDump |
43 shouldUseLevelControl:(BOOL)shouldUseLevelControl | 44 shouldUseLevelControl:(BOOL)shouldUseLevelControl |
44 delegate:(id<ARDVideoCallViewControllerDelegate>)delegate { | 45 delegate:(id<ARDVideoCallViewControllerDelegate>)delegate { |
45 if (self = [super init]) { | 46 if (self = [super init]) { |
46 _delegate = delegate; | 47 _delegate = delegate; |
47 _client = [[ARDAppClient alloc] initWithDelegate:self]; | 48 _client = [[ARDAppClient alloc] initWithDelegate:self]; |
| 49 ARDMediaConstraintsModel *mediaConstraintsModel = [[ARDMediaConstraintsModel
alloc] init]; |
| 50 RTCMediaConstraints *cameraConstraints = [[RTCMediaConstraints alloc] |
| 51 initWithMandatoryConstraints:nil |
| 52 optionalConstraints:[mediaConstraintsModel |
| 53 currentMediaConstraintFromStoreAsRTCDic
tionary]]; |
| 54 [_client setCameraConstraints:cameraConstraints]; |
48 [_client connectToRoomWithId:room | 55 [_client connectToRoomWithId:room |
49 isLoopback:isLoopback | 56 isLoopback:isLoopback |
50 isAudioOnly:isAudioOnly | 57 isAudioOnly:isAudioOnly |
51 shouldMakeAecDump:shouldMakeAecDump | 58 shouldMakeAecDump:shouldMakeAecDump |
52 shouldUseLevelControl:shouldUseLevelControl]; | 59 shouldUseLevelControl:shouldUseLevelControl]; |
53 } | 60 } |
54 return self; | 61 return self; |
55 } | 62 } |
56 | 63 |
57 - (void)loadView { | 64 - (void)loadView { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 - (void)showAlertWithMessage:(NSString*)message { | 220 - (void)showAlertWithMessage:(NSString*)message { |
214 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil | 221 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil |
215 message:message | 222 message:message |
216 delegate:nil | 223 delegate:nil |
217 cancelButtonTitle:@"OK" | 224 cancelButtonTitle:@"OK" |
218 otherButtonTitles:nil]; | 225 otherButtonTitles:nil]; |
219 [alertView show]; | 226 [alertView show]; |
220 } | 227 } |
221 | 228 |
222 @end | 229 @end |
OLD | NEW |