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

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

Issue 1497393002: Add new view that renders local video using AVCaptureLayerPreview. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed commented line. Created 5 years 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
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 _client.shouldGetStats = YES; 121 _client.shouldGetStats = YES;
122 _videoCallView.statsView.hidden = NO; 122 _videoCallView.statsView.hidden = NO;
123 } 123 }
124 124
125 #pragma mark - Private 125 #pragma mark - Private
126 126
127 - (void)setLocalVideoTrack:(RTCVideoTrack *)localVideoTrack { 127 - (void)setLocalVideoTrack:(RTCVideoTrack *)localVideoTrack {
128 if (_localVideoTrack == localVideoTrack) { 128 if (_localVideoTrack == localVideoTrack) {
129 return; 129 return;
130 } 130 }
131 [_localVideoTrack removeRenderer:_videoCallView.localVideoView];
132 _localVideoTrack = nil; 131 _localVideoTrack = nil;
133 [_videoCallView.localVideoView renderFrame:nil];
134 _localVideoTrack = localVideoTrack; 132 _localVideoTrack = localVideoTrack;
135 [_localVideoTrack addRenderer:_videoCallView.localVideoView]; 133 RTCAVFoundationVideoSource *source = nil;
134 if ([localVideoTrack.source
135 isKindOfClass:[RTCAVFoundationVideoSource class]]) {
136 source = (RTCAVFoundationVideoSource*)localVideoTrack.source;
137 }
138 _videoCallView.localVideoView.videoSource = source;
136 } 139 }
137 140
138 - (void)setRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack { 141 - (void)setRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack {
139 if (_remoteVideoTrack == remoteVideoTrack) { 142 if (_remoteVideoTrack == remoteVideoTrack) {
140 return; 143 return;
141 } 144 }
142 [_remoteVideoTrack removeRenderer:_videoCallView.localVideoView]; 145 [_remoteVideoTrack removeRenderer:_videoCallView.remoteVideoView];
143 _remoteVideoTrack = nil; 146 _remoteVideoTrack = nil;
144 [_videoCallView.remoteVideoView renderFrame:nil]; 147 [_videoCallView.remoteVideoView renderFrame:nil];
145 _remoteVideoTrack = remoteVideoTrack; 148 _remoteVideoTrack = remoteVideoTrack;
146 [_remoteVideoTrack addRenderer:_videoCallView.remoteVideoView]; 149 [_remoteVideoTrack addRenderer:_videoCallView.remoteVideoView];
147 } 150 }
148 151
149 - (void)hangup { 152 - (void)hangup {
150 self.remoteVideoTrack = nil; 153 self.remoteVideoTrack = nil;
151 self.localVideoTrack = nil; 154 self.localVideoTrack = nil;
152 [_client disconnect]; 155 [_client disconnect];
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 - (void)showAlertWithMessage:(NSString*)message { 187 - (void)showAlertWithMessage:(NSString*)message {
185 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil 188 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil
186 message:message 189 message:message
187 delegate:nil 190 delegate:nil
188 cancelButtonTitle:@"OK" 191 cancelButtonTitle:@"OK"
189 otherButtonTitles:nil]; 192 otherButtonTitles:nil];
190 [alertView show]; 193 [alertView show];
191 } 194 }
192 195
193 @end 196 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698