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 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 | 94 |
95 - (void)timerDidFire:(NSTimer *)timer { | 95 - (void)timerDidFire:(NSTimer *)timer { |
96 _timerHandler(); | 96 _timerHandler(); |
97 } | 97 } |
98 | 98 |
99 @end | 99 @end |
100 | 100 |
101 @implementation ARDAppClient { | 101 @implementation ARDAppClient { |
102 RTCFileLogger *_fileLogger; | 102 RTCFileLogger *_fileLogger; |
103 ARDTimerProxy *_statsTimer; | 103 ARDTimerProxy *_statsTimer; |
104 RTCMediaConstraints *_defaultMediaStreamConstraints; | |
104 } | 105 } |
105 | 106 |
106 @synthesize shouldGetStats = _shouldGetStats; | 107 @synthesize shouldGetStats = _shouldGetStats; |
107 @synthesize state = _state; | 108 @synthesize state = _state; |
108 @synthesize delegate = _delegate; | 109 @synthesize delegate = _delegate; |
109 @synthesize roomServerClient = _roomServerClient; | 110 @synthesize roomServerClient = _roomServerClient; |
110 @synthesize channel = _channel; | 111 @synthesize channel = _channel; |
111 @synthesize loopbackChannel = _loopbackChannel; | 112 @synthesize loopbackChannel = _loopbackChannel; |
112 @synthesize turnClient = _turnClient; | 113 @synthesize turnClient = _turnClient; |
113 @synthesize peerConnection = _peerConnection; | 114 @synthesize peerConnection = _peerConnection; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
314 [_factory stopAecDump]; | 315 [_factory stopAecDump]; |
315 [_peerConnection stopRtcEventLog]; | 316 [_peerConnection stopRtcEventLog]; |
316 #endif | 317 #endif |
317 _peerConnection = nil; | 318 _peerConnection = nil; |
318 self.state = kARDAppClientStateDisconnected; | 319 self.state = kARDAppClientStateDisconnected; |
319 #if defined(WEBRTC_IOS) | 320 #if defined(WEBRTC_IOS) |
320 RTCStopInternalCapture(); | 321 RTCStopInternalCapture(); |
321 #endif | 322 #endif |
322 } | 323 } |
323 | 324 |
325 - (void)setDefaultMediaStreamConstraints:(RTCMediaConstraints *)mediaConstraints { | |
magjed_webrtc
2016/10/31 19:26:39
I don't think the word 'default' is appropriate he
daniela-webrtc
2016/11/01 09:51:12
That makes sense. Should we change the `defaultMed
magjed_webrtc
2016/11/01 12:06:09
I think we should leave the name 'defaultMediaAudi
| |
326 _defaultMediaStreamConstraints = mediaConstraints; | |
327 } | |
328 | |
324 #pragma mark - ARDSignalingChannelDelegate | 329 #pragma mark - ARDSignalingChannelDelegate |
325 | 330 |
326 - (void)channel:(id<ARDSignalingChannel>)channel | 331 - (void)channel:(id<ARDSignalingChannel>)channel |
327 didReceiveMessage:(ARDSignalingMessage *)message { | 332 didReceiveMessage:(ARDSignalingMessage *)message { |
328 switch (message.type) { | 333 switch (message.type) { |
329 case kARDSignalingMessageTypeOffer: | 334 case kARDSignalingMessageTypeOffer: |
330 case kARDSignalingMessageTypeAnswer: | 335 case kARDSignalingMessageTypeAnswer: |
331 // Offers and answers must be processed before any other message, so we | 336 // Offers and answers must be processed before any other message, so we |
332 // place them at the front of the queue. | 337 // place them at the front of the queue. |
333 _hasReceivedSdp = YES; | 338 _hasReceivedSdp = YES; |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 [_loopbackChannel registerForRoomId:_roomId clientId:@"LOOPBACK_CLIENT_ID"]; | 735 [_loopbackChannel registerForRoomId:_roomId clientId:@"LOOPBACK_CLIENT_ID"]; |
731 } | 736 } |
732 } | 737 } |
733 | 738 |
734 #pragma mark - Defaults | 739 #pragma mark - Defaults |
735 | 740 |
736 - (RTCMediaConstraints *)defaultMediaAudioConstraints { | 741 - (RTCMediaConstraints *)defaultMediaAudioConstraints { |
737 NSString *valueLevelControl = _shouldUseLevelControl ? | 742 NSString *valueLevelControl = _shouldUseLevelControl ? |
738 kRTCMediaConstraintsValueTrue : kRTCMediaConstraintsValueFalse; | 743 kRTCMediaConstraintsValueTrue : kRTCMediaConstraintsValueFalse; |
739 NSDictionary *mandatoryConstraints = @{ kRTCMediaConstraintsLevelControl : va lueLevelControl }; | 744 NSDictionary *mandatoryConstraints = @{ kRTCMediaConstraintsLevelControl : va lueLevelControl }; |
740 RTCMediaConstraints* constraints = | 745 RTCMediaConstraints *constraints = |
741 [[RTCMediaConstraints alloc] initWithMandatoryConstraints:mandatoryConst raints | 746 [[RTCMediaConstraints alloc] initWithMandatoryConstraints:mandatoryConstr aints |
742 optionalConstraints:nil]; | 747 optionalConstraints:nil]; |
743 return constraints; | 748 return constraints; |
744 } | 749 } |
745 | 750 |
746 - (RTCMediaConstraints *)defaultMediaStreamConstraints { | 751 - (RTCMediaConstraints *)defaultMediaStreamConstraints { |
747 RTCMediaConstraints* constraints = | 752 return _defaultMediaStreamConstraints; |
748 [[RTCMediaConstraints alloc] | |
749 initWithMandatoryConstraints:nil | |
750 optionalConstraints:nil]; | |
751 return constraints; | |
752 } | 753 } |
753 | 754 |
754 - (RTCMediaConstraints *)defaultAnswerConstraints { | 755 - (RTCMediaConstraints *)defaultAnswerConstraints { |
755 return [self defaultOfferConstraints]; | 756 return [self defaultOfferConstraints]; |
756 } | 757 } |
757 | 758 |
758 - (RTCMediaConstraints *)defaultOfferConstraints { | 759 - (RTCMediaConstraints *)defaultOfferConstraints { |
759 NSDictionary *mandatoryConstraints = @{ | 760 NSDictionary *mandatoryConstraints = @{ |
760 @"OfferToReceiveAudio" : @"true", | 761 @"OfferToReceiveAudio" : @"true", |
761 @"OfferToReceiveVideo" : @"true" | 762 @"OfferToReceiveVideo" : @"true" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 code:kARDAppClientErrorInvalidRoom | 838 code:kARDAppClientErrorInvalidRoom |
838 userInfo:@{ | 839 userInfo:@{ |
839 NSLocalizedDescriptionKey: @"Invalid room.", | 840 NSLocalizedDescriptionKey: @"Invalid room.", |
840 }]; | 841 }]; |
841 break; | 842 break; |
842 } | 843 } |
843 return error; | 844 return error; |
844 } | 845 } |
845 | 846 |
846 @end | 847 @end |
OLD | NEW |