| 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 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 RTC_CHECK(graph_data_output_file) | 1418 RTC_CHECK(graph_data_output_file) |
| 1419 << "Can't open the file " << params_.analyzer.graph_data_output_filename | 1419 << "Can't open the file " << params_.analyzer.graph_data_output_filename |
| 1420 << "!"; | 1420 << "!"; |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 webrtc::RtcEventLogNullImpl event_log; | 1423 webrtc::RtcEventLogNullImpl event_log; |
| 1424 Call::Config call_config(&event_log_); | 1424 Call::Config call_config(&event_log_); |
| 1425 call_config.bitrate_config = params.call.call_bitrate_config; | 1425 call_config.bitrate_config = params.call.call_bitrate_config; |
| 1426 CreateCalls(call_config, call_config); | 1426 CreateCalls(call_config, call_config); |
| 1427 | 1427 |
| 1428 test::LayerFilteringTransport send_transport( | 1428 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream]; |
| 1429 params_.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9, | |
| 1430 params_.video.selected_tl, params_.ss.selected_sl); | |
| 1431 test::DirectTransport recv_transport(params_.pipe, receiver_call_.get()); | |
| 1432 | 1429 |
| 1433 std::string graph_title = params_.analyzer.graph_title; | 1430 std::string graph_title = params_.analyzer.graph_title; |
| 1434 if (graph_title.empty()) | 1431 if (graph_title.empty()) |
| 1435 graph_title = VideoQualityTest::GenerateGraphTitle(); | 1432 graph_title = VideoQualityTest::GenerateGraphTitle(); |
| 1436 | 1433 |
| 1437 // In the case of different resolutions, the functions calculating PSNR and | 1434 std::set<uint32_t> excluded_ssrcs; |
| 1438 // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer | 1435 for (size_t i = 0; i < params_.ss.streams.size(); i++) { |
| 1439 // aborts if the average psnr/ssim are below the given threshold, which is | 1436 if (i != params_.ss.selected_stream) { |
| 1440 // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary | 1437 excluded_ssrcs.insert(kVideoSendSsrcs[i]); |
| 1441 // abort. | 1438 excluded_ssrcs.insert(kSendRtxSsrcs[i]); |
| 1442 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream]; | 1439 } |
| 1440 } |
| 1441 |
| 1442 test::LayerFilteringTransport send_transport( |
| 1443 params_.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9, |
| 1444 params_.video.selected_tl, params_.ss.selected_sl, |
| 1445 excluded_ssrcs); |
| 1446 test::DirectTransport recv_transport(params_.pipe, receiver_call_.get()); |
| 1447 |
| 1443 | 1448 |
| 1444 bool is_quick_test_enabled = field_trial::IsEnabled("WebRTC-QuickPerfTest"); | 1449 bool is_quick_test_enabled = field_trial::IsEnabled("WebRTC-QuickPerfTest"); |
| 1445 VideoAnalyzer analyzer( | 1450 VideoAnalyzer analyzer( |
| 1446 &send_transport, params_.analyzer.test_label, | 1451 &send_transport, params_.analyzer.test_label, |
| 1447 | 1452 |
| 1448 params_.analyzer.avg_psnr_threshold, params_.analyzer.avg_ssim_threshold, | 1453 params_.analyzer.avg_psnr_threshold, params_.analyzer.avg_ssim_threshold, |
| 1449 is_quick_test_enabled | 1454 is_quick_test_enabled |
| 1450 ? kFramesSentInQuickTest | 1455 ? kFramesSentInQuickTest |
| 1451 : params_.analyzer.test_durations_secs * params_.video.fps, | 1456 : params_.analyzer.test_durations_secs * params_.video.fps, |
| 1452 graph_data_output_file, graph_title, | 1457 graph_data_output_file, graph_title, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 audio_state_config.audio_mixer = AudioMixerImpl::Create(); | 1569 audio_state_config.audio_mixer = AudioMixerImpl::Create(); |
| 1565 call_config.audio_state = AudioState::Create(audio_state_config); | 1570 call_config.audio_state = AudioState::Create(audio_state_config); |
| 1566 } | 1571 } |
| 1567 | 1572 |
| 1568 std::unique_ptr<Call> call(Call::Create(call_config)); | 1573 std::unique_ptr<Call> call(Call::Create(call_config)); |
| 1569 | 1574 |
| 1570 // TODO(minyue): consider if this is a good transport even for audio only | 1575 // TODO(minyue): consider if this is a good transport even for audio only |
| 1571 // calls. | 1576 // calls. |
| 1572 test::LayerFilteringTransport transport( | 1577 test::LayerFilteringTransport transport( |
| 1573 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9, | 1578 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9, |
| 1574 params.video.selected_tl, params_.ss.selected_sl); | 1579 params.video.selected_tl, params_.ss.selected_sl, |
| 1580 std::set<uint32_t>()); |
| 1575 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at | 1581 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at |
| 1576 // least share as much code as possible. That way this test would also match | 1582 // least share as much code as possible. That way this test would also match |
| 1577 // the full stack tests better. | 1583 // the full stack tests better. |
| 1578 transport.SetReceiver(call->Receiver()); | 1584 transport.SetReceiver(call->Receiver()); |
| 1579 | 1585 |
| 1580 VideoReceiveStream* video_receive_stream = nullptr; | 1586 VideoReceiveStream* video_receive_stream = nullptr; |
| 1581 FlexfecReceiveStream* flexfec_receive_stream = nullptr; | 1587 FlexfecReceiveStream* flexfec_receive_stream = nullptr; |
| 1582 std::unique_ptr<test::VideoRenderer> local_preview; | 1588 std::unique_ptr<test::VideoRenderer> local_preview; |
| 1583 std::unique_ptr<test::VideoRenderer> loopback_video; | 1589 std::unique_ptr<test::VideoRenderer> loopback_video; |
| 1584 if (params_.video.enabled) { | 1590 if (params_.video.enabled) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1597 loopback_video.reset(test::VideoRenderer::Create( | 1603 loopback_video.reset(test::VideoRenderer::Create( |
| 1598 title.c_str(), params_.ss.streams[stream_id].width, | 1604 title.c_str(), params_.ss.streams[stream_id].width, |
| 1599 params_.ss.streams[stream_id].height)); | 1605 params_.ss.streams[stream_id].height)); |
| 1600 | 1606 |
| 1601 SetupVideo(&transport, &transport); | 1607 SetupVideo(&transport, &transport); |
| 1602 video_send_config_.pre_encode_callback = local_preview.get(); | 1608 video_send_config_.pre_encode_callback = local_preview.get(); |
| 1603 video_receive_configs_[stream_id].renderer = loopback_video.get(); | 1609 video_receive_configs_[stream_id].renderer = loopback_video.get(); |
| 1604 if (params_.audio.enabled && params_.audio.sync_video) | 1610 if (params_.audio.enabled && params_.audio.sync_video) |
| 1605 video_receive_configs_[stream_id].sync_group = kSyncGroup; | 1611 video_receive_configs_[stream_id].sync_group = kSyncGroup; |
| 1606 | 1612 |
| 1607 if (params_.screenshare.enabled) | 1613 SetupScreenshareOrSVC(); |
| 1608 SetupScreenshareOrSVC(); | |
| 1609 | 1614 |
| 1610 video_send_stream_ = call->CreateVideoSendStream( | 1615 video_send_stream_ = call->CreateVideoSendStream( |
| 1611 video_send_config_.Copy(), video_encoder_config_.Copy()); | 1616 video_send_config_.Copy(), video_encoder_config_.Copy()); |
| 1612 if (params_.video.flexfec) { | 1617 if (params_.video.flexfec) { |
| 1613 RTC_DCHECK(!flexfec_receive_configs_.empty()); | 1618 RTC_DCHECK(!flexfec_receive_configs_.empty()); |
| 1614 flexfec_receive_stream = | 1619 flexfec_receive_stream = |
| 1615 call->CreateFlexfecReceiveStream(flexfec_receive_configs_[0]); | 1620 call->CreateFlexfecReceiveStream(flexfec_receive_configs_[0]); |
| 1616 } | 1621 } |
| 1617 video_receive_stream = call->CreateVideoReceiveStream( | 1622 video_receive_stream = call->CreateVideoReceiveStream( |
| 1618 video_receive_configs_[stream_id].Copy()); | 1623 video_receive_configs_[stream_id].Copy()); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1700 std::ostringstream str; | 1705 std::ostringstream str; |
| 1701 str << receive_logs_++; | 1706 str << receive_logs_++; |
| 1702 std::string path = | 1707 std::string path = |
| 1703 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 1708 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
| 1704 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 1709 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
| 1705 10000000); | 1710 10000000); |
| 1706 } | 1711 } |
| 1707 } | 1712 } |
| 1708 | 1713 |
| 1709 } // namespace webrtc | 1714 } // namespace webrtc |
| OLD | NEW |