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

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

Issue 1289623005: Add stats overlay to iOS AppRTCDemo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: CR comments Created 5 years, 4 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
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 self.localVideoTrack = localVideoTrack; 81 self.localVideoTrack = localVideoTrack;
82 } 82 }
83 83
84 - (void)appClient:(ARDAppClient *)client 84 - (void)appClient:(ARDAppClient *)client
85 didReceiveRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack { 85 didReceiveRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack {
86 self.remoteVideoTrack = remoteVideoTrack; 86 self.remoteVideoTrack = remoteVideoTrack;
87 _videoCallView.statusLabel.hidden = YES; 87 _videoCallView.statusLabel.hidden = YES;
88 } 88 }
89 89
90 - (void)appClient:(ARDAppClient *)client 90 - (void)appClient:(ARDAppClient *)client
91 didGetStats:(NSArray *)stats {
92 _videoCallView.statsView.stats = stats;
93 [_videoCallView setNeedsLayout];
94 }
95
96 - (void)appClient:(ARDAppClient *)client
91 didError:(NSError *)error { 97 didError:(NSError *)error {
92 NSString *message = 98 NSString *message =
93 [NSString stringWithFormat:@"%@", error.localizedDescription]; 99 [NSString stringWithFormat:@"%@", error.localizedDescription];
94 [self showAlertWithMessage:message]; 100 [self showAlertWithMessage:message];
95 [self hangup]; 101 [self hangup];
96 } 102 }
97 103
98 #pragma mark - ARDVideoCallViewDelegate 104 #pragma mark - ARDVideoCallViewDelegate
99 105
100 - (void)videoCallViewDidHangup:(ARDVideoCallView *)view { 106 - (void)videoCallViewDidHangup:(ARDVideoCallView *)view {
101 [self hangup]; 107 [self hangup];
102 } 108 }
103 109
104 - (void)videoCallViewDidSwitchCamera:(ARDVideoCallView *)view { 110 - (void)videoCallViewDidSwitchCamera:(ARDVideoCallView *)view {
105 // TODO(tkchin): Rate limit this so you can't tap continously on it. 111 // TODO(tkchin): Rate limit this so you can't tap continously on it.
106 // Probably through an animation. 112 // Probably through an animation.
107 [self switchCamera]; 113 [self switchCamera];
108 } 114 }
109 115
116 - (void)videoCallViewDidEnableStats:(ARDVideoCallView *)view {
117 _client.shouldGetStats = YES;
118 _videoCallView.statsView.hidden = NO;
119 }
120
110 #pragma mark - Private 121 #pragma mark - Private
111 122
112 - (void)setLocalVideoTrack:(RTCVideoTrack *)localVideoTrack { 123 - (void)setLocalVideoTrack:(RTCVideoTrack *)localVideoTrack {
113 if (_localVideoTrack == localVideoTrack) { 124 if (_localVideoTrack == localVideoTrack) {
114 return; 125 return;
115 } 126 }
116 [_localVideoTrack removeRenderer:_videoCallView.localVideoView]; 127 [_localVideoTrack removeRenderer:_videoCallView.localVideoView];
117 _localVideoTrack = nil; 128 _localVideoTrack = nil;
118 [_videoCallView.localVideoView renderFrame:nil]; 129 [_videoCallView.localVideoView renderFrame:nil];
119 _localVideoTrack = localVideoTrack; 130 _localVideoTrack = localVideoTrack;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 - (void)showAlertWithMessage:(NSString*)message { 179 - (void)showAlertWithMessage:(NSString*)message {
169 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil 180 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil
170 message:message 181 message:message
171 delegate:nil 182 delegate:nil
172 cancelButtonTitle:@"OK" 183 cancelButtonTitle:@"OK"
173 otherButtonTitles:nil]; 184 otherButtonTitles:nil];
174 [alertView show]; 185 [alertView show];
175 } 186 }
176 187
177 @end 188 @end
OLDNEW
« no previous file with comments | « webrtc/examples/objc/AppRTCDemo/ios/ARDVideoCallView.m ('k') | webrtc/examples/objc/AppRTCDemo/mac/APPRTCViewController.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698