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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 TracksToSsrcs::const_iterator it = tracks_to_ssrcs.find( | 439 TracksToSsrcs::const_iterator it = tracks_to_ssrcs.find( |
440 video_track.get()); | 440 video_track.get()); |
441 if (it != tracks_to_ssrcs.end() && video_info) { | 441 if (it != tracks_to_ssrcs.end() && video_info) { |
442 uint32_t ssrc = it->second; | 442 uint32_t ssrc = it->second; |
443 if (is_local) { | 443 if (is_local) { |
444 const cricket::VideoSenderInfo* sender_info = | 444 const cricket::VideoSenderInfo* sender_info = |
445 GetMediaInfoFromSsrc(video_info->senders, ssrc); | 445 GetMediaInfoFromSsrc(video_info->senders, ssrc); |
446 if (sender_info) { | 446 if (sender_info) { |
447 video_track_stats->ssrc_ids = StringSsrcsFromSsrcs( | 447 video_track_stats->ssrc_ids = StringSsrcsFromSsrcs( |
448 sender_info->ssrcs()); | 448 sender_info->ssrcs()); |
449 video_track_stats->frame_width = static_cast<uint32_t>( | |
450 sender_info->send_frame_width); | |
451 video_track_stats->frame_height = static_cast<uint32_t>( | |
452 sender_info->send_frame_height); | |
453 video_track_stats->frames_per_second = static_cast<double>( | |
454 sender_info->framerate_sent); | |
hbos
2016/12/29 12:45:41
Alternatively, VideoSenderInfo has framerate_input
Taylor Brandstetter
2017/01/04 23:25:23
I'm not completely sure that framerate_sent (or fr
| |
449 } | 455 } |
450 } else { | 456 } else { |
451 const cricket::VideoReceiverInfo* receiver_info = | 457 const cricket::VideoReceiverInfo* receiver_info = |
452 GetMediaInfoFromSsrc(video_info->receivers, ssrc); | 458 GetMediaInfoFromSsrc(video_info->receivers, ssrc); |
453 if (receiver_info) { | 459 if (receiver_info) { |
454 video_track_stats->ssrc_ids = StringSsrcsFromSsrcs( | 460 video_track_stats->ssrc_ids = StringSsrcsFromSsrcs( |
455 receiver_info->ssrcs()); | 461 receiver_info->ssrcs()); |
462 video_track_stats->frame_width = static_cast<uint32_t>( | |
463 receiver_info->frame_width); | |
464 video_track_stats->frame_height = static_cast<uint32_t>( | |
465 receiver_info->frame_height); | |
466 video_track_stats->frames_per_second = static_cast<double>( | |
467 receiver_info->framerate_output); | |
hbos
2016/12/29 12:45:41
Alternatively, VideoReceiverInfo also has framerat
Taylor Brandstetter
2017/01/04 23:25:23
I'm also not sure that this is completely right. F
| |
468 video_track_stats->frames_decoded = receiver_info->frames_decoded; | |
hbos
2016/12/29 15:29:28
Uhm, this is the same as RTCInboundRTPStreamStats.
hta-webrtc
2017/01/02 16:06:42
Add a TODO to count the frames delivered to the tr
Taylor Brandstetter
2017/01/04 23:25:23
I believe this already does count the frames deliv
| |
456 } | 469 } |
457 } | 470 } |
458 } | 471 } |
459 video_track_stats->remote_source = !is_local; | 472 video_track_stats->remote_source = !is_local; |
460 video_track_stats->detached = false; | 473 video_track_stats->detached = false; |
461 if (video_track->GetSource()) { | |
462 VideoTrackSourceInterface::Stats video_track_source_stats; | |
463 if (video_track->GetSource()->GetStats(&video_track_source_stats)) { | |
464 video_track_stats->frame_width = static_cast<uint32_t>( | |
465 video_track_source_stats.input_width); | |
466 video_track_stats->frame_height = static_cast<uint32_t>( | |
467 video_track_source_stats.input_height); | |
hbos
2016/12/29 12:45:41
These sizes correspond to googFrame[Width/Height]I
hbos
2016/12/29 14:24:48
I also found out that this was not available in th
| |
468 } | |
469 } | |
470 report->AddStats(std::move(video_track_stats)); | 474 report->AddStats(std::move(video_track_stats)); |
471 } | 475 } |
472 report->AddStats(std::move(stream_stats)); | 476 report->AddStats(std::move(stream_stats)); |
473 } | 477 } |
474 } | 478 } |
475 | 479 |
476 } // namespace | 480 } // namespace |
477 | 481 |
478 rtc::scoped_refptr<RTCStatsCollector> RTCStatsCollector::Create( | 482 rtc::scoped_refptr<RTCStatsCollector> RTCStatsCollector::Create( |
479 PeerConnection* pc, int64_t cache_lifetime_us) { | 483 PeerConnection* pc, int64_t cache_lifetime_us) { |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1077 const std::string& type) { | 1081 const std::string& type) { |
1078 return CandidateTypeToRTCIceCandidateType(type); | 1082 return CandidateTypeToRTCIceCandidateType(type); |
1079 } | 1083 } |
1080 | 1084 |
1081 const char* DataStateToRTCDataChannelStateForTesting( | 1085 const char* DataStateToRTCDataChannelStateForTesting( |
1082 DataChannelInterface::DataState state) { | 1086 DataChannelInterface::DataState state) { |
1083 return DataStateToRTCDataChannelState(state); | 1087 return DataStateToRTCDataChannelState(state); |
1084 } | 1088 } |
1085 | 1089 |
1086 } // namespace webrtc | 1090 } // namespace webrtc |
OLD | NEW |