Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m

Issue 2778163005: Use new RTCCameraVideoCapturer in AppRTCMobile. (Closed)
Patch Set: Rename remaining media constraint references. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "APPRTCViewController.h" 11 #import "APPRTCViewController.h"
12 12
13 #import <AVFoundation/AVFoundation.h> 13 #import <AVFoundation/AVFoundation.h>
14 14
15 #import "WebRTC/RTCMTLNSVideoView.h" 15 #import "WebRTC/RTCMTLNSVideoView.h"
16 #import "WebRTC/RTCNSGLVideoView.h" 16 #import "WebRTC/RTCNSGLVideoView.h"
17 #import "WebRTC/RTCVideoTrack.h" 17 #import "WebRTC/RTCVideoTrack.h"
18 18
19 #import "ARDAppClient.h" 19 #import "ARDAppClient.h"
20 #import "ARDCaptureController.h"
20 #import "ARDSettingsModel.h" 21 #import "ARDSettingsModel.h"
21 22
22 static NSUInteger const kContentWidth = 900; 23 static NSUInteger const kContentWidth = 900;
23 static NSUInteger const kRoomFieldWidth = 200; 24 static NSUInteger const kRoomFieldWidth = 200;
24 static NSUInteger const kActionItemHeight = 30; 25 static NSUInteger const kActionItemHeight = 30;
25 static NSUInteger const kBottomViewHeight = 200; 26 static NSUInteger const kBottomViewHeight = 200;
26 27
27 @class APPRTCMainView; 28 @class APPRTCMainView;
28 @protocol APPRTCMainViewDelegate 29 @protocol APPRTCMainViewDelegate
29 30
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 293
293 @interface APPRTCViewController () 294 @interface APPRTCViewController ()
294 <ARDAppClientDelegate, APPRTCMainViewDelegate> 295 <ARDAppClientDelegate, APPRTCMainViewDelegate>
295 @property(nonatomic, readonly) APPRTCMainView* mainView; 296 @property(nonatomic, readonly) APPRTCMainView* mainView;
296 @end 297 @end
297 298
298 @implementation APPRTCViewController { 299 @implementation APPRTCViewController {
299 ARDAppClient* _client; 300 ARDAppClient* _client;
300 RTCVideoTrack* _localVideoTrack; 301 RTCVideoTrack* _localVideoTrack;
301 RTCVideoTrack* _remoteVideoTrack; 302 RTCVideoTrack* _remoteVideoTrack;
303 ARDCaptureController* _captureController;
302 } 304 }
303 305
304 - (void)dealloc { 306 - (void)dealloc {
305 [self disconnect]; 307 [self disconnect];
306 } 308 }
307 309
308 - (void)viewDidAppear { 310 - (void)viewDidAppear {
309 [super viewDidAppear]; 311 [super viewDidAppear];
310 [self displayUsageInstructions]; 312 [self displayUsageInstructions];
311 } 313 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 [self resetUI]; 348 [self resetUI];
347 _client = nil; 349 _client = nil;
348 break; 350 break;
349 } 351 }
350 } 352 }
351 353
352 - (void)appClient:(ARDAppClient *)client 354 - (void)appClient:(ARDAppClient *)client
353 didChangeConnectionState:(RTCIceConnectionState)state { 355 didChangeConnectionState:(RTCIceConnectionState)state {
354 } 356 }
355 357
358 - (void)appClient:(ARDAppClient*)client
359 didCreateLocalCapturer:(RTCCameraVideoCapturer*)localCapturer {
360 _captureController =
361 [[ARDCaptureController alloc] initWithCapturer:localCapturer
362 settings:[[ARDSettingsModel alloc] i nit]];
363 [_captureController startCapture];
364 }
365
356 - (void)appClient:(ARDAppClient *)client 366 - (void)appClient:(ARDAppClient *)client
357 didReceiveLocalVideoTrack:(RTCVideoTrack *)localVideoTrack { 367 didReceiveLocalVideoTrack:(RTCVideoTrack *)localVideoTrack {
358 _localVideoTrack = localVideoTrack; 368 _localVideoTrack = localVideoTrack;
359 [_localVideoTrack addRenderer:self.mainView.localVideoView]; 369 [_localVideoTrack addRenderer:self.mainView.localVideoView];
360 } 370 }
361 371
362 - (void)appClient:(ARDAppClient *)client 372 - (void)appClient:(ARDAppClient *)client
363 didReceiveRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack { 373 didReceiveRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack {
364 _remoteVideoTrack = remoteVideoTrack; 374 _remoteVideoTrack = remoteVideoTrack;
365 [_remoteVideoTrack addRenderer:self.mainView.remoteVideoView]; 375 [_remoteVideoTrack addRenderer:self.mainView.remoteVideoView];
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 [self.mainView.remoteVideoView renderFrame:nil]; 427 [self.mainView.remoteVideoView renderFrame:nil];
418 [self.mainView.localVideoView renderFrame:nil]; 428 [self.mainView.localVideoView renderFrame:nil];
419 } 429 }
420 430
421 - (void)disconnect { 431 - (void)disconnect {
422 [self resetUI]; 432 [self resetUI];
423 [_client disconnect]; 433 [_client disconnect];
424 } 434 }
425 435
426 @end 436 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698