OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 #include "webrtc/video/video_quality_test.h" | 10 #include "webrtc/video/video_quality_test.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "webrtc/base/event.h" | 21 #include "webrtc/base/event.h" |
22 #include "webrtc/base/format_macros.h" | 22 #include "webrtc/base/format_macros.h" |
23 #include "webrtc/base/optional.h" | 23 #include "webrtc/base/optional.h" |
24 #include "webrtc/base/platform_file.h" | 24 #include "webrtc/base/platform_file.h" |
25 #include "webrtc/base/timeutils.h" | 25 #include "webrtc/base/timeutils.h" |
26 #include "webrtc/call/call.h" | 26 #include "webrtc/call/call.h" |
27 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 27 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
28 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 28 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
29 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" | 29 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" |
30 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 30 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
31 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" | |
31 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 32 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
32 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" | 33 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
33 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" | 34 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
34 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" | 35 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
35 #include "webrtc/system_wrappers/include/cpu_info.h" | 36 #include "webrtc/system_wrappers/include/cpu_info.h" |
36 #include "webrtc/system_wrappers/include/field_trial.h" | 37 #include "webrtc/system_wrappers/include/field_trial.h" |
37 #include "webrtc/test/gtest.h" | 38 #include "webrtc/test/gtest.h" |
38 #include "webrtc/test/layer_filtering_transport.h" | 39 #include "webrtc/test/layer_filtering_transport.h" |
39 #include "webrtc/test/run_loop.h" | 40 #include "webrtc/test/run_loop.h" |
40 #include "webrtc/test/statistics.h" | 41 #include "webrtc/test/statistics.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 const std::string& test_label, | 133 const std::string& test_label, |
133 double avg_psnr_threshold, | 134 double avg_psnr_threshold, |
134 double avg_ssim_threshold, | 135 double avg_ssim_threshold, |
135 int duration_frames, | 136 int duration_frames, |
136 FILE* graph_data_output_file, | 137 FILE* graph_data_output_file, |
137 const std::string& graph_title, | 138 const std::string& graph_title, |
138 uint32_t ssrc_to_analyze, | 139 uint32_t ssrc_to_analyze, |
139 uint32_t rtx_ssrc_to_analyze, | 140 uint32_t rtx_ssrc_to_analyze, |
140 uint32_t selected_stream_width, | 141 uint32_t selected_stream_width, |
141 uint32_t selected_stream_height, | 142 uint32_t selected_stream_height, |
143 int selected_sl, | |
144 int selected_tl, | |
142 bool is_quick_test_enabled) | 145 bool is_quick_test_enabled) |
143 : transport_(transport), | 146 : transport_(transport), |
144 receiver_(nullptr), | 147 receiver_(nullptr), |
145 send_stream_(nullptr), | 148 send_stream_(nullptr), |
146 receive_stream_(nullptr), | 149 receive_stream_(nullptr), |
147 captured_frame_forwarder_(this), | 150 captured_frame_forwarder_(this), |
148 test_label_(test_label), | 151 test_label_(test_label), |
149 graph_data_output_file_(graph_data_output_file), | 152 graph_data_output_file_(graph_data_output_file), |
150 graph_title_(graph_title), | 153 graph_title_(graph_title), |
151 ssrc_to_analyze_(ssrc_to_analyze), | 154 ssrc_to_analyze_(ssrc_to_analyze), |
152 rtx_ssrc_to_analyze_(rtx_ssrc_to_analyze), | 155 rtx_ssrc_to_analyze_(rtx_ssrc_to_analyze), |
153 selected_stream_width_(selected_stream_width), | 156 selected_stream_width_(selected_stream_width), |
154 selected_stream_height_(selected_stream_height), | 157 selected_stream_height_(selected_stream_height), |
158 selected_sl_(selected_sl), | |
159 selected_tl_(selected_tl), | |
155 pre_encode_proxy_(this), | 160 pre_encode_proxy_(this), |
156 encode_timing_proxy_(this), | 161 encode_timing_proxy_(this), |
157 frames_to_process_(duration_frames), | 162 frames_to_process_(duration_frames), |
158 frames_recorded_(0), | 163 frames_recorded_(0), |
159 frames_processed_(0), | 164 frames_processed_(0), |
160 dropped_frames_(0), | 165 dropped_frames_(0), |
161 dropped_frames_before_first_encode_(0), | 166 dropped_frames_before_first_encode_(0), |
162 dropped_frames_before_rendering_(0), | 167 dropped_frames_before_rendering_(0), |
163 last_render_time_(0), | 168 last_render_time_(0), |
164 rtp_timestamp_delta_(0), | 169 rtp_timestamp_delta_(0), |
170 total_media_bytes_(0), | |
171 first_sending_time_(0), | |
172 last_sending_time_(0), | |
165 avg_psnr_threshold_(avg_psnr_threshold), | 173 avg_psnr_threshold_(avg_psnr_threshold), |
166 avg_ssim_threshold_(avg_ssim_threshold), | 174 avg_ssim_threshold_(avg_ssim_threshold), |
167 is_quick_test_enabled_(is_quick_test_enabled), | 175 is_quick_test_enabled_(is_quick_test_enabled), |
168 stats_polling_thread_(&PollStatsThread, this, "StatsPoller"), | 176 stats_polling_thread_(&PollStatsThread, this, "StatsPoller"), |
169 comparison_available_event_(false, false), | 177 comparison_available_event_(false, false), |
170 done_(true, false) { | 178 done_(true, false) { |
171 // Create thread pool for CPU-expensive PSNR/SSIM calculations. | 179 // Create thread pool for CPU-expensive PSNR/SSIM calculations. |
172 | 180 |
173 // Try to use about as many threads as cores, but leave kMinCoresLeft alone, | 181 // Try to use about as many threads as cores, but leave kMinCoresLeft alone, |
174 // so that we don't accidentally starve "real" worker threads (codec etc). | 182 // so that we don't accidentally starve "real" worker threads (codec etc). |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 } | 306 } |
299 | 307 |
300 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { | 308 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { |
301 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. | 309 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. |
302 // (FlexFEC and media are sent on different SSRCs, which have different | 310 // (FlexFEC and media are sent on different SSRCs, which have different |
303 // timestamps spaces.) | 311 // timestamps spaces.) |
304 // Also ignore packets from wrong SSRC and retransmits. | 312 // Also ignore packets from wrong SSRC and retransmits. |
305 int64_t timestamp = | 313 int64_t timestamp = |
306 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); | 314 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); |
307 send_times_[timestamp] = current_time; | 315 send_times_[timestamp] = current_time; |
308 if (!transport_->DiscardedLastPacket() && | 316 |
309 header.ssrc == ssrc_to_analyze_) { | 317 if (IsInSelectedSpatialAndTemporalLayer(packet, length, header)) { |
310 encoded_frame_sizes_[timestamp] += | 318 encoded_frame_sizes_[timestamp] += |
311 length - (header.headerLength + header.paddingLength); | 319 length - (header.headerLength + header.paddingLength); |
320 total_media_bytes_ += | |
321 length - (header.headerLength + header.paddingLength); | |
312 } | 322 } |
323 if (first_sending_time_ == 0) | |
324 first_sending_time_ = current_time; | |
325 last_sending_time_ = current_time; | |
313 } | 326 } |
314 } | 327 } |
315 return result; | 328 return result; |
316 } | 329 } |
317 | 330 |
318 bool SendRtcp(const uint8_t* packet, size_t length) override { | 331 bool SendRtcp(const uint8_t* packet, size_t length) override { |
319 return transport_->SendRtcp(packet, length); | 332 return transport_->SendRtcp(packet, length); |
320 } | 333 } |
321 | 334 |
322 void EncodedFrameCallback(const EncodedFrame& frame) override { | 335 void EncodedFrameCallback(const EncodedFrame& frame) override {} |
323 rtc::CritScope lock(&comparison_lock_); | |
324 if (frames_recorded_ < frames_to_process_) | |
325 encoded_frame_size_.AddSample(frame.length_); | |
326 } | |
327 | 336 |
328 void OnFrame(const VideoFrame& video_frame) override { | 337 void OnFrame(const VideoFrame& video_frame) override { |
329 int64_t render_time_ms = | 338 int64_t render_time_ms = |
330 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 339 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
331 | 340 |
332 rtc::CritScope lock(&crit_); | 341 rtc::CritScope lock(&crit_); |
333 int64_t send_timestamp = | 342 int64_t send_timestamp = |
334 wrap_handler_.Unwrap(video_frame.timestamp() - rtp_timestamp_delta_); | 343 wrap_handler_.Unwrap(video_frame.timestamp() - rtp_timestamp_delta_); |
335 | 344 |
336 while (wrap_handler_.Unwrap(frames_.front().timestamp()) < send_timestamp) { | 345 while (wrap_handler_.Unwrap(frames_.front().timestamp()) < send_timestamp) { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 explicit PreEncodeProxy(VideoAnalyzer* parent) : parent_(parent) {} | 523 explicit PreEncodeProxy(VideoAnalyzer* parent) : parent_(parent) {} |
515 | 524 |
516 void OnFrame(const VideoFrame& video_frame) override { | 525 void OnFrame(const VideoFrame& video_frame) override { |
517 parent_->PreEncodeOnFrame(video_frame); | 526 parent_->PreEncodeOnFrame(video_frame); |
518 } | 527 } |
519 | 528 |
520 private: | 529 private: |
521 VideoAnalyzer* const parent_; | 530 VideoAnalyzer* const parent_; |
522 }; | 531 }; |
523 | 532 |
533 bool IsInSelectedSpatialAndTemporalLayer(const uint8_t* packet, | |
534 size_t length, | |
535 const RTPHeader& header) { | |
536 if (header.payloadType != kPayloadTypeVP9 && | |
537 header.payloadType != kPayloadTypeVP8) { | |
538 return true; | |
539 } else { | |
540 // Get VP8 and VP9 specific header to check layers indexes. | |
541 const uint8_t* payload = packet + header.headerLength; | |
542 const size_t payload_length = length - header.headerLength; | |
543 const size_t payload_data_length = payload_length - header.paddingLength; | |
544 const bool is_vp8 = header.payloadType == kPayloadTypeVP8; | |
545 std::unique_ptr<RtpDepacketizer> depacketizer( | |
546 RtpDepacketizer::Create(is_vp8 ? kRtpVideoVp8 : kRtpVideoVp9)); | |
547 RtpDepacketizer::ParsedPayload parsed_payload; | |
548 bool result = | |
549 depacketizer->Parse(&parsed_payload, payload, payload_data_length); | |
550 RTC_DCHECK(result); | |
551 const int temporal_idx = static_cast<int>( | |
552 is_vp8 ? parsed_payload.type.Video.codecHeader.VP8.temporalIdx | |
553 : parsed_payload.type.Video.codecHeader.VP9.temporal_idx); | |
554 const int spatial_idx = static_cast<int>( | |
555 is_vp8 ? kNoSpatialIdx | |
556 : parsed_payload.type.Video.codecHeader.VP9.spatial_idx); | |
557 return (selected_tl_ < 0 || temporal_idx == kNoTemporalIdx || | |
558 temporal_idx <= selected_tl_) && | |
559 (selected_sl_ < 0 || spatial_idx == kNoSpatialIdx || | |
560 spatial_idx <= selected_sl_); | |
561 } | |
562 } | |
563 | |
524 void AddFrameComparison(const VideoFrame& reference, | 564 void AddFrameComparison(const VideoFrame& reference, |
525 const VideoFrame& render, | 565 const VideoFrame& render, |
526 bool dropped, | 566 bool dropped, |
527 int64_t render_time_ms) | 567 int64_t render_time_ms) |
528 EXCLUSIVE_LOCKS_REQUIRED(crit_) { | 568 EXCLUSIVE_LOCKS_REQUIRED(crit_) { |
529 int64_t reference_timestamp = wrap_handler_.Unwrap(reference.timestamp()); | 569 int64_t reference_timestamp = wrap_handler_.Unwrap(reference.timestamp()); |
530 int64_t send_time_ms = send_times_[reference_timestamp]; | 570 int64_t send_time_ms = send_times_[reference_timestamp]; |
531 send_times_.erase(reference_timestamp); | 571 send_times_.erase(reference_timestamp); |
532 int64_t recv_time_ms = recv_times_[reference_timestamp]; | 572 int64_t recv_time_ms = recv_times_[reference_timestamp]; |
533 recv_times_.erase(reference_timestamp); | 573 recv_times_.erase(reference_timestamp); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
669 PrintResult("sender_time", sender_time_, " ms"); | 709 PrintResult("sender_time", sender_time_, " ms"); |
670 PrintResult("receiver_time", receiver_time_, " ms"); | 710 PrintResult("receiver_time", receiver_time_, " ms"); |
671 PrintResult("total_delay_incl_network", end_to_end_, " ms"); | 711 PrintResult("total_delay_incl_network", end_to_end_, " ms"); |
672 PrintResult("time_between_rendered_frames", rendered_delta_, " ms"); | 712 PrintResult("time_between_rendered_frames", rendered_delta_, " ms"); |
673 PrintResult("encoded_frame_size", encoded_frame_size_, " bytes"); | 713 PrintResult("encoded_frame_size", encoded_frame_size_, " bytes"); |
674 PrintResult("encode_frame_rate", encode_frame_rate_, " fps"); | 714 PrintResult("encode_frame_rate", encode_frame_rate_, " fps"); |
675 PrintResult("encode_time", encode_time_ms_, " ms"); | 715 PrintResult("encode_time", encode_time_ms_, " ms"); |
676 PrintResult("encode_usage_percent", encode_usage_percent_, " percent"); | 716 PrintResult("encode_usage_percent", encode_usage_percent_, " percent"); |
677 PrintResult("media_bitrate", media_bitrate_bps_, " bps"); | 717 PrintResult("media_bitrate", media_bitrate_bps_, " bps"); |
678 | 718 |
719 printf("RESULT actual_bitrate: %s = %.6lf bps\n", test_label_.c_str(), | |
720 GetAverageMediaBitrateBps()); | |
721 | |
679 if (receive_stream_ != nullptr) { | 722 if (receive_stream_ != nullptr) { |
680 PrintResult("decode_time", decode_time_ms_, " ms"); | 723 PrintResult("decode_time", decode_time_ms_, " ms"); |
681 PrintResult("decode_time_max", decode_time_max_ms_, " ms"); | 724 PrintResult("decode_time_max", decode_time_max_ms_, " ms"); |
682 } | 725 } |
683 | 726 |
684 printf("RESULT dropped_frames: %s = %d frames\n", test_label_.c_str(), | 727 printf("RESULT dropped_frames: %s = %d frames\n", test_label_.c_str(), |
685 dropped_frames_); | 728 dropped_frames_); |
686 printf("RESULT dropped_frames_before_first_encode: %s = %d frames\n", | 729 printf("RESULT dropped_frames_before_first_encode: %s = %d frames\n", |
687 test_label_.c_str(), dropped_frames_before_first_encode_); | 730 test_label_.c_str(), dropped_frames_before_first_encode_); |
688 printf("RESULT dropped_frames_before_rendering: %s = %d frames\n", | 731 printf("RESULT dropped_frames_before_rendering: %s = %d frames\n", |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
793 sample.encoded_frame_size, sample.psnr, sample.ssim, | 836 sample.encoded_frame_size, sample.psnr, sample.ssim, |
794 encode_time_ms); | 837 encode_time_ms); |
795 } | 838 } |
796 if (missing_encode_time_samples) { | 839 if (missing_encode_time_samples) { |
797 fprintf(stderr, | 840 fprintf(stderr, |
798 "Warning: Missing encode_time_ms samples for %d frame(s).\n", | 841 "Warning: Missing encode_time_ms samples for %d frame(s).\n", |
799 missing_encode_time_samples); | 842 missing_encode_time_samples); |
800 } | 843 } |
801 } | 844 } |
802 | 845 |
846 double GetAverageMediaBitrateBps() { | |
847 if (last_sending_time_ == first_sending_time_) | |
848 return 0; | |
sprang_webrtc
2017/02/23 10:46:54
nit: use brackets for if/else
if {
...
} else {
ilnik
2017/02/23 10:55:59
Done.
| |
849 else | |
850 return static_cast<double>(total_media_bytes_) * 8 / | |
851 (last_sending_time_ - first_sending_time_) * | |
852 rtc::kNumMillisecsPerSec; | |
853 } | |
854 | |
803 // Implements VideoSinkInterface to receive captured frames from a | 855 // Implements VideoSinkInterface to receive captured frames from a |
804 // FrameGeneratorCapturer. Implements VideoSourceInterface to be able to act | 856 // FrameGeneratorCapturer. Implements VideoSourceInterface to be able to act |
805 // as a source to VideoSendStream. | 857 // as a source to VideoSendStream. |
806 // It forwards all input frames to the VideoAnalyzer for later comparison and | 858 // It forwards all input frames to the VideoAnalyzer for later comparison and |
807 // forwards the captured frames to the VideoSendStream. | 859 // forwards the captured frames to the VideoSendStream. |
808 class CapturedFrameForwarder : public rtc::VideoSinkInterface<VideoFrame>, | 860 class CapturedFrameForwarder : public rtc::VideoSinkInterface<VideoFrame>, |
809 public rtc::VideoSourceInterface<VideoFrame> { | 861 public rtc::VideoSourceInterface<VideoFrame> { |
810 public: | 862 public: |
811 explicit CapturedFrameForwarder(VideoAnalyzer* analyzer) | 863 explicit CapturedFrameForwarder(VideoAnalyzer* analyzer) |
812 : analyzer_(analyzer), send_stream_input_(nullptr) {} | 864 : analyzer_(analyzer), send_stream_input_(nullptr) {} |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
852 VideoSendStream* send_stream_; | 904 VideoSendStream* send_stream_; |
853 VideoReceiveStream* receive_stream_; | 905 VideoReceiveStream* receive_stream_; |
854 CapturedFrameForwarder captured_frame_forwarder_; | 906 CapturedFrameForwarder captured_frame_forwarder_; |
855 const std::string test_label_; | 907 const std::string test_label_; |
856 FILE* const graph_data_output_file_; | 908 FILE* const graph_data_output_file_; |
857 const std::string graph_title_; | 909 const std::string graph_title_; |
858 const uint32_t ssrc_to_analyze_; | 910 const uint32_t ssrc_to_analyze_; |
859 const uint32_t rtx_ssrc_to_analyze_; | 911 const uint32_t rtx_ssrc_to_analyze_; |
860 const uint32_t selected_stream_width_; | 912 const uint32_t selected_stream_width_; |
861 const uint32_t selected_stream_height_; | 913 const uint32_t selected_stream_height_; |
914 const int selected_sl_; | |
915 const int selected_tl_; | |
862 PreEncodeProxy pre_encode_proxy_; | 916 PreEncodeProxy pre_encode_proxy_; |
863 OnEncodeTimingProxy encode_timing_proxy_; | 917 OnEncodeTimingProxy encode_timing_proxy_; |
864 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_); | 918 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_); |
865 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_); | 919 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_); |
866 test::Statistics sender_time_ GUARDED_BY(comparison_lock_); | 920 test::Statistics sender_time_ GUARDED_BY(comparison_lock_); |
867 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_); | 921 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_); |
868 test::Statistics psnr_ GUARDED_BY(comparison_lock_); | 922 test::Statistics psnr_ GUARDED_BY(comparison_lock_); |
869 test::Statistics ssim_ GUARDED_BY(comparison_lock_); | 923 test::Statistics ssim_ GUARDED_BY(comparison_lock_); |
870 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_); | 924 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_); |
871 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_); | 925 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_); |
872 test::Statistics encoded_frame_size_ GUARDED_BY(comparison_lock_); | 926 test::Statistics encoded_frame_size_ GUARDED_BY(comparison_lock_); |
873 test::Statistics encode_frame_rate_ GUARDED_BY(comparison_lock_); | 927 test::Statistics encode_frame_rate_ GUARDED_BY(comparison_lock_); |
874 test::Statistics encode_time_ms_ GUARDED_BY(comparison_lock_); | 928 test::Statistics encode_time_ms_ GUARDED_BY(comparison_lock_); |
875 test::Statistics encode_usage_percent_ GUARDED_BY(comparison_lock_); | 929 test::Statistics encode_usage_percent_ GUARDED_BY(comparison_lock_); |
876 test::Statistics decode_time_ms_ GUARDED_BY(comparison_lock_); | 930 test::Statistics decode_time_ms_ GUARDED_BY(comparison_lock_); |
877 test::Statistics decode_time_max_ms_ GUARDED_BY(comparison_lock_); | 931 test::Statistics decode_time_max_ms_ GUARDED_BY(comparison_lock_); |
878 test::Statistics media_bitrate_bps_ GUARDED_BY(comparison_lock_); | 932 test::Statistics media_bitrate_bps_ GUARDED_BY(comparison_lock_); |
879 | 933 |
880 const int frames_to_process_; | 934 const int frames_to_process_; |
881 int frames_recorded_; | 935 int frames_recorded_; |
882 int frames_processed_; | 936 int frames_processed_; |
883 int dropped_frames_; | 937 int dropped_frames_; |
884 int dropped_frames_before_first_encode_; | 938 int dropped_frames_before_first_encode_; |
885 int dropped_frames_before_rendering_; | 939 int dropped_frames_before_rendering_; |
886 int64_t last_render_time_; | 940 int64_t last_render_time_; |
887 uint32_t rtp_timestamp_delta_; | 941 uint32_t rtp_timestamp_delta_; |
942 int64_t total_media_bytes_; | |
943 | |
944 int64_t first_sending_time_; | |
945 int64_t last_sending_time_; | |
888 | 946 |
889 rtc::CriticalSection crit_; | 947 rtc::CriticalSection crit_; |
890 std::deque<VideoFrame> frames_ GUARDED_BY(crit_); | 948 std::deque<VideoFrame> frames_ GUARDED_BY(crit_); |
891 rtc::Optional<VideoFrame> last_rendered_frame_ GUARDED_BY(crit_); | 949 rtc::Optional<VideoFrame> last_rendered_frame_ GUARDED_BY(crit_); |
892 rtc::TimestampWrapAroundHandler wrap_handler_ GUARDED_BY(crit_); | 950 rtc::TimestampWrapAroundHandler wrap_handler_ GUARDED_BY(crit_); |
893 std::map<int64_t, int64_t> send_times_ GUARDED_BY(crit_); | 951 std::map<int64_t, int64_t> send_times_ GUARDED_BY(crit_); |
894 std::map<int64_t, int64_t> recv_times_ GUARDED_BY(crit_); | 952 std::map<int64_t, int64_t> recv_times_ GUARDED_BY(crit_); |
895 std::map<int64_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_); | 953 std::map<int64_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_); |
896 rtc::Optional<uint32_t> first_encoded_timestamp_ GUARDED_BY(crit_); | 954 rtc::Optional<uint32_t> first_encoded_timestamp_ GUARDED_BY(crit_); |
897 rtc::Optional<uint32_t> first_sent_timestamp_ GUARDED_BY(crit_); | 955 rtc::Optional<uint32_t> first_sent_timestamp_ GUARDED_BY(crit_); |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1350 &send_transport, params_.analyzer.test_label, | 1408 &send_transport, params_.analyzer.test_label, |
1351 | 1409 |
1352 params_.analyzer.avg_psnr_threshold, params_.analyzer.avg_ssim_threshold, | 1410 params_.analyzer.avg_psnr_threshold, params_.analyzer.avg_ssim_threshold, |
1353 is_quick_test_enabled | 1411 is_quick_test_enabled |
1354 ? kFramesSentInQuickTest | 1412 ? kFramesSentInQuickTest |
1355 : params_.analyzer.test_durations_secs * params_.video.fps, | 1413 : params_.analyzer.test_durations_secs * params_.video.fps, |
1356 graph_data_output_file, graph_title, | 1414 graph_data_output_file, graph_title, |
1357 kVideoSendSsrcs[params_.ss.selected_stream], | 1415 kVideoSendSsrcs[params_.ss.selected_stream], |
1358 kSendRtxSsrcs[params_.ss.selected_stream], | 1416 kSendRtxSsrcs[params_.ss.selected_stream], |
1359 static_cast<uint32_t>(selected_stream.width), | 1417 static_cast<uint32_t>(selected_stream.width), |
1360 static_cast<uint32_t>(selected_stream.height), is_quick_test_enabled); | 1418 static_cast<uint32_t>(selected_stream.height), params.ss.selected_sl, |
1419 params_.video.selected_tl, is_quick_test_enabled); | |
1361 analyzer.SetReceiver(receiver_call_->Receiver()); | 1420 analyzer.SetReceiver(receiver_call_->Receiver()); |
1362 send_transport.SetReceiver(&analyzer); | 1421 send_transport.SetReceiver(&analyzer); |
1363 recv_transport.SetReceiver(sender_call_->Receiver()); | 1422 recv_transport.SetReceiver(sender_call_->Receiver()); |
1364 | 1423 |
1365 SetupVideo(&analyzer, &recv_transport); | 1424 SetupVideo(&analyzer, &recv_transport); |
1366 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer; | 1425 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer; |
1367 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy(); | 1426 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy(); |
1368 for (auto& config : video_receive_configs_) | 1427 for (auto& config : video_receive_configs_) |
1369 config.pre_decode_callback = &analyzer; | 1428 config.pre_decode_callback = &analyzer; |
1370 RTC_DCHECK(!video_send_config_.post_encode_callback); | 1429 RTC_DCHECK(!video_send_config_.post_encode_callback); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1604 std::ostringstream str; | 1663 std::ostringstream str; |
1605 str << receive_logs_++; | 1664 str << receive_logs_++; |
1606 std::string path = | 1665 std::string path = |
1607 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 1666 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
1608 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 1667 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
1609 10000000); | 1668 10000000); |
1610 } | 1669 } |
1611 } | 1670 } |
1612 | 1671 |
1613 } // namespace webrtc | 1672 } // namespace webrtc |
OLD | NEW |