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 <stdio.h> | 10 #include <stdio.h> |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 printf("- Farewell, sweet Concorde!\n"); | 240 printf("- Farewell, sweet Concorde!\n"); |
241 | 241 |
242 // Signal stats polling thread if that is still waiting and stop it now, | 242 // Signal stats polling thread if that is still waiting and stop it now, |
243 // since it uses the send_stream_ reference that might be reclaimed after | 243 // since it uses the send_stream_ reference that might be reclaimed after |
244 // returning from this method. | 244 // returning from this method. |
245 done_->Set(); | 245 done_->Set(); |
246 EXPECT_TRUE(stats_polling_thread_->Stop()); | 246 EXPECT_TRUE(stats_polling_thread_->Stop()); |
247 } | 247 } |
248 | 248 |
249 VideoCaptureInput* input_; | 249 VideoCaptureInput* input_; |
250 Transport* transport_; | 250 Transport* const transport_; |
251 PacketReceiver* receiver_; | 251 PacketReceiver* receiver_; |
252 VideoSendStream* send_stream_; | 252 VideoSendStream* send_stream_; |
253 | 253 |
254 private: | 254 private: |
255 struct FrameComparison { | 255 struct FrameComparison { |
256 FrameComparison() | 256 FrameComparison() |
257 : dropped(false), | 257 : dropped(false), |
258 send_time_ms(0), | 258 send_time_ms(0), |
259 recv_time_ms(0), | 259 recv_time_ms(0), |
260 render_time_ms(0), | 260 render_time_ms(0), |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 | 749 |
750 FILE* graph_data_output_file = nullptr; | 750 FILE* graph_data_output_file = nullptr; |
751 if (!params.analyzer.graph_data_output_filename.empty()) { | 751 if (!params.analyzer.graph_data_output_filename.empty()) { |
752 graph_data_output_file = | 752 graph_data_output_file = |
753 fopen(params.analyzer.graph_data_output_filename.c_str(), "w"); | 753 fopen(params.analyzer.graph_data_output_filename.c_str(), "w"); |
754 RTC_CHECK(graph_data_output_file != nullptr) | 754 RTC_CHECK(graph_data_output_file != nullptr) |
755 << "Can't open the file " | 755 << "Can't open the file " |
756 << params.analyzer.graph_data_output_filename << "!"; | 756 << params.analyzer.graph_data_output_filename << "!"; |
757 } | 757 } |
758 | 758 |
| 759 Call::Config call_config; |
| 760 call_config.bitrate_config = params.common.call_bitrate_config; |
| 761 CreateCalls(call_config, call_config); |
| 762 |
759 test::LayerFilteringTransport send_transport( | 763 test::LayerFilteringTransport send_transport( |
760 params.pipe, kPayloadTypeVP8, kPayloadTypeVP9, | 764 params.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9, |
761 static_cast<uint8_t>(params.common.tl_discard_threshold), 0); | 765 static_cast<uint8_t>(params.common.tl_discard_threshold), 0); |
762 test::DirectTransport recv_transport(params.pipe); | 766 test::DirectTransport recv_transport(params.pipe, receiver_call_.get()); |
| 767 |
763 VideoAnalyzer analyzer( | 768 VideoAnalyzer analyzer( |
764 &send_transport, params.analyzer.test_label, | 769 &send_transport, params.analyzer.test_label, |
765 params.analyzer.avg_psnr_threshold, params.analyzer.avg_ssim_threshold, | 770 params.analyzer.avg_psnr_threshold, params.analyzer.avg_ssim_threshold, |
766 params.analyzer.test_durations_secs * params.common.fps, | 771 params.analyzer.test_durations_secs * params.common.fps, |
767 graph_data_output_file); | 772 graph_data_output_file); |
768 | 773 |
769 Call::Config call_config; | |
770 call_config.bitrate_config = params.common.call_bitrate_config; | |
771 CreateCalls(call_config, call_config); | |
772 | |
773 analyzer.SetReceiver(receiver_call_->Receiver()); | 774 analyzer.SetReceiver(receiver_call_->Receiver()); |
774 send_transport.SetReceiver(&analyzer); | 775 send_transport.SetReceiver(&analyzer); |
775 recv_transport.SetReceiver(sender_call_->Receiver()); | 776 recv_transport.SetReceiver(sender_call_->Receiver()); |
776 | 777 |
777 SetupFullStack(params, &analyzer, &recv_transport); | 778 SetupFullStack(params, &analyzer, &recv_transport); |
778 send_config_.encoding_time_observer = &analyzer; | 779 send_config_.encoding_time_observer = &analyzer; |
779 receive_configs_[0].renderer = &analyzer; | 780 receive_configs_[0].renderer = &analyzer; |
780 for (auto& config : receive_configs_) | 781 for (auto& config : receive_configs_) |
781 config.pre_decode_callback = &analyzer; | 782 config.pre_decode_callback = &analyzer; |
782 | 783 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 test::VideoRenderer::Create("Loopback Video", params.common.width, | 821 test::VideoRenderer::Create("Loopback Video", params.common.width, |
821 params.common.height)); | 822 params.common.height)); |
822 | 823 |
823 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to | 824 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to |
824 // match the full stack tests. | 825 // match the full stack tests. |
825 Call::Config call_config; | 826 Call::Config call_config; |
826 call_config.bitrate_config = params.common.call_bitrate_config; | 827 call_config.bitrate_config = params.common.call_bitrate_config; |
827 rtc::scoped_ptr<Call> call(Call::Create(call_config)); | 828 rtc::scoped_ptr<Call> call(Call::Create(call_config)); |
828 | 829 |
829 test::LayerFilteringTransport transport( | 830 test::LayerFilteringTransport transport( |
830 params.pipe, kPayloadTypeVP8, kPayloadTypeVP9, | 831 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9, |
831 static_cast<uint8_t>(params.common.tl_discard_threshold), 0); | 832 static_cast<uint8_t>(params.common.tl_discard_threshold), 0); |
832 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at | 833 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at |
833 // least share as much code as possible. That way this test would also match | 834 // least share as much code as possible. That way this test would also match |
834 // the full stack tests better. | 835 // the full stack tests better. |
835 transport.SetReceiver(call->Receiver()); | 836 transport.SetReceiver(call->Receiver()); |
836 | 837 |
837 SetupFullStack(params, &transport, &transport); | 838 SetupFullStack(params, &transport, &transport); |
838 send_config_.local_renderer = local_preview.get(); | 839 send_config_.local_renderer = local_preview.get(); |
839 receive_configs_[0].renderer = loopback_video.get(); | 840 receive_configs_[0].renderer = loopback_video.get(); |
840 | 841 |
(...skipping 15 matching lines...) Expand all Loading... |
856 send_stream_->Stop(); | 857 send_stream_->Stop(); |
857 receive_stream->Stop(); | 858 receive_stream->Stop(); |
858 | 859 |
859 call->DestroyVideoReceiveStream(receive_stream); | 860 call->DestroyVideoReceiveStream(receive_stream); |
860 call->DestroyVideoSendStream(send_stream_); | 861 call->DestroyVideoSendStream(send_stream_); |
861 | 862 |
862 transport.StopSending(); | 863 transport.StopSending(); |
863 } | 864 } |
864 | 865 |
865 } // namespace webrtc | 866 } // namespace webrtc |
OLD | NEW |