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

Side by Side Diff: webrtc/examples/objc/AppRTCDemo/ios/ARDVideoCallViewController.m

Issue 1690313002: Update iOS AppRTCDemo to use the updated Objective-C API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 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 "RTCAVFoundationVideoSource.h" 13 #import "webrtc/api/objc/RTCAVFoundationVideoSource.h"
14 #import "RTCLogging.h" 14 #import "webrtc/base/objc/RTCLogging.h"
15 15
16 #import "ARDAppClient.h" 16 #import "ARDAppClient.h"
17 #import "ARDVideoCallView.h" 17 #import "ARDVideoCallView.h"
18 18
19 @interface ARDVideoCallViewController () <ARDAppClientDelegate, 19 @interface ARDVideoCallViewController () <ARDAppClientDelegate,
20 ARDVideoCallViewDelegate> 20 ARDVideoCallViewDelegate>
21 @property(nonatomic, strong) RTCVideoTrack *localVideoTrack; 21 @property(nonatomic, strong) RTCVideoTrack *localVideoTrack;
22 @property(nonatomic, strong) RTCVideoTrack *remoteVideoTrack; 22 @property(nonatomic, strong) RTCVideoTrack *remoteVideoTrack;
23 @property(nonatomic, readonly) ARDVideoCallView *videoCallView; 23 @property(nonatomic, readonly) ARDVideoCallView *videoCallView;
24 @end 24 @end
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 _videoCallView.localVideoView.captureSession = source.captureSession; 138 _videoCallView.localVideoView.captureSession = source.captureSession;
139 } 139 }
140 140
141 - (void)setRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack { 141 - (void)setRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack {
142 if (_remoteVideoTrack == remoteVideoTrack) { 142 if (_remoteVideoTrack == remoteVideoTrack) {
143 return; 143 return;
144 } 144 }
145 [_remoteVideoTrack removeRenderer:_videoCallView.remoteVideoView]; 145 [_remoteVideoTrack removeRenderer:_videoCallView.remoteVideoView];
146 _remoteVideoTrack = nil; 146 _remoteVideoTrack = nil;
147 [_videoCallView.remoteVideoView renderFrame:nil]; 147 [_videoCallView.remoteVideoView renderFrame:nil];
hjon_webrtc 2016/02/12 18:50:58 Is this line needed? The updated API is currently
148 _remoteVideoTrack = remoteVideoTrack; 148 _remoteVideoTrack = remoteVideoTrack;
149 [_remoteVideoTrack addRenderer:_videoCallView.remoteVideoView]; 149 [_remoteVideoTrack addRenderer:_videoCallView.remoteVideoView];
150 } 150 }
151 151
152 - (void)hangup { 152 - (void)hangup {
153 self.remoteVideoTrack = nil; 153 self.remoteVideoTrack = nil;
154 self.localVideoTrack = nil; 154 self.localVideoTrack = nil;
155 [_client disconnect]; 155 [_client disconnect];
156 if (![self isBeingDismissed]) { 156 if (![self isBeingDismissed]) {
157 [self.presentingViewController dismissViewControllerAnimated:YES 157 [self.presentingViewController dismissViewControllerAnimated:YES
(...skipping 29 matching lines...) Expand all
187 - (void)showAlertWithMessage:(NSString*)message { 187 - (void)showAlertWithMessage:(NSString*)message {
188 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil 188 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil
189 message:message 189 message:message
190 delegate:nil 190 delegate:nil
191 cancelButtonTitle:@"OK" 191 cancelButtonTitle:@"OK"
192 otherButtonTitles:nil]; 192 otherButtonTitles:nil];
193 [alertView show]; 193 [alertView show];
194 } 194 }
195 195
196 @end 196 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698