OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // Audio Tracks | 327 // Audio Tracks |
328 for (const rtc::scoped_refptr<AudioTrackInterface>& audio_track : | 328 for (const rtc::scoped_refptr<AudioTrackInterface>& audio_track : |
329 stream->GetAudioTracks()) { | 329 stream->GetAudioTracks()) { |
330 std::string id = RTCMediaStreamTrackStatsIDFromMediaStreamTrackInterface( | 330 std::string id = RTCMediaStreamTrackStatsIDFromMediaStreamTrackInterface( |
331 *audio_track.get()); | 331 *audio_track.get()); |
332 if (report->Get(id)) { | 332 if (report->Get(id)) { |
333 // Skip track, stats already exist for it. | 333 // Skip track, stats already exist for it. |
334 continue; | 334 continue; |
335 } | 335 } |
336 std::unique_ptr<RTCMediaStreamTrackStats> audio_track_stats( | 336 std::unique_ptr<RTCMediaStreamTrackStats> audio_track_stats( |
337 new RTCMediaStreamTrackStats(id, timestamp_us)); | 337 new RTCMediaStreamTrackStats(id, timestamp_us, |
| 338 RTCMediaStreamTrackKind::kAudio)); |
338 stream_stats->track_ids->push_back(audio_track_stats->id()); | 339 stream_stats->track_ids->push_back(audio_track_stats->id()); |
339 SetMediaStreamTrackStatsFromMediaStreamTrackInterface( | 340 SetMediaStreamTrackStatsFromMediaStreamTrackInterface( |
340 *audio_track.get(), | 341 *audio_track.get(), |
341 audio_track_stats.get()); | 342 audio_track_stats.get()); |
342 audio_track_stats->remote_source = !is_local; | 343 audio_track_stats->remote_source = !is_local; |
343 audio_track_stats->detached = false; | 344 audio_track_stats->detached = false; |
344 int signal_level; | 345 int signal_level; |
345 if (audio_track->GetSignalLevel(&signal_level)) { | 346 if (audio_track->GetSignalLevel(&signal_level)) { |
346 // Convert signal level from [0,32767] int to [0,1] double. | 347 // Convert signal level from [0,32767] int to [0,1] double. |
347 RTC_DCHECK_GE(signal_level, 0); | 348 RTC_DCHECK_GE(signal_level, 0); |
(...skipping 17 matching lines...) Expand all Loading... |
365 // Video Tracks | 366 // Video Tracks |
366 for (const rtc::scoped_refptr<VideoTrackInterface>& video_track : | 367 for (const rtc::scoped_refptr<VideoTrackInterface>& video_track : |
367 stream->GetVideoTracks()) { | 368 stream->GetVideoTracks()) { |
368 std::string id = RTCMediaStreamTrackStatsIDFromMediaStreamTrackInterface( | 369 std::string id = RTCMediaStreamTrackStatsIDFromMediaStreamTrackInterface( |
369 *video_track.get()); | 370 *video_track.get()); |
370 if (report->Get(id)) { | 371 if (report->Get(id)) { |
371 // Skip track, stats already exist for it. | 372 // Skip track, stats already exist for it. |
372 continue; | 373 continue; |
373 } | 374 } |
374 std::unique_ptr<RTCMediaStreamTrackStats> video_track_stats( | 375 std::unique_ptr<RTCMediaStreamTrackStats> video_track_stats( |
375 new RTCMediaStreamTrackStats(id, timestamp_us)); | 376 new RTCMediaStreamTrackStats(id, timestamp_us, |
| 377 RTCMediaStreamTrackKind::kVideo)); |
376 stream_stats->track_ids->push_back(video_track_stats->id()); | 378 stream_stats->track_ids->push_back(video_track_stats->id()); |
377 SetMediaStreamTrackStatsFromMediaStreamTrackInterface( | 379 SetMediaStreamTrackStatsFromMediaStreamTrackInterface( |
378 *video_track.get(), | 380 *video_track.get(), |
379 video_track_stats.get()); | 381 video_track_stats.get()); |
380 video_track_stats->remote_source = !is_local; | 382 video_track_stats->remote_source = !is_local; |
381 video_track_stats->detached = false; | 383 video_track_stats->detached = false; |
382 if (video_track->GetSource()) { | 384 if (video_track->GetSource()) { |
383 VideoTrackSourceInterface::Stats video_track_source_stats; | 385 VideoTrackSourceInterface::Stats video_track_source_stats; |
384 if (video_track->GetSource()->GetStats(&video_track_source_stats)) { | 386 if (video_track->GetSource()->GetStats(&video_track_source_stats)) { |
385 video_track_stats->frame_width = static_cast<uint32_t>( | 387 video_track_stats->frame_width = static_cast<uint32_t>( |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 const std::string& type) { | 979 const std::string& type) { |
978 return CandidateTypeToRTCIceCandidateType(type); | 980 return CandidateTypeToRTCIceCandidateType(type); |
979 } | 981 } |
980 | 982 |
981 const char* DataStateToRTCDataChannelStateForTesting( | 983 const char* DataStateToRTCDataChannelStateForTesting( |
982 DataChannelInterface::DataState state) { | 984 DataChannelInterface::DataState state) { |
983 return DataStateToRTCDataChannelState(state); | 985 return DataStateToRTCDataChannelState(state); |
984 } | 986 } |
985 | 987 |
986 } // namespace webrtc | 988 } // namespace webrtc |
OLD | NEW |