| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 public rtc::VideoSinkInterface<VideoFrame>, | 126 public rtc::VideoSinkInterface<VideoFrame>, |
| 127 public EncodedFrameObserver { | 127 public EncodedFrameObserver { |
| 128 public: | 128 public: |
| 129 VideoAnalyzer(test::LayerFilteringTransport* transport, | 129 VideoAnalyzer(test::LayerFilteringTransport* transport, |
| 130 const std::string& test_label, | 130 const std::string& test_label, |
| 131 double avg_psnr_threshold, | 131 double avg_psnr_threshold, |
| 132 double avg_ssim_threshold, | 132 double avg_ssim_threshold, |
| 133 int duration_frames, | 133 int duration_frames, |
| 134 FILE* graph_data_output_file, | 134 FILE* graph_data_output_file, |
| 135 const std::string& graph_title, | 135 const std::string& graph_title, |
| 136 uint32_t ssrc_to_analyze) | 136 uint32_t ssrc_to_analyze, |
| 137 uint32_t selected_width, |
| 138 uint32_t selected_height) |
| 137 : transport_(transport), | 139 : transport_(transport), |
| 138 receiver_(nullptr), | 140 receiver_(nullptr), |
| 139 send_stream_(nullptr), | 141 send_stream_(nullptr), |
| 140 receive_stream_(nullptr), | 142 receive_stream_(nullptr), |
| 141 captured_frame_forwarder_(this), | 143 captured_frame_forwarder_(this), |
| 142 test_label_(test_label), | 144 test_label_(test_label), |
| 143 graph_data_output_file_(graph_data_output_file), | 145 graph_data_output_file_(graph_data_output_file), |
| 144 graph_title_(graph_title), | 146 graph_title_(graph_title), |
| 145 ssrc_to_analyze_(ssrc_to_analyze), | 147 ssrc_to_analyze_(ssrc_to_analyze), |
| 148 selected_width_(selected_width), |
| 149 selected_height_(selected_height), |
| 146 pre_encode_proxy_(this), | 150 pre_encode_proxy_(this), |
| 147 encode_timing_proxy_(this), | 151 encode_timing_proxy_(this), |
| 148 frames_to_process_(duration_frames), | 152 frames_to_process_(duration_frames), |
| 149 frames_recorded_(0), | 153 frames_recorded_(0), |
| 150 frames_processed_(0), | 154 frames_processed_(0), |
| 151 dropped_frames_(0), | 155 dropped_frames_(0), |
| 152 dropped_frames_before_first_encode_(0), | 156 dropped_frames_before_first_encode_(0), |
| 153 dropped_frames_before_rendering_(0), | 157 dropped_frames_before_rendering_(0), |
| 154 last_render_time_(0), | 158 last_render_time_(0), |
| 155 rtp_timestamp_delta_(0), | 159 rtp_timestamp_delta_(0), |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 const PacketTime& packet_time) override { | 223 const PacketTime& packet_time) override { |
| 220 // Ignore timestamps of RTCP packets. They're not synchronized with | 224 // Ignore timestamps of RTCP packets. They're not synchronized with |
| 221 // RTP packet timestamps and so they would confuse wrap_handler_. | 225 // RTP packet timestamps and so they would confuse wrap_handler_. |
| 222 if (RtpHeaderParser::IsRtcp(packet, length)) { | 226 if (RtpHeaderParser::IsRtcp(packet, length)) { |
| 223 return receiver_->DeliverPacket(media_type, packet, length, packet_time); | 227 return receiver_->DeliverPacket(media_type, packet, length, packet_time); |
| 224 } | 228 } |
| 225 | 229 |
| 226 RtpUtility::RtpHeaderParser parser(packet, length); | 230 RtpUtility::RtpHeaderParser parser(packet, length); |
| 227 RTPHeader header; | 231 RTPHeader header; |
| 228 parser.Parse(&header); | 232 parser.Parse(&header); |
| 229 if (!IsFlexfec(header.payloadType)) { | 233 if (!IsFlexfec(header.payloadType) && header.ssrc != ssrc_to_analyze_) { |
| 230 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. | 234 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. |
| 231 // (FlexFEC and media are sent on different SSRCs, which have different | 235 // (FlexFEC and media are sent on different SSRCs, which have different |
| 232 // timestamps spaces.) | 236 // timestamps spaces.) |
| 237 // Also ignore packets from wrong SSRC. |
| 233 rtc::CritScope lock(&crit_); | 238 rtc::CritScope lock(&crit_); |
| 234 int64_t timestamp = | 239 int64_t timestamp = |
| 235 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); | 240 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); |
| 236 recv_times_[timestamp] = | 241 recv_times_[timestamp] = |
| 237 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 242 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
| 238 } | 243 } |
| 239 | 244 |
| 240 return receiver_->DeliverPacket(media_type, packet, length, packet_time); | 245 return receiver_->DeliverPacket(media_type, packet, length, packet_time); |
| 241 } | 246 } |
| 242 | 247 |
| 243 void MeasuredEncodeTiming(int64_t ntp_time_ms, int encode_time_ms) { | 248 void MeasuredEncodeTiming(int64_t ntp_time_ms, int encode_time_ms) { |
| 244 rtc::CritScope crit(&comparison_lock_); | 249 rtc::CritScope crit(&comparison_lock_); |
| 245 samples_encode_time_ms_[ntp_time_ms] = encode_time_ms; | 250 samples_encode_time_ms_[ntp_time_ms] = encode_time_ms; |
| 246 } | 251 } |
| 247 | 252 |
| 248 void PreEncodeOnFrame(const VideoFrame& video_frame) { | 253 void PreEncodeOnFrame(const VideoFrame& video_frame) { |
| 249 rtc::CritScope lock(&crit_); | 254 rtc::CritScope lock(&crit_); |
| 250 if (!first_send_timestamp_ && rtp_timestamp_delta_ == 0) { | 255 if (!first_encoded_timestamp_) { |
| 251 while (frames_.front().timestamp() != video_frame.timestamp()) { | 256 while (frames_.front().timestamp() != video_frame.timestamp()) { |
| 252 ++dropped_frames_before_first_encode_; | 257 ++dropped_frames_before_first_encode_; |
| 253 frames_.pop_front(); | 258 frames_.pop_front(); |
| 254 RTC_CHECK(!frames_.empty()); | 259 RTC_CHECK(!frames_.empty()); |
| 255 } | 260 } |
| 256 first_send_timestamp_ = rtc::Optional<uint32_t>(video_frame.timestamp()); | 261 first_encoded_timestamp_ = |
| 262 rtc::Optional<uint32_t>(video_frame.timestamp()); |
| 257 } | 263 } |
| 258 } | 264 } |
| 259 | 265 |
| 266 void PostEncodeFrameCallback(const EncodedFrame& encoded_frame) { |
| 267 rtc::CritScope lock(&crit_); |
| 268 if (!first_sent_timestamp_ && |
| 269 encoded_frame.encoded_width_ == selected_width_ && |
| 270 encoded_frame.encoded_height_ == selected_height_) { |
| 271 first_sent_timestamp_ = rtc::Optional<uint32_t>(encoded_frame.timestamp_); |
| 272 } |
| 273 } |
| 274 |
| 260 bool SendRtp(const uint8_t* packet, | 275 bool SendRtp(const uint8_t* packet, |
| 261 size_t length, | 276 size_t length, |
| 262 const PacketOptions& options) override { | 277 const PacketOptions& options) override { |
| 263 RtpUtility::RtpHeaderParser parser(packet, length); | 278 RtpUtility::RtpHeaderParser parser(packet, length); |
| 264 RTPHeader header; | 279 RTPHeader header; |
| 265 parser.Parse(&header); | 280 parser.Parse(&header); |
| 266 | 281 |
| 267 int64_t current_time = | 282 int64_t current_time = |
| 268 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 283 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
| 269 bool result = transport_->SendRtp(packet, length, options); | 284 bool result = transport_->SendRtp(packet, length, options); |
| 270 { | 285 { |
| 271 rtc::CritScope lock(&crit_); | 286 rtc::CritScope lock(&crit_); |
| 287 if (rtp_timestamp_delta_ == 0 && header.ssrc == ssrc_to_analyze_) { |
| 288 rtp_timestamp_delta_ = header.timestamp - *first_sent_timestamp_; |
| 289 } |
| 272 | 290 |
| 273 if (rtp_timestamp_delta_ == 0) { | 291 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { |
| 274 rtp_timestamp_delta_ = header.timestamp - *first_send_timestamp_; | |
| 275 first_send_timestamp_ = rtc::Optional<uint32_t>(); | |
| 276 } | |
| 277 if (!IsFlexfec(header.payloadType)) { | |
| 278 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. | 292 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. |
| 279 // (FlexFEC and media are sent on different SSRCs, which have different | 293 // (FlexFEC and media are sent on different SSRCs, which have different |
| 280 // timestamps spaces.) | 294 // timestamps spaces.) |
| 295 // Also ignore packets from wrong SSRC. |
| 281 int64_t timestamp = | 296 int64_t timestamp = |
| 282 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); | 297 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); |
| 283 send_times_[timestamp] = current_time; | 298 send_times_[timestamp] = current_time; |
| 284 if (!transport_->DiscardedLastPacket() && | 299 if (!transport_->DiscardedLastPacket() && |
| 285 header.ssrc == ssrc_to_analyze_) { | 300 header.ssrc == ssrc_to_analyze_) { |
| 286 encoded_frame_sizes_[timestamp] += | 301 encoded_frame_sizes_[timestamp] += |
| 287 length - (header.headerLength + header.paddingLength); | 302 length - (header.headerLength + header.paddingLength); |
| 288 } | 303 } |
| 289 } | 304 } |
| 290 } | 305 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 483 |
| 469 // This class receives the send-side OnEncodeTiming and is provided to not | 484 // This class receives the send-side OnEncodeTiming and is provided to not |
| 470 // conflict with the receiver-side pre_decode_callback. | 485 // conflict with the receiver-side pre_decode_callback. |
| 471 class OnEncodeTimingProxy : public EncodedFrameObserver { | 486 class OnEncodeTimingProxy : public EncodedFrameObserver { |
| 472 public: | 487 public: |
| 473 explicit OnEncodeTimingProxy(VideoAnalyzer* parent) : parent_(parent) {} | 488 explicit OnEncodeTimingProxy(VideoAnalyzer* parent) : parent_(parent) {} |
| 474 | 489 |
| 475 void OnEncodeTiming(int64_t ntp_time_ms, int encode_time_ms) override { | 490 void OnEncodeTiming(int64_t ntp_time_ms, int encode_time_ms) override { |
| 476 parent_->MeasuredEncodeTiming(ntp_time_ms, encode_time_ms); | 491 parent_->MeasuredEncodeTiming(ntp_time_ms, encode_time_ms); |
| 477 } | 492 } |
| 478 void EncodedFrameCallback(const EncodedFrame& frame) override {} | 493 void EncodedFrameCallback(const EncodedFrame& frame) override { |
| 494 parent_->PostEncodeFrameCallback(frame); |
| 495 } |
| 479 | 496 |
| 480 private: | 497 private: |
| 481 VideoAnalyzer* const parent_; | 498 VideoAnalyzer* const parent_; |
| 482 }; | 499 }; |
| 483 | 500 |
| 484 // This class receives the send-side OnFrame callback and is provided to not | 501 // This class receives the send-side OnFrame callback and is provided to not |
| 485 // conflict with the receiver-side renderer callback. | 502 // conflict with the receiver-side renderer callback. |
| 486 class PreEncodeProxy : public rtc::VideoSinkInterface<VideoFrame> { | 503 class PreEncodeProxy : public rtc::VideoSinkInterface<VideoFrame> { |
| 487 public: | 504 public: |
| 488 explicit PreEncodeProxy(VideoAnalyzer* parent) : parent_(parent) {} | 505 explicit PreEncodeProxy(VideoAnalyzer* parent) : parent_(parent) {} |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 // forwards the captured frames to the VideoSendStream. | 795 // forwards the captured frames to the VideoSendStream. |
| 779 class CapturedFrameForwarder : public rtc::VideoSinkInterface<VideoFrame>, | 796 class CapturedFrameForwarder : public rtc::VideoSinkInterface<VideoFrame>, |
| 780 public rtc::VideoSourceInterface<VideoFrame> { | 797 public rtc::VideoSourceInterface<VideoFrame> { |
| 781 public: | 798 public: |
| 782 explicit CapturedFrameForwarder(VideoAnalyzer* analyzer) | 799 explicit CapturedFrameForwarder(VideoAnalyzer* analyzer) |
| 783 : analyzer_(analyzer), send_stream_input_(nullptr) {} | 800 : analyzer_(analyzer), send_stream_input_(nullptr) {} |
| 784 | 801 |
| 785 private: | 802 private: |
| 786 void OnFrame(const VideoFrame& video_frame) override { | 803 void OnFrame(const VideoFrame& video_frame) override { |
| 787 VideoFrame copy = video_frame; | 804 VideoFrame copy = video_frame; |
| 805 // Frames from the capturer does not have a rtp timestamp. |
| 806 // Create one so it can be used for comparison. |
| 807 RTC_DCHECK_EQ(0, video_frame.timestamp()); |
| 788 copy.set_timestamp(copy.ntp_time_ms() * 90); | 808 copy.set_timestamp(copy.ntp_time_ms() * 90); |
| 789 | 809 analyzer_->AddCapturedFrameForComparison(copy); |
| 790 analyzer_->AddCapturedFrameForComparison(video_frame); | |
| 791 rtc::CritScope lock(&crit_); | 810 rtc::CritScope lock(&crit_); |
| 792 if (send_stream_input_) | 811 if (send_stream_input_) |
| 793 send_stream_input_->OnFrame(video_frame); | 812 send_stream_input_->OnFrame(video_frame); |
| 794 } | 813 } |
| 795 | 814 |
| 796 // Called when |send_stream_.SetSource()| is called. | 815 // Called when |send_stream_.SetSource()| is called. |
| 797 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, | 816 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, |
| 798 const rtc::VideoSinkWants& wants) override { | 817 const rtc::VideoSinkWants& wants) override { |
| 799 rtc::CritScope lock(&crit_); | 818 rtc::CritScope lock(&crit_); |
| 800 RTC_DCHECK(!send_stream_input_ || send_stream_input_ == sink); | 819 RTC_DCHECK(!send_stream_input_ || send_stream_input_ == sink); |
| 801 send_stream_input_ = sink; | 820 send_stream_input_ = sink; |
| 802 } | 821 } |
| 803 | 822 |
| 804 // Called by |send_stream_| when |send_stream_.SetSource()| is called. | 823 // Called by |send_stream_| when |send_stream_.SetSource()| is called. |
| 805 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override { | 824 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override { |
| 806 rtc::CritScope lock(&crit_); | 825 rtc::CritScope lock(&crit_); |
| 807 RTC_DCHECK(sink == send_stream_input_); | 826 RTC_DCHECK(sink == send_stream_input_); |
| 808 send_stream_input_ = nullptr; | 827 send_stream_input_ = nullptr; |
| 809 } | 828 } |
| 810 | 829 |
| 811 VideoAnalyzer* const analyzer_; | 830 VideoAnalyzer* const analyzer_; |
| 812 rtc::CriticalSection crit_; | 831 rtc::CriticalSection crit_; |
| 813 rtc::VideoSinkInterface<VideoFrame>* send_stream_input_ GUARDED_BY(crit_); | 832 rtc::VideoSinkInterface<VideoFrame>* send_stream_input_ GUARDED_BY(crit_); |
| 814 }; | 833 }; |
| 815 | 834 |
| 816 void AddCapturedFrameForComparison(const VideoFrame& video_frame) { | 835 void AddCapturedFrameForComparison(const VideoFrame& video_frame) { |
| 817 rtc::CritScope lock(&crit_); | 836 rtc::CritScope lock(&crit_); |
| 818 RTC_DCHECK_EQ(0, video_frame.timestamp()); | 837 frames_.push_back(video_frame); |
| 819 // Frames from the capturer does not have a rtp timestamp. Create one so it | |
| 820 // can be used for comparison. | |
| 821 VideoFrame copy = video_frame; | |
| 822 copy.set_timestamp(copy.ntp_time_ms() * 90); | |
| 823 frames_.push_back(copy); | |
| 824 } | 838 } |
| 825 | 839 |
| 826 VideoSendStream* send_stream_; | 840 VideoSendStream* send_stream_; |
| 827 VideoReceiveStream* receive_stream_; | 841 VideoReceiveStream* receive_stream_; |
| 828 CapturedFrameForwarder captured_frame_forwarder_; | 842 CapturedFrameForwarder captured_frame_forwarder_; |
| 829 const std::string test_label_; | 843 const std::string test_label_; |
| 830 FILE* const graph_data_output_file_; | 844 FILE* const graph_data_output_file_; |
| 831 const std::string graph_title_; | 845 const std::string graph_title_; |
| 832 const uint32_t ssrc_to_analyze_; | 846 const uint32_t ssrc_to_analyze_; |
| 847 const uint32_t selected_width_; |
| 848 const uint32_t selected_height_; |
| 833 PreEncodeProxy pre_encode_proxy_; | 849 PreEncodeProxy pre_encode_proxy_; |
| 834 OnEncodeTimingProxy encode_timing_proxy_; | 850 OnEncodeTimingProxy encode_timing_proxy_; |
| 835 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_); | 851 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_); |
| 836 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_); | 852 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_); |
| 837 test::Statistics sender_time_ GUARDED_BY(comparison_lock_); | 853 test::Statistics sender_time_ GUARDED_BY(comparison_lock_); |
| 838 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_); | 854 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_); |
| 839 test::Statistics psnr_ GUARDED_BY(comparison_lock_); | 855 test::Statistics psnr_ GUARDED_BY(comparison_lock_); |
| 840 test::Statistics ssim_ GUARDED_BY(comparison_lock_); | 856 test::Statistics ssim_ GUARDED_BY(comparison_lock_); |
| 841 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_); | 857 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_); |
| 842 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_); | 858 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 857 int64_t last_render_time_; | 873 int64_t last_render_time_; |
| 858 uint32_t rtp_timestamp_delta_; | 874 uint32_t rtp_timestamp_delta_; |
| 859 | 875 |
| 860 rtc::CriticalSection crit_; | 876 rtc::CriticalSection crit_; |
| 861 std::deque<VideoFrame> frames_ GUARDED_BY(crit_); | 877 std::deque<VideoFrame> frames_ GUARDED_BY(crit_); |
| 862 rtc::Optional<VideoFrame> last_rendered_frame_ GUARDED_BY(crit_); | 878 rtc::Optional<VideoFrame> last_rendered_frame_ GUARDED_BY(crit_); |
| 863 rtc::TimestampWrapAroundHandler wrap_handler_ GUARDED_BY(crit_); | 879 rtc::TimestampWrapAroundHandler wrap_handler_ GUARDED_BY(crit_); |
| 864 std::map<int64_t, int64_t> send_times_ GUARDED_BY(crit_); | 880 std::map<int64_t, int64_t> send_times_ GUARDED_BY(crit_); |
| 865 std::map<int64_t, int64_t> recv_times_ GUARDED_BY(crit_); | 881 std::map<int64_t, int64_t> recv_times_ GUARDED_BY(crit_); |
| 866 std::map<int64_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_); | 882 std::map<int64_t, size_t> encoded_frame_sizes_ GUARDED_BY(crit_); |
| 867 rtc::Optional<uint32_t> first_send_timestamp_ GUARDED_BY(crit_); | 883 rtc::Optional<uint32_t> first_encoded_timestamp_ GUARDED_BY(crit_); |
| 884 rtc::Optional<uint32_t> first_sent_timestamp_ GUARDED_BY(crit_); |
| 868 const double avg_psnr_threshold_; | 885 const double avg_psnr_threshold_; |
| 869 const double avg_ssim_threshold_; | 886 const double avg_ssim_threshold_; |
| 870 | 887 |
| 871 rtc::CriticalSection comparison_lock_; | 888 rtc::CriticalSection comparison_lock_; |
| 872 std::vector<rtc::PlatformThread*> comparison_thread_pool_; | 889 std::vector<rtc::PlatformThread*> comparison_thread_pool_; |
| 873 rtc::PlatformThread stats_polling_thread_; | 890 rtc::PlatformThread stats_polling_thread_; |
| 874 rtc::Event comparison_available_event_; | 891 rtc::Event comparison_available_event_; |
| 875 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_); | 892 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_); |
| 876 rtc::Event done_; | 893 rtc::Event done_; |
| 877 }; | 894 }; |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 : params_.ss.num_spatial_layers - 1; | 1322 : params_.ss.num_spatial_layers - 1; |
| 1306 bool disable_quality_check = | 1323 bool disable_quality_check = |
| 1307 selected_stream.width != params_.video.width || | 1324 selected_stream.width != params_.video.width || |
| 1308 selected_stream.height != params_.video.height || | 1325 selected_stream.height != params_.video.height || |
| 1309 (!params_.ss.spatial_layers.empty() && | 1326 (!params_.ss.spatial_layers.empty() && |
| 1310 params_.ss.spatial_layers[selected_sl].scaling_factor_num != | 1327 params_.ss.spatial_layers[selected_sl].scaling_factor_num != |
| 1311 params_.ss.spatial_layers[selected_sl].scaling_factor_den); | 1328 params_.ss.spatial_layers[selected_sl].scaling_factor_den); |
| 1312 if (disable_quality_check) { | 1329 if (disable_quality_check) { |
| 1313 fprintf(stderr, | 1330 fprintf(stderr, |
| 1314 "Warning: Calculating PSNR and SSIM for downsized resolution " | 1331 "Warning: Calculating PSNR and SSIM for downsized resolution " |
| 1315 "not implemented yet! Skipping PSNR and SSIM calculations!"); | 1332 "not implemented yet! Skipping PSNR and SSIM calculations!\n"); |
| 1316 } | 1333 } |
| 1317 | 1334 |
| 1318 VideoAnalyzer analyzer( | 1335 VideoAnalyzer analyzer( |
| 1319 &send_transport, params_.analyzer.test_label, | 1336 &send_transport, params_.analyzer.test_label, |
| 1320 disable_quality_check ? -1.1 : params_.analyzer.avg_psnr_threshold, | 1337 disable_quality_check ? -1.1 : params_.analyzer.avg_psnr_threshold, |
| 1321 disable_quality_check ? -1.1 : params_.analyzer.avg_ssim_threshold, | 1338 disable_quality_check ? -1.1 : params_.analyzer.avg_ssim_threshold, |
| 1322 params_.analyzer.test_durations_secs * params_.video.fps, | 1339 params_.analyzer.test_durations_secs * params_.video.fps, |
| 1323 graph_data_output_file, graph_title, | 1340 graph_data_output_file, graph_title, |
| 1324 kVideoSendSsrcs[params_.ss.selected_stream]); | 1341 kVideoSendSsrcs[params_.ss.selected_stream], |
| 1342 static_cast<uint32_t>(selected_stream.width), |
| 1343 static_cast<uint32_t>(selected_stream.height)); |
| 1325 | 1344 |
| 1326 analyzer.SetReceiver(receiver_call_->Receiver()); | 1345 analyzer.SetReceiver(receiver_call_->Receiver()); |
| 1327 send_transport.SetReceiver(&analyzer); | 1346 send_transport.SetReceiver(&analyzer); |
| 1328 recv_transport.SetReceiver(sender_call_->Receiver()); | 1347 recv_transport.SetReceiver(sender_call_->Receiver()); |
| 1329 | 1348 |
| 1330 SetupVideo(&analyzer, &recv_transport); | 1349 SetupVideo(&analyzer, &recv_transport); |
| 1331 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer; | 1350 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer; |
| 1332 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy(); | 1351 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy(); |
| 1333 for (auto& config : video_receive_configs_) | 1352 for (auto& config : video_receive_configs_) |
| 1334 config.pre_decode_callback = &analyzer; | 1353 config.pre_decode_callback = &analyzer; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1570 std::ostringstream str; | 1589 std::ostringstream str; |
| 1571 str << receive_logs_++; | 1590 str << receive_logs_++; |
| 1572 std::string path = | 1591 std::string path = |
| 1573 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 1592 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
| 1574 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 1593 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
| 1575 10000000); | 1594 10000000); |
| 1576 } | 1595 } |
| 1577 } | 1596 } |
| 1578 | 1597 |
| 1579 } // namespace webrtc | 1598 } // namespace webrtc |
| OLD | NEW |