OLD | NEW |
---|---|
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 } else if ([key isEqualToString:@"bytesSent"]) { | 189 } else if ([key isEqualToString:@"bytesSent"]) { |
190 NSInteger byteCount = value.integerValue; | 190 NSInteger byteCount = value.integerValue; |
191 [_connSendBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; | 191 [_connSendBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; |
192 _connSendBitrate = _connSendBitrateTracker.bitrateString; | 192 _connSendBitrate = _connSendBitrateTracker.bitrateString; |
193 } | 193 } |
194 }]; | 194 }]; |
195 } | 195 } |
196 | 196 |
197 - (void)parseSendSsrcStatsReport:(RTCStatsReport *)statsReport { | 197 - (void)parseSendSsrcStatsReport:(RTCStatsReport *)statsReport { |
198 NSDictionary *values = statsReport.values; | 198 NSDictionary *values = statsReport.values; |
199 NSString *trackId = values[@"googTrackId"]; | 199 if ([values objectForKey:@"googFrameRateSent"]) { |
200 if (trackId.length && [trackId hasPrefix:@"ARDAMSv0"]) { | |
201 // Video track. | 200 // Video track. |
202 [self parseVideoSendStatsReport:statsReport]; | 201 [self parseVideoSendStatsReport:statsReport]; |
203 } else { | 202 } else if ([values objectForKey:@"audioInputLevel"]) { |
204 // Audio track. | 203 // Audio track. |
205 [self parseAudioSendStatsReport:statsReport]; | 204 [self parseAudioSendStatsReport:statsReport]; |
206 } | 205 } |
207 } | 206 } |
208 | 207 |
209 - (void)parseAudioSendStatsReport:(RTCStatsReport *)statsReport { | 208 - (void)parseAudioSendStatsReport:(RTCStatsReport *)statsReport { |
210 [statsReport.values enumerateKeysAndObjectsUsingBlock:^( | 209 [statsReport.values enumerateKeysAndObjectsUsingBlock:^( |
211 NSString *key, NSString *value, BOOL *stop) { | 210 NSString *key, NSString *value, BOOL *stop) { |
212 if ([key isEqualToString:@"googCodecName"]) { | 211 if ([key isEqualToString:@"googCodecName"]) { |
213 _audioSendCodec = value; | 212 _audioSendCodec = value; |
(...skipping 27 matching lines...) Expand all Loading... | |
241 } else if ([key isEqualToString:@"bytesSent"]) { | 240 } else if ([key isEqualToString:@"bytesSent"]) { |
242 NSInteger byteCount = value.integerValue; | 241 NSInteger byteCount = value.integerValue; |
243 [_videoSendBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; | 242 [_videoSendBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; |
244 _videoSendBitrate = _videoSendBitrateTracker.bitrateString; | 243 _videoSendBitrate = _videoSendBitrateTracker.bitrateString; |
245 } | 244 } |
246 }]; | 245 }]; |
247 } | 246 } |
248 | 247 |
249 - (void)parseRecvSsrcStatsReport:(RTCStatsReport *)statsReport { | 248 - (void)parseRecvSsrcStatsReport:(RTCStatsReport *)statsReport { |
250 NSDictionary *values = statsReport.values; | 249 NSDictionary *values = statsReport.values; |
251 if (values[@"googFrameWidthReceived"]) { | 250 if (values[@"googFrameWidthReceived"]) { |
pbos-webrtc
2016/06/03 10:05:24
Do objectForKey here as well.
stefan-webrtc
2016/06/03 11:24:54
Done.
| |
252 [self parseVideoRecvStatsReport:statsReport]; | 251 [self parseVideoRecvStatsReport:statsReport]; |
pbos-webrtc
2016/06/03 10:05:24
Add // Video track. and Audio below to unify with
stefan-webrtc
2016/06/03 11:24:54
Done.
| |
253 } else { | 252 } else if ([values objectForKey:@"audioOutputLevel"]) { |
254 [self parseAudioRecvStatsReport:statsReport]; | 253 [self parseAudioRecvStatsReport:statsReport]; |
255 } | 254 } |
256 } | 255 } |
257 | 256 |
258 - (void)parseAudioRecvStatsReport:(RTCStatsReport *)statsReport { | 257 - (void)parseAudioRecvStatsReport:(RTCStatsReport *)statsReport { |
259 [statsReport.values enumerateKeysAndObjectsUsingBlock:^( | 258 [statsReport.values enumerateKeysAndObjectsUsingBlock:^( |
260 NSString *key, NSString *value, BOOL *stop) { | 259 NSString *key, NSString *value, BOOL *stop) { |
261 if ([key isEqualToString:@"googCodecName"]) { | 260 if ([key isEqualToString:@"googCodecName"]) { |
262 _audioRecvCodec = value; | 261 _audioRecvCodec = value; |
263 } else if ([key isEqualToString:@"bytesReceived"]) { | 262 } else if ([key isEqualToString:@"bytesReceived"]) { |
(...skipping 26 matching lines...) Expand all Loading... | |
290 } else if ([key isEqualToString:@"bytesReceived"]) { | 289 } else if ([key isEqualToString:@"bytesReceived"]) { |
291 NSInteger byteCount = value.integerValue; | 290 NSInteger byteCount = value.integerValue; |
292 [_videoRecvBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; | 291 [_videoRecvBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; |
293 _videoRecvBitrate = _videoRecvBitrateTracker.bitrateString; | 292 _videoRecvBitrate = _videoRecvBitrateTracker.bitrateString; |
294 } | 293 } |
295 }]; | 294 }]; |
296 } | 295 } |
297 | 296 |
298 @end | 297 @end |
299 | 298 |
OLD | NEW |