Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Side by Side Diff: webrtc/video/video_quality_test.cc

Issue 2463733002: Revert of "Separating video settings in VideoQualityTest". (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 std::vector<rtc::PlatformThread*> comparison_thread_pool_; 813 std::vector<rtc::PlatformThread*> comparison_thread_pool_;
814 rtc::PlatformThread stats_polling_thread_; 814 rtc::PlatformThread stats_polling_thread_;
815 rtc::Event comparison_available_event_; 815 rtc::Event comparison_available_event_;
816 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_); 816 std::deque<FrameComparison> comparisons_ GUARDED_BY(comparison_lock_);
817 rtc::Event done_; 817 rtc::Event done_;
818 }; 818 };
819 819
820 VideoQualityTest::VideoQualityTest() 820 VideoQualityTest::VideoQualityTest()
821 : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) {} 821 : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) {}
822 822
823 VideoQualityTest::Params::Params()
824 : call({false, Call::Config::BitrateConfig()}),
825 video({false, 640, 480, 30, 50, 800, 800, false, "VP8", 1, -1, 0, false,
826 "", ""}),
827 audio({false, false}),
828 screenshare({false, 10, 0}),
829 analyzer({"", 0.0, 0.0, 0, "", ""}),
830 pipe(),
831 logs(false),
832 ss({std::vector<VideoStream>(), 0, 0, -1, std::vector<SpatialLayer>()}) {}
833
834 VideoQualityTest::Params::~Params() = default;
835
836 void VideoQualityTest::TestBody() {} 823 void VideoQualityTest::TestBody() {}
837 824
838 std::string VideoQualityTest::GenerateGraphTitle() const { 825 std::string VideoQualityTest::GenerateGraphTitle() const {
839 std::stringstream ss; 826 std::stringstream ss;
840 ss << params_.video.codec; 827 ss << params_.common.codec;
841 ss << " (" << params_.video.target_bitrate_bps / 1000 << "kbps"; 828 ss << " (" << params_.common.target_bitrate_bps / 1000 << "kbps";
842 ss << ", " << params_.video.fps << " FPS"; 829 ss << ", " << params_.common.fps << " FPS";
843 if (params_.screenshare.scroll_duration) 830 if (params_.screenshare.scroll_duration)
844 ss << ", " << params_.screenshare.scroll_duration << "s scroll"; 831 ss << ", " << params_.screenshare.scroll_duration << "s scroll";
845 if (params_.ss.streams.size() > 1) 832 if (params_.ss.streams.size() > 1)
846 ss << ", Stream #" << params_.ss.selected_stream; 833 ss << ", Stream #" << params_.ss.selected_stream;
847 if (params_.ss.num_spatial_layers > 1) 834 if (params_.ss.num_spatial_layers > 1)
848 ss << ", Layer #" << params_.ss.selected_sl; 835 ss << ", Layer #" << params_.ss.selected_sl;
849 ss << ")"; 836 ss << ")";
850 return ss.str(); 837 return ss.str();
851 } 838 }
852 839
853 void VideoQualityTest::CheckParams() { 840 void VideoQualityTest::CheckParams() {
854 // Add a default stream in none specified. 841 // Add a default stream in none specified.
855 if (params_.ss.streams.empty()) 842 if (params_.ss.streams.empty())
856 params_.ss.streams.push_back(VideoQualityTest::DefaultVideoStream(params_)); 843 params_.ss.streams.push_back(VideoQualityTest::DefaultVideoStream(params_));
857 if (params_.ss.num_spatial_layers == 0) 844 if (params_.ss.num_spatial_layers == 0)
858 params_.ss.num_spatial_layers = 1; 845 params_.ss.num_spatial_layers = 1;
859 846
860 if (params_.pipe.loss_percent != 0 || 847 if (params_.pipe.loss_percent != 0 ||
861 params_.pipe.queue_length_packets != 0) { 848 params_.pipe.queue_length_packets != 0) {
862 // Since LayerFilteringTransport changes the sequence numbers, we can't 849 // Since LayerFilteringTransport changes the sequence numbers, we can't
863 // use that feature with pack loss, since the NACK request would end up 850 // use that feature with pack loss, since the NACK request would end up
864 // retransmitting the wrong packets. 851 // retransmitting the wrong packets.
865 RTC_CHECK(params_.ss.selected_sl == -1 || 852 RTC_CHECK(params_.ss.selected_sl == -1 ||
866 params_.ss.selected_sl == params_.ss.num_spatial_layers - 1); 853 params_.ss.selected_sl == params_.ss.num_spatial_layers - 1);
867 RTC_CHECK(params_.video.selected_tl == -1 || 854 RTC_CHECK(params_.common.selected_tl == -1 ||
868 params_.video.selected_tl == 855 params_.common.selected_tl ==
869 params_.video.num_temporal_layers - 1); 856 params_.common.num_temporal_layers - 1);
870 } 857 }
871 858
872 // TODO(ivica): Should max_bitrate_bps == -1 represent inf max bitrate, as it 859 // TODO(ivica): Should max_bitrate_bps == -1 represent inf max bitrate, as it
873 // does in some parts of the code? 860 // does in some parts of the code?
874 RTC_CHECK_GE(params_.video.max_bitrate_bps, params_.video.target_bitrate_bps); 861 RTC_CHECK_GE(params_.common.max_bitrate_bps,
875 RTC_CHECK_GE(params_.video.target_bitrate_bps, params_.video.min_bitrate_bps); 862 params_.common.target_bitrate_bps);
876 RTC_CHECK_LT(params_.video.selected_tl, params_.video.num_temporal_layers); 863 RTC_CHECK_GE(params_.common.target_bitrate_bps,
864 params_.common.min_bitrate_bps);
865 RTC_CHECK_LT(params_.common.selected_tl, params_.common.num_temporal_layers);
877 RTC_CHECK_LT(params_.ss.selected_stream, params_.ss.streams.size()); 866 RTC_CHECK_LT(params_.ss.selected_stream, params_.ss.streams.size());
878 for (const VideoStream& stream : params_.ss.streams) { 867 for (const VideoStream& stream : params_.ss.streams) {
879 RTC_CHECK_GE(stream.min_bitrate_bps, 0); 868 RTC_CHECK_GE(stream.min_bitrate_bps, 0);
880 RTC_CHECK_GE(stream.target_bitrate_bps, stream.min_bitrate_bps); 869 RTC_CHECK_GE(stream.target_bitrate_bps, stream.min_bitrate_bps);
881 RTC_CHECK_GE(stream.max_bitrate_bps, stream.target_bitrate_bps); 870 RTC_CHECK_GE(stream.max_bitrate_bps, stream.target_bitrate_bps);
882 RTC_CHECK_EQ(static_cast<int>(stream.temporal_layer_thresholds_bps.size()), 871 RTC_CHECK_EQ(static_cast<int>(stream.temporal_layer_thresholds_bps.size()),
883 params_.video.num_temporal_layers - 1); 872 params_.common.num_temporal_layers - 1);
884 } 873 }
885 // TODO(ivica): Should we check if the sum of all streams/layers is equal to 874 // TODO(ivica): Should we check if the sum of all streams/layers is equal to
886 // the total bitrate? We anyway have to update them in the case bitrate 875 // the total bitrate? We anyway have to update them in the case bitrate
887 // estimator changes the total bitrates. 876 // estimator changes the total bitrates.
888 RTC_CHECK_GE(params_.ss.num_spatial_layers, 1); 877 RTC_CHECK_GE(params_.ss.num_spatial_layers, 1);
889 RTC_CHECK_LE(params_.ss.selected_sl, params_.ss.num_spatial_layers); 878 RTC_CHECK_LE(params_.ss.selected_sl, params_.ss.num_spatial_layers);
890 RTC_CHECK(params_.ss.spatial_layers.empty() || 879 RTC_CHECK(params_.ss.spatial_layers.empty() ||
891 params_.ss.spatial_layers.size() == 880 params_.ss.spatial_layers.size() ==
892 static_cast<size_t>(params_.ss.num_spatial_layers)); 881 static_cast<size_t>(params_.ss.num_spatial_layers));
893 if (params_.video.codec == "VP8") { 882 if (params_.common.codec == "VP8") {
894 RTC_CHECK_EQ(params_.ss.num_spatial_layers, 1); 883 RTC_CHECK_EQ(params_.ss.num_spatial_layers, 1);
895 } else if (params_.video.codec == "VP9") { 884 } else if (params_.common.codec == "VP9") {
896 RTC_CHECK_EQ(params_.ss.streams.size(), 1u); 885 RTC_CHECK_EQ(params_.ss.streams.size(), 1u);
897 } 886 }
898 } 887 }
899 888
900 // Static. 889 // Static.
901 std::vector<int> VideoQualityTest::ParseCSV(const std::string& str) { 890 std::vector<int> VideoQualityTest::ParseCSV(const std::string& str) {
902 // Parse comma separated nonnegative integers, where some elements may be 891 // Parse comma separated nonnegative integers, where some elements may be
903 // empty. The empty values are replaced with -1. 892 // empty. The empty values are replaced with -1.
904 // E.g. "10,-20,,30,40" --> {10, 20, -1, 30,40} 893 // E.g. "10,-20,,30,40" --> {10, 20, -1, 30,40}
905 // E.g. ",,10,,20," --> {-1, -1, 10, -1, 20, -1} 894 // E.g. ",,10,,20," --> {-1, -1, 10, -1, 20, -1}
(...skipping 15 matching lines...) Expand all
921 << "Unexpected non-number value."; 910 << "Unexpected non-number value.";
922 p += pos; 911 p += pos;
923 } 912 }
924 result.push_back(value); 913 result.push_back(value);
925 return result; 914 return result;
926 } 915 }
927 916
928 // Static. 917 // Static.
929 VideoStream VideoQualityTest::DefaultVideoStream(const Params& params) { 918 VideoStream VideoQualityTest::DefaultVideoStream(const Params& params) {
930 VideoStream stream; 919 VideoStream stream;
931 stream.width = params.video.width; 920 stream.width = params.common.width;
932 stream.height = params.video.height; 921 stream.height = params.common.height;
933 stream.max_framerate = params.video.fps; 922 stream.max_framerate = params.common.fps;
934 stream.min_bitrate_bps = params.video.min_bitrate_bps; 923 stream.min_bitrate_bps = params.common.min_bitrate_bps;
935 stream.target_bitrate_bps = params.video.target_bitrate_bps; 924 stream.target_bitrate_bps = params.common.target_bitrate_bps;
936 stream.max_bitrate_bps = params.video.max_bitrate_bps; 925 stream.max_bitrate_bps = params.common.max_bitrate_bps;
937 stream.max_qp = 52; 926 stream.max_qp = 52;
938 if (params.video.num_temporal_layers == 2) 927 if (params.common.num_temporal_layers == 2)
939 stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps); 928 stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps);
940 return stream; 929 return stream;
941 } 930 }
942 931
943 // Static. 932 // Static.
944 void VideoQualityTest::FillScalabilitySettings( 933 void VideoQualityTest::FillScalabilitySettings(
945 Params* params, 934 Params* params,
946 const std::vector<std::string>& stream_descriptors, 935 const std::vector<std::string>& stream_descriptors,
947 size_t selected_stream, 936 size_t selected_stream,
948 int num_spatial_layers, 937 int num_spatial_layers,
(...skipping 22 matching lines...) Expand all
971 if (v[5] != -1) 960 if (v[5] != -1)
972 stream.max_bitrate_bps = v[5]; 961 stream.max_bitrate_bps = v[5];
973 if (v.size() > 6 && v[6] != -1) 962 if (v.size() > 6 && v[6] != -1)
974 stream.max_qp = v[6]; 963 stream.max_qp = v[6];
975 if (v.size() > 7) { 964 if (v.size() > 7) {
976 stream.temporal_layer_thresholds_bps.clear(); 965 stream.temporal_layer_thresholds_bps.clear();
977 stream.temporal_layer_thresholds_bps.insert( 966 stream.temporal_layer_thresholds_bps.insert(
978 stream.temporal_layer_thresholds_bps.end(), v.begin() + 7, v.end()); 967 stream.temporal_layer_thresholds_bps.end(), v.begin() + 7, v.end());
979 } else { 968 } else {
980 // Automatic TL thresholds for more than two layers not supported. 969 // Automatic TL thresholds for more than two layers not supported.
981 RTC_CHECK_LE(params->video.num_temporal_layers, 2); 970 RTC_CHECK_LE(params->common.num_temporal_layers, 2);
982 } 971 }
983 params->ss.streams.push_back(stream); 972 params->ss.streams.push_back(stream);
984 } 973 }
985 params->ss.selected_stream = selected_stream; 974 params->ss.selected_stream = selected_stream;
986 975
987 params->ss.num_spatial_layers = num_spatial_layers ? num_spatial_layers : 1; 976 params->ss.num_spatial_layers = num_spatial_layers ? num_spatial_layers : 1;
988 params->ss.selected_sl = selected_sl; 977 params->ss.selected_sl = selected_sl;
989 RTC_CHECK(params->ss.spatial_layers.empty()); 978 RTC_CHECK(params->ss.spatial_layers.empty());
990 for (auto descriptor : sl_descriptors) { 979 for (auto descriptor : sl_descriptors) {
991 if (descriptor.empty()) 980 if (descriptor.empty())
(...skipping 11 matching lines...) Expand all
1003 992
1004 void VideoQualityTest::SetupCommon(Transport* send_transport, 993 void VideoQualityTest::SetupCommon(Transport* send_transport,
1005 Transport* recv_transport) { 994 Transport* recv_transport) {
1006 if (params_.logs) 995 if (params_.logs)
1007 trace_to_stderr_.reset(new test::TraceToStderr); 996 trace_to_stderr_.reset(new test::TraceToStderr);
1008 997
1009 size_t num_streams = params_.ss.streams.size(); 998 size_t num_streams = params_.ss.streams.size();
1010 CreateSendConfig(num_streams, 0, send_transport); 999 CreateSendConfig(num_streams, 0, send_transport);
1011 1000
1012 int payload_type; 1001 int payload_type;
1013 if (params_.video.codec == "H264") { 1002 if (params_.common.codec == "H264") {
1014 encoder_.reset(VideoEncoder::Create(VideoEncoder::kH264)); 1003 encoder_.reset(VideoEncoder::Create(VideoEncoder::kH264));
1015 payload_type = kPayloadTypeH264; 1004 payload_type = kPayloadTypeH264;
1016 } else if (params_.video.codec == "VP8") { 1005 } else if (params_.common.codec == "VP8") {
1017 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8)); 1006 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp8));
1018 payload_type = kPayloadTypeVP8; 1007 payload_type = kPayloadTypeVP8;
1019 } else if (params_.video.codec == "VP9") { 1008 } else if (params_.common.codec == "VP9") {
1020 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9)); 1009 encoder_.reset(VideoEncoder::Create(VideoEncoder::kVp9));
1021 payload_type = kPayloadTypeVP9; 1010 payload_type = kPayloadTypeVP9;
1022 } else { 1011 } else {
1023 RTC_NOTREACHED() << "Codec not supported!"; 1012 RTC_NOTREACHED() << "Codec not supported!";
1024 return; 1013 return;
1025 } 1014 }
1026 video_send_config_.encoder_settings.encoder = encoder_.get(); 1015 video_send_config_.encoder_settings.encoder = encoder_.get();
1027 video_send_config_.encoder_settings.payload_name = params_.video.codec; 1016 video_send_config_.encoder_settings.payload_name = params_.common.codec;
1028 video_send_config_.encoder_settings.payload_type = payload_type; 1017 video_send_config_.encoder_settings.payload_type = payload_type;
1029 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 1018 video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
1030 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; 1019 video_send_config_.rtp.rtx.payload_type = kSendRtxPayloadType;
1031 for (size_t i = 0; i < num_streams; ++i) 1020 for (size_t i = 0; i < num_streams; ++i)
1032 video_send_config_.rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[i]); 1021 video_send_config_.rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[i]);
1033 1022
1034 video_send_config_.rtp.extensions.clear(); 1023 video_send_config_.rtp.extensions.clear();
1035 if (params_.call.send_side_bwe) { 1024 if (params_.common.send_side_bwe) {
1036 video_send_config_.rtp.extensions.push_back( 1025 video_send_config_.rtp.extensions.push_back(
1037 RtpExtension(RtpExtension::kTransportSequenceNumberUri, 1026 RtpExtension(RtpExtension::kTransportSequenceNumberUri,
1038 test::kTransportSequenceNumberExtensionId)); 1027 test::kTransportSequenceNumberExtensionId));
1039 } else { 1028 } else {
1040 video_send_config_.rtp.extensions.push_back(RtpExtension( 1029 video_send_config_.rtp.extensions.push_back(RtpExtension(
1041 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId)); 1030 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId));
1042 } 1031 }
1043 1032
1044 video_encoder_config_.min_transmit_bitrate_bps = 1033 video_encoder_config_.min_transmit_bitrate_bps =
1045 params_.video.min_transmit_bps; 1034 params_.common.min_transmit_bps;
1046 1035
1047 video_encoder_config_.number_of_streams = params_.ss.streams.size(); 1036 video_encoder_config_.number_of_streams = params_.ss.streams.size();
1048 video_encoder_config_.max_bitrate_bps = 0; 1037 video_encoder_config_.max_bitrate_bps = 0;
1049 for (size_t i = 0; i < params_.ss.streams.size(); ++i) { 1038 for (size_t i = 0; i < params_.ss.streams.size(); ++i) {
1050 video_encoder_config_.max_bitrate_bps += 1039 video_encoder_config_.max_bitrate_bps +=
1051 params_.ss.streams[i].max_bitrate_bps; 1040 params_.ss.streams[i].max_bitrate_bps;
1052 } 1041 }
1053 video_encoder_config_.video_stream_factory = 1042 video_encoder_config_.video_stream_factory =
1054 new rtc::RefCountedObject<VideoStreamFactory>(params_.ss.streams); 1043 new rtc::RefCountedObject<VideoStreamFactory>(params_.ss.streams);
1055 1044
1056 video_encoder_config_.spatial_layers = params_.ss.spatial_layers; 1045 video_encoder_config_.spatial_layers = params_.ss.spatial_layers;
1057 1046
1058 CreateMatchingReceiveConfigs(recv_transport); 1047 CreateMatchingReceiveConfigs(recv_transport);
1059 1048
1060 for (size_t i = 0; i < num_streams; ++i) { 1049 for (size_t i = 0; i < num_streams; ++i) {
1061 video_receive_configs_[i].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 1050 video_receive_configs_[i].rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
1062 video_receive_configs_[i].rtp.rtx[payload_type].ssrc = kSendRtxSsrcs[i]; 1051 video_receive_configs_[i].rtp.rtx[payload_type].ssrc = kSendRtxSsrcs[i];
1063 video_receive_configs_[i].rtp.rtx[payload_type].payload_type = 1052 video_receive_configs_[i].rtp.rtx[payload_type].payload_type =
1064 kSendRtxPayloadType; 1053 kSendRtxPayloadType;
1065 video_receive_configs_[i].rtp.transport_cc = params_.call.send_side_bwe; 1054 video_receive_configs_[i].rtp.transport_cc = params_.common.send_side_bwe;
1066 } 1055 }
1067 } 1056 }
1068 1057
1069 void VideoQualityTest::SetupScreenshare() { 1058 void VideoQualityTest::SetupScreenshare() {
1070 RTC_CHECK(params_.screenshare.enabled); 1059 RTC_CHECK(params_.screenshare.enabled);
1071 1060
1072 // Fill out codec settings. 1061 // Fill out codec settings.
1073 video_encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen; 1062 video_encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen;
1074 if (params_.video.codec == "VP8") { 1063 if (params_.common.codec == "VP8") {
1075 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings(); 1064 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings();
1076 vp8_settings.denoisingOn = false; 1065 vp8_settings.denoisingOn = false;
1077 vp8_settings.frameDroppingOn = false; 1066 vp8_settings.frameDroppingOn = false;
1078 vp8_settings.numberOfTemporalLayers = 1067 vp8_settings.numberOfTemporalLayers =
1079 static_cast<unsigned char>(params_.video.num_temporal_layers); 1068 static_cast<unsigned char>(params_.common.num_temporal_layers);
1080 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject< 1069 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject<
1081 VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings); 1070 VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings);
1082 } else if (params_.video.codec == "VP9") { 1071 } else if (params_.common.codec == "VP9") {
1083 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings(); 1072 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
1084 vp9_settings.denoisingOn = false; 1073 vp9_settings.denoisingOn = false;
1085 vp9_settings.frameDroppingOn = false; 1074 vp9_settings.frameDroppingOn = false;
1086 vp9_settings.numberOfTemporalLayers = 1075 vp9_settings.numberOfTemporalLayers =
1087 static_cast<unsigned char>(params_.video.num_temporal_layers); 1076 static_cast<unsigned char>(params_.common.num_temporal_layers);
1088 vp9_settings.numberOfSpatialLayers = 1077 vp9_settings.numberOfSpatialLayers =
1089 static_cast<unsigned char>(params_.ss.num_spatial_layers); 1078 static_cast<unsigned char>(params_.ss.num_spatial_layers);
1090 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject< 1079 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject<
1091 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings); 1080 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
1092 } 1081 }
1093 1082
1094 // Setup frame generator. 1083 // Setup frame generator.
1095 const size_t kWidth = 1850; 1084 const size_t kWidth = 1850;
1096 const size_t kHeight = 1110; 1085 const size_t kHeight = 1110;
1097 std::vector<std::string> slides; 1086 std::vector<std::string> slides;
1098 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv")); 1087 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
1099 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv")); 1088 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
1100 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv")); 1089 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
1101 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv")); 1090 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv"));
1102 1091
1103 if (params_.screenshare.scroll_duration == 0) { 1092 if (params_.screenshare.scroll_duration == 0) {
1104 // Cycle image every slide_change_interval seconds. 1093 // Cycle image every slide_change_interval seconds.
1105 frame_generator_.reset(test::FrameGenerator::CreateFromYuvFile( 1094 frame_generator_.reset(test::FrameGenerator::CreateFromYuvFile(
1106 slides, kWidth, kHeight, 1095 slides, kWidth, kHeight,
1107 params_.screenshare.slide_change_interval * params_.video.fps)); 1096 params_.screenshare.slide_change_interval * params_.common.fps));
1108 } else { 1097 } else {
1109 RTC_CHECK_LE(params_.video.width, kWidth); 1098 RTC_CHECK_LE(params_.common.width, kWidth);
1110 RTC_CHECK_LE(params_.video.height, kHeight); 1099 RTC_CHECK_LE(params_.common.height, kHeight);
1111 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0); 1100 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0);
1112 const int kPauseDurationMs = (params_.screenshare.slide_change_interval - 1101 const int kPauseDurationMs = (params_.screenshare.slide_change_interval -
1113 params_.screenshare.scroll_duration) * 1102 params_.screenshare.scroll_duration) *
1114 1000; 1103 1000;
1115 RTC_CHECK_LE(params_.screenshare.scroll_duration, 1104 RTC_CHECK_LE(params_.screenshare.scroll_duration,
1116 params_.screenshare.slide_change_interval); 1105 params_.screenshare.slide_change_interval);
1117 1106
1118 frame_generator_.reset( 1107 frame_generator_.reset(
1119 test::FrameGenerator::CreateScrollingInputFromYuvFiles( 1108 test::FrameGenerator::CreateScrollingInputFromYuvFiles(
1120 clock_, slides, kWidth, kHeight, params_.video.width, 1109 clock_, slides, kWidth, kHeight, params_.common.width,
1121 params_.video.height, params_.screenshare.scroll_duration * 1000, 1110 params_.common.height, params_.screenshare.scroll_duration * 1000,
1122 kPauseDurationMs)); 1111 kPauseDurationMs));
1123 } 1112 }
1124 } 1113 }
1125 1114
1126 void VideoQualityTest::CreateCapturer() { 1115 void VideoQualityTest::CreateCapturer() {
1127 if (params_.screenshare.enabled) { 1116 if (params_.screenshare.enabled) {
1128 test::FrameGeneratorCapturer* frame_generator_capturer = 1117 test::FrameGeneratorCapturer* frame_generator_capturer =
1129 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(), 1118 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(),
1130 params_.video.fps); 1119 params_.common.fps);
1131 EXPECT_TRUE(frame_generator_capturer->Init()); 1120 EXPECT_TRUE(frame_generator_capturer->Init());
1132 capturer_.reset(frame_generator_capturer); 1121 capturer_.reset(frame_generator_capturer);
1133 } else { 1122 } else {
1134 if (params_.video.clip_name.empty()) { 1123 if (params_.video.clip_name.empty()) {
1135 capturer_.reset(test::VcmCapturer::Create( 1124 capturer_.reset(test::VcmCapturer::Create(
1136 params_.video.width, params_.video.height, params_.video.fps)); 1125 params_.common.width, params_.common.height, params_.common.fps));
1137 } else { 1126 } else {
1138 capturer_.reset(test::FrameGeneratorCapturer::CreateFromYuvFile( 1127 capturer_.reset(test::FrameGeneratorCapturer::CreateFromYuvFile(
1139 test::ResourcePath(params_.video.clip_name, "yuv"), 1128 test::ResourcePath(params_.video.clip_name, "yuv"),
1140 params_.video.width, params_.video.height, params_.video.fps, 1129 params_.common.width, params_.common.height, params_.common.fps,
1141 clock_)); 1130 clock_));
1142 ASSERT_TRUE(capturer_) << "Could not create capturer for " 1131 ASSERT_TRUE(capturer_) << "Could not create capturer for "
1143 << params_.video.clip_name 1132 << params_.video.clip_name
1144 << ".yuv. Is this resource file present?"; 1133 << ".yuv. Is this resource file present?";
1145 } 1134 }
1146 } 1135 }
1147 } 1136 }
1148 1137
1149 void VideoQualityTest::RunWithAnalyzer(const Params& params) { 1138 void VideoQualityTest::RunWithAnalyzer(const Params& params) {
1150 params_ = params; 1139 params_ = params;
1151 1140
1152 RTC_CHECK(!params_.audio.enabled); 1141 RTC_CHECK(!params_.audio);
1153 // TODO(ivica): Merge with RunWithRenderer and use a flag / argument to 1142 // TODO(ivica): Merge with RunWithRenderer and use a flag / argument to
1154 // differentiate between the analyzer and the renderer case. 1143 // differentiate between the analyzer and the renderer case.
1155 CheckParams(); 1144 CheckParams();
1156 1145
1157 FILE* graph_data_output_file = nullptr; 1146 FILE* graph_data_output_file = nullptr;
1158 if (!params_.analyzer.graph_data_output_filename.empty()) { 1147 if (!params_.analyzer.graph_data_output_filename.empty()) {
1159 graph_data_output_file = 1148 graph_data_output_file =
1160 fopen(params_.analyzer.graph_data_output_filename.c_str(), "w"); 1149 fopen(params_.analyzer.graph_data_output_filename.c_str(), "w");
1161 RTC_CHECK(graph_data_output_file) 1150 RTC_CHECK(graph_data_output_file)
1162 << "Can't open the file " << params_.analyzer.graph_data_output_filename 1151 << "Can't open the file " << params_.analyzer.graph_data_output_filename
1163 << "!"; 1152 << "!";
1164 } 1153 }
1165 1154
1166 webrtc::RtcEventLogNullImpl event_log; 1155 webrtc::RtcEventLogNullImpl event_log;
1167 Call::Config call_config(&event_log_); 1156 Call::Config call_config(&event_log_);
1168 call_config.bitrate_config = params.call.call_bitrate_config; 1157 call_config.bitrate_config = params.common.call_bitrate_config;
1169 CreateCalls(call_config, call_config); 1158 CreateCalls(call_config, call_config);
1170 1159
1171 test::LayerFilteringTransport send_transport( 1160 test::LayerFilteringTransport send_transport(
1172 params_.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9, 1161 params.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9,
1173 params_.video.selected_tl, params_.ss.selected_sl); 1162 params.common.selected_tl, params_.ss.selected_sl);
1174 test::DirectTransport recv_transport(params_.pipe, receiver_call_.get()); 1163 test::DirectTransport recv_transport(params.pipe, receiver_call_.get());
1175 1164
1176 std::string graph_title = params_.analyzer.graph_title; 1165 std::string graph_title = params_.analyzer.graph_title;
1177 if (graph_title.empty()) 1166 if (graph_title.empty())
1178 graph_title = VideoQualityTest::GenerateGraphTitle(); 1167 graph_title = VideoQualityTest::GenerateGraphTitle();
1179 1168
1180 // In the case of different resolutions, the functions calculating PSNR and 1169 // In the case of different resolutions, the functions calculating PSNR and
1181 // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer 1170 // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer
1182 // aborts if the average psnr/ssim are below the given threshold, which is 1171 // aborts if the average psnr/ssim are below the given threshold, which is
1183 // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary 1172 // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary
1184 // abort. 1173 // abort.
1185 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream]; 1174 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream];
1186 int selected_sl = params_.ss.selected_sl != -1 1175 int selected_sl = params_.ss.selected_sl != -1
1187 ? params_.ss.selected_sl 1176 ? params_.ss.selected_sl
1188 : params_.ss.num_spatial_layers - 1; 1177 : params_.ss.num_spatial_layers - 1;
1189 bool disable_quality_check = 1178 bool disable_quality_check =
1190 selected_stream.width != params_.video.width || 1179 selected_stream.width != params_.common.width ||
1191 selected_stream.height != params_.video.height || 1180 selected_stream.height != params_.common.height ||
1192 (!params_.ss.spatial_layers.empty() && 1181 (!params_.ss.spatial_layers.empty() &&
1193 params_.ss.spatial_layers[selected_sl].scaling_factor_num != 1182 params_.ss.spatial_layers[selected_sl].scaling_factor_num !=
1194 params_.ss.spatial_layers[selected_sl].scaling_factor_den); 1183 params_.ss.spatial_layers[selected_sl].scaling_factor_den);
1195 if (disable_quality_check) { 1184 if (disable_quality_check) {
1196 fprintf(stderr, 1185 fprintf(stderr,
1197 "Warning: Calculating PSNR and SSIM for downsized resolution " 1186 "Warning: Calculating PSNR and SSIM for downsized resolution "
1198 "not implemented yet! Skipping PSNR and SSIM calculations!"); 1187 "not implemented yet! Skipping PSNR and SSIM calculations!");
1199 } 1188 }
1200 1189
1201 VideoAnalyzer analyzer( 1190 VideoAnalyzer analyzer(
1202 &send_transport, params_.analyzer.test_label, 1191 &send_transport, params_.analyzer.test_label,
1203 disable_quality_check ? -1.1 : params_.analyzer.avg_psnr_threshold, 1192 disable_quality_check ? -1.1 : params_.analyzer.avg_psnr_threshold,
1204 disable_quality_check ? -1.1 : params_.analyzer.avg_ssim_threshold, 1193 disable_quality_check ? -1.1 : params_.analyzer.avg_ssim_threshold,
1205 params_.analyzer.test_durations_secs * params_.video.fps, 1194 params_.analyzer.test_durations_secs * params_.common.fps,
1206 graph_data_output_file, graph_title, 1195 graph_data_output_file, graph_title,
1207 kVideoSendSsrcs[params_.ss.selected_stream]); 1196 kVideoSendSsrcs[params_.ss.selected_stream]);
1208 1197
1209 analyzer.SetReceiver(receiver_call_->Receiver()); 1198 analyzer.SetReceiver(receiver_call_->Receiver());
1210 send_transport.SetReceiver(&analyzer); 1199 send_transport.SetReceiver(&analyzer);
1211 recv_transport.SetReceiver(sender_call_->Receiver()); 1200 recv_transport.SetReceiver(sender_call_->Receiver());
1212 1201
1213 SetupCommon(&analyzer, &recv_transport); 1202 SetupCommon(&analyzer, &recv_transport);
1214 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer; 1203 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer;
1215 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy(); 1204 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 1239
1251 if (graph_data_output_file) 1240 if (graph_data_output_file)
1252 fclose(graph_data_output_file); 1241 fclose(graph_data_output_file);
1253 } 1242 }
1254 1243
1255 void VideoQualityTest::RunWithRenderers(const Params& params) { 1244 void VideoQualityTest::RunWithRenderers(const Params& params) {
1256 params_ = params; 1245 params_ = params;
1257 CheckParams(); 1246 CheckParams();
1258 1247
1259 std::unique_ptr<test::VideoRenderer> local_preview( 1248 std::unique_ptr<test::VideoRenderer> local_preview(
1260 test::VideoRenderer::Create("Local Preview", params_.video.width, 1249 test::VideoRenderer::Create("Local Preview", params_.common.width,
1261 params_.video.height)); 1250 params_.common.height));
1262 size_t stream_id = params_.ss.selected_stream; 1251 size_t stream_id = params_.ss.selected_stream;
1263 std::string title = "Loopback Video"; 1252 std::string title = "Loopback Video";
1264 if (params_.ss.streams.size() > 1) { 1253 if (params_.ss.streams.size() > 1) {
1265 std::ostringstream s; 1254 std::ostringstream s;
1266 s << stream_id; 1255 s << stream_id;
1267 title += " - Stream #" + s.str(); 1256 title += " - Stream #" + s.str();
1268 } 1257 }
1269 1258
1270 std::unique_ptr<test::VideoRenderer> loopback_video( 1259 std::unique_ptr<test::VideoRenderer> loopback_video(
1271 test::VideoRenderer::Create(title.c_str(), 1260 test::VideoRenderer::Create(title.c_str(),
1272 params_.ss.streams[stream_id].width, 1261 params_.ss.streams[stream_id].width,
1273 params_.ss.streams[stream_id].height)); 1262 params_.ss.streams[stream_id].height));
1274 1263
1275 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to 1264 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to
1276 // match the full stack tests. 1265 // match the full stack tests.
1277 webrtc::RtcEventLogNullImpl event_log; 1266 webrtc::RtcEventLogNullImpl event_log;
1278 Call::Config call_config(&event_log_); 1267 Call::Config call_config(&event_log_);
1279 call_config.bitrate_config = params_.call.call_bitrate_config; 1268 call_config.bitrate_config = params_.common.call_bitrate_config;
1280 1269
1281 ::VoiceEngineState voe; 1270 ::VoiceEngineState voe;
1282 if (params_.audio.enabled) { 1271 if (params_.audio) {
1283 CreateVoiceEngine(&voe, decoder_factory_); 1272 CreateVoiceEngine(&voe, decoder_factory_);
1284 AudioState::Config audio_state_config; 1273 AudioState::Config audio_state_config;
1285 audio_state_config.voice_engine = voe.voice_engine; 1274 audio_state_config.voice_engine = voe.voice_engine;
1286 call_config.audio_state = AudioState::Create(audio_state_config); 1275 call_config.audio_state = AudioState::Create(audio_state_config);
1287 } 1276 }
1288 1277
1289 std::unique_ptr<Call> call(Call::Create(call_config)); 1278 std::unique_ptr<Call> call(Call::Create(call_config));
1290 1279
1291 test::LayerFilteringTransport transport( 1280 test::LayerFilteringTransport transport(
1292 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9, 1281 params.pipe, call.get(), kPayloadTypeVP8, kPayloadTypeVP9,
1293 params.video.selected_tl, params_.ss.selected_sl); 1282 params.common.selected_tl, params_.ss.selected_sl);
1294 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at 1283 // TODO(ivica): Use two calls to be able to merge with RunWithAnalyzer or at
1295 // least share as much code as possible. That way this test would also match 1284 // least share as much code as possible. That way this test would also match
1296 // the full stack tests better. 1285 // the full stack tests better.
1297 transport.SetReceiver(call->Receiver()); 1286 transport.SetReceiver(call->Receiver());
1298 1287
1299 SetupCommon(&transport, &transport); 1288 SetupCommon(&transport, &transport);
1300 1289
1301 video_send_config_.pre_encode_callback = local_preview.get(); 1290 video_send_config_.pre_encode_callback = local_preview.get();
1302 video_receive_configs_[stream_id].renderer = loopback_video.get(); 1291 video_receive_configs_[stream_id].renderer = loopback_video.get();
1303 if (params_.audio.enabled && params_.audio.sync_video) 1292 if (params_.audio && params_.audio_video_sync)
1304 video_receive_configs_[stream_id].sync_group = kSyncGroup; 1293 video_receive_configs_[stream_id].sync_group = kSyncGroup;
1305 1294
1306 video_send_config_.suspend_below_min_bitrate = 1295 video_send_config_.suspend_below_min_bitrate =
1307 params_.video.suspend_below_min_bitrate; 1296 params_.common.suspend_below_min_bitrate;
1308 1297
1309 if (params.video.fec) { 1298 if (params.common.fec) {
1310 video_send_config_.rtp.ulpfec.red_payload_type = kRedPayloadType; 1299 video_send_config_.rtp.ulpfec.red_payload_type = kRedPayloadType;
1311 video_send_config_.rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType; 1300 video_send_config_.rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
1312 video_receive_configs_[stream_id].rtp.ulpfec.red_payload_type = 1301 video_receive_configs_[stream_id].rtp.ulpfec.red_payload_type =
1313 kRedPayloadType; 1302 kRedPayloadType;
1314 video_receive_configs_[stream_id].rtp.ulpfec.ulpfec_payload_type = 1303 video_receive_configs_[stream_id].rtp.ulpfec.ulpfec_payload_type =
1315 kUlpfecPayloadType; 1304 kUlpfecPayloadType;
1316 } 1305 }
1317 1306
1318 if (params_.screenshare.enabled) 1307 if (params_.screenshare.enabled)
1319 SetupScreenshare(); 1308 SetupScreenshare();
1320 1309
1321 video_send_stream_ = call->CreateVideoSendStream( 1310 video_send_stream_ = call->CreateVideoSendStream(
1322 video_send_config_.Copy(), video_encoder_config_.Copy()); 1311 video_send_config_.Copy(), video_encoder_config_.Copy());
1323 VideoReceiveStream* video_receive_stream = 1312 VideoReceiveStream* video_receive_stream =
1324 call->CreateVideoReceiveStream(video_receive_configs_[stream_id].Copy()); 1313 call->CreateVideoReceiveStream(video_receive_configs_[stream_id].Copy());
1325 CreateCapturer(); 1314 CreateCapturer();
1326 video_send_stream_->SetSource(capturer_.get()); 1315 video_send_stream_->SetSource(capturer_.get());
1327 1316
1328 AudioReceiveStream* audio_receive_stream = nullptr; 1317 AudioReceiveStream* audio_receive_stream = nullptr;
1329 if (params_.audio.enabled) { 1318 if (params_.audio) {
1330 audio_send_config_ = AudioSendStream::Config(&transport); 1319 audio_send_config_ = AudioSendStream::Config(&transport);
1331 audio_send_config_.voe_channel_id = voe.send_channel_id; 1320 audio_send_config_.voe_channel_id = voe.send_channel_id;
1332 audio_send_config_.rtp.ssrc = kAudioSendSsrc; 1321 audio_send_config_.rtp.ssrc = kAudioSendSsrc;
1333 1322
1334 // Add extension to enable audio send side BWE, and allow audio bit rate 1323 // Add extension to enable audio send side BWE, and allow audio bit rate
1335 // adaptation. 1324 // adaptation.
1336 audio_send_config_.rtp.extensions.clear(); 1325 audio_send_config_.rtp.extensions.clear();
1337 if (params_.call.send_side_bwe) { 1326 if (params_.common.send_side_bwe) {
1338 audio_send_config_.rtp.extensions.push_back(webrtc::RtpExtension( 1327 audio_send_config_.rtp.extensions.push_back(webrtc::RtpExtension(
1339 webrtc::RtpExtension::kTransportSequenceNumberUri, 1328 webrtc::RtpExtension::kTransportSequenceNumberUri,
1340 test::kTransportSequenceNumberExtensionId)); 1329 test::kTransportSequenceNumberExtensionId));
1341 audio_send_config_.min_bitrate_kbps = kOpusMinBitrate / 1000; 1330 audio_send_config_.min_bitrate_kbps = kOpusMinBitrate / 1000;
1342 audio_send_config_.max_bitrate_kbps = kOpusBitrateFb / 1000; 1331 audio_send_config_.max_bitrate_kbps = kOpusBitrateFb / 1000;
1343 } 1332 }
1344 1333
1345 audio_send_stream_ = call->CreateAudioSendStream(audio_send_config_); 1334 audio_send_stream_ = call->CreateAudioSendStream(audio_send_config_);
1346 1335
1347 AudioReceiveStream::Config audio_config; 1336 AudioReceiveStream::Config audio_config;
1348 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc; 1337 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc;
1349 audio_config.rtcp_send_transport = &transport; 1338 audio_config.rtcp_send_transport = &transport;
1350 audio_config.voe_channel_id = voe.receive_channel_id; 1339 audio_config.voe_channel_id = voe.receive_channel_id;
1351 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; 1340 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc;
1352 audio_config.rtp.transport_cc = params_.call.send_side_bwe; 1341 audio_config.rtp.transport_cc = params_.common.send_side_bwe;
1353 audio_config.rtp.extensions = audio_send_config_.rtp.extensions; 1342 audio_config.rtp.extensions = audio_send_config_.rtp.extensions;
1354 audio_config.decoder_factory = decoder_factory_; 1343 audio_config.decoder_factory = decoder_factory_;
1355 if (params_.audio.sync_video) 1344 if (params_.audio_video_sync)
1356 audio_config.sync_group = kSyncGroup; 1345 audio_config.sync_group = kSyncGroup;
1357 1346
1358 audio_receive_stream = call->CreateAudioReceiveStream(audio_config); 1347 audio_receive_stream = call->CreateAudioReceiveStream(audio_config);
1359 1348
1360 const CodecInst kOpusInst = {120, "OPUS", 48000, 960, 2, 64000}; 1349 const CodecInst kOpusInst = {120, "OPUS", 48000, 960, 2, 64000};
1361 EXPECT_EQ(0, voe.codec->SetSendCodec(voe.send_channel_id, kOpusInst)); 1350 EXPECT_EQ(0, voe.codec->SetSendCodec(voe.send_channel_id, kOpusInst));
1362 } 1351 }
1363 1352
1364 StartEncodedFrameLogs(video_receive_stream); 1353 StartEncodedFrameLogs(video_receive_stream);
1365 StartEncodedFrameLogs(video_send_stream_); 1354 StartEncodedFrameLogs(video_send_stream_);
1366 1355
1367 // Start sending and receiving video. 1356 // Start sending and receiving video.
1368 video_receive_stream->Start(); 1357 video_receive_stream->Start();
1369 video_send_stream_->Start(); 1358 video_send_stream_->Start();
1370 capturer_->Start(); 1359 capturer_->Start();
1371 1360
1372 if (params_.audio.enabled) { 1361 if (params_.audio) {
1373 // Start receiving audio. 1362 // Start receiving audio.
1374 audio_receive_stream->Start(); 1363 audio_receive_stream->Start();
1375 EXPECT_EQ(0, voe.base->StartPlayout(voe.receive_channel_id)); 1364 EXPECT_EQ(0, voe.base->StartPlayout(voe.receive_channel_id));
1376 EXPECT_EQ(0, voe.base->StartReceive(voe.receive_channel_id)); 1365 EXPECT_EQ(0, voe.base->StartReceive(voe.receive_channel_id));
1377 1366
1378 // Start sending audio. 1367 // Start sending audio.
1379 audio_send_stream_->Start(); 1368 audio_send_stream_->Start();
1380 EXPECT_EQ(0, voe.base->StartSend(voe.send_channel_id)); 1369 EXPECT_EQ(0, voe.base->StartSend(voe.send_channel_id));
1381 } 1370 }
1382 1371
1383 test::PressEnterToContinue(); 1372 test::PressEnterToContinue();
1384 1373
1385 if (params_.audio.enabled) { 1374 if (params_.audio) {
1386 // Stop sending audio. 1375 // Stop sending audio.
1387 EXPECT_EQ(0, voe.base->StopSend(voe.send_channel_id)); 1376 EXPECT_EQ(0, voe.base->StopSend(voe.send_channel_id));
1388 audio_send_stream_->Stop(); 1377 audio_send_stream_->Stop();
1389 1378
1390 // Stop receiving audio. 1379 // Stop receiving audio.
1391 EXPECT_EQ(0, voe.base->StopReceive(voe.receive_channel_id)); 1380 EXPECT_EQ(0, voe.base->StopReceive(voe.receive_channel_id));
1392 EXPECT_EQ(0, voe.base->StopPlayout(voe.receive_channel_id)); 1381 EXPECT_EQ(0, voe.base->StopPlayout(voe.receive_channel_id));
1393 audio_receive_stream->Stop(); 1382 audio_receive_stream->Stop();
1394 } 1383 }
1395 1384
1396 // Stop receiving and sending video. 1385 // Stop receiving and sending video.
1397 capturer_->Stop(); 1386 capturer_->Stop();
1398 video_send_stream_->Stop(); 1387 video_send_stream_->Stop();
1399 video_receive_stream->Stop(); 1388 video_receive_stream->Stop();
1400 1389
1401 call->DestroyVideoReceiveStream(video_receive_stream); 1390 call->DestroyVideoReceiveStream(video_receive_stream);
1402 call->DestroyVideoSendStream(video_send_stream_); 1391 call->DestroyVideoSendStream(video_send_stream_);
1403 1392
1404 if (params_.audio.enabled) { 1393 if (params_.audio) {
1405 call->DestroyAudioSendStream(audio_send_stream_); 1394 call->DestroyAudioSendStream(audio_send_stream_);
1406 call->DestroyAudioReceiveStream(audio_receive_stream); 1395 call->DestroyAudioReceiveStream(audio_receive_stream);
1407 } 1396 }
1408 1397
1409 transport.StopSending(); 1398 transport.StopSending();
1410 if (params_.audio.enabled) 1399 if (params_.audio)
1411 DestroyVoiceEngine(&voe); 1400 DestroyVoiceEngine(&voe);
1412 } 1401 }
1413 1402
1414 void VideoQualityTest::StartEncodedFrameLogs(VideoSendStream* stream) { 1403 void VideoQualityTest::StartEncodedFrameLogs(VideoSendStream* stream) {
1415 if (!params_.video.encoded_frame_base_path.empty()) { 1404 if (!params_.common.encoded_frame_base_path.empty()) {
1416 std::ostringstream str; 1405 std::ostringstream str;
1417 str << send_logs_++; 1406 str << send_logs_++;
1418 std::string prefix = 1407 std::string prefix =
1419 params_.video.encoded_frame_base_path + "." + str.str() + ".send."; 1408 params_.common.encoded_frame_base_path + "." + str.str() + ".send.";
1420 stream->EnableEncodedFrameRecording( 1409 stream->EnableEncodedFrameRecording(
1421 std::vector<rtc::PlatformFile>( 1410 std::vector<rtc::PlatformFile>(
1422 {rtc::CreatePlatformFile(prefix + "1.ivf"), 1411 {rtc::CreatePlatformFile(prefix + "1.ivf"),
1423 rtc::CreatePlatformFile(prefix + "2.ivf"), 1412 rtc::CreatePlatformFile(prefix + "2.ivf"),
1424 rtc::CreatePlatformFile(prefix + "3.ivf")}), 1413 rtc::CreatePlatformFile(prefix + "3.ivf")}),
1425 10000000); 1414 10000000);
1426 } 1415 }
1427 } 1416 }
1428 void VideoQualityTest::StartEncodedFrameLogs(VideoReceiveStream* stream) { 1417 void VideoQualityTest::StartEncodedFrameLogs(VideoReceiveStream* stream) {
1429 if (!params_.video.encoded_frame_base_path.empty()) { 1418 if (!params_.common.encoded_frame_base_path.empty()) {
1430 std::ostringstream str; 1419 std::ostringstream str;
1431 str << receive_logs_++; 1420 str << receive_logs_++;
1432 std::string path = 1421 std::string path =
1433 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1422 params_.common.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1434 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1423 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1435 10000000); 1424 10000000);
1436 } 1425 }
1437 } 1426 }
1438 1427
1439 } // namespace webrtc 1428 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698