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 objectForKey:@"googFrameWidthReceived"]) { |
| 251 // Video track. |
252 [self parseVideoRecvStatsReport:statsReport]; | 252 [self parseVideoRecvStatsReport:statsReport]; |
253 } else { | 253 } else if ([values objectForKey:@"audioOutputLevel"]) { |
| 254 // Audio track. |
254 [self parseAudioRecvStatsReport:statsReport]; | 255 [self parseAudioRecvStatsReport:statsReport]; |
255 } | 256 } |
256 } | 257 } |
257 | 258 |
258 - (void)parseAudioRecvStatsReport:(RTCStatsReport *)statsReport { | 259 - (void)parseAudioRecvStatsReport:(RTCStatsReport *)statsReport { |
259 [statsReport.values enumerateKeysAndObjectsUsingBlock:^( | 260 [statsReport.values enumerateKeysAndObjectsUsingBlock:^( |
260 NSString *key, NSString *value, BOOL *stop) { | 261 NSString *key, NSString *value, BOOL *stop) { |
261 if ([key isEqualToString:@"googCodecName"]) { | 262 if ([key isEqualToString:@"googCodecName"]) { |
262 _audioRecvCodec = value; | 263 _audioRecvCodec = value; |
263 } else if ([key isEqualToString:@"bytesReceived"]) { | 264 } else if ([key isEqualToString:@"bytesReceived"]) { |
(...skipping 26 matching lines...) Expand all Loading... |
290 } else if ([key isEqualToString:@"bytesReceived"]) { | 291 } else if ([key isEqualToString:@"bytesReceived"]) { |
291 NSInteger byteCount = value.integerValue; | 292 NSInteger byteCount = value.integerValue; |
292 [_videoRecvBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; | 293 [_videoRecvBitrateTracker updateBitrateWithCurrentByteCount:byteCount]; |
293 _videoRecvBitrate = _videoRecvBitrateTracker.bitrateString; | 294 _videoRecvBitrate = _videoRecvBitrateTracker.bitrateString; |
294 } | 295 } |
295 }]; | 296 }]; |
296 } | 297 } |
297 | 298 |
298 @end | 299 @end |
299 | 300 |
OLD | NEW |