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

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

Issue 3003193002: Add a new frame generator that cycles through randomly generated slides. (Closed)
Patch Set: Patchset 3C. Created 3 years, 3 months 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
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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 payload_type_map_[kPayloadTypeH264] = webrtc::MediaType::VIDEO; 1166 payload_type_map_[kPayloadTypeH264] = webrtc::MediaType::VIDEO;
1167 payload_type_map_[kPayloadTypeVP8] = webrtc::MediaType::VIDEO; 1167 payload_type_map_[kPayloadTypeVP8] = webrtc::MediaType::VIDEO;
1168 payload_type_map_[kPayloadTypeVP9] = webrtc::MediaType::VIDEO; 1168 payload_type_map_[kPayloadTypeVP9] = webrtc::MediaType::VIDEO;
1169 } 1169 }
1170 1170
1171 VideoQualityTest::Params::Params() 1171 VideoQualityTest::Params::Params()
1172 : call({false, Call::Config::BitrateConfig(), 0}), 1172 : call({false, Call::Config::BitrateConfig(), 0}),
1173 video({false, 640, 480, 30, 50, 800, 800, false, "VP8", 1, -1, 0, false, 1173 video({false, 640, 480, 30, 50, 800, 800, false, "VP8", 1, -1, 0, false,
1174 false, ""}), 1174 false, ""}),
1175 audio({false, false, false}), 1175 audio({false, false, false}),
1176 screenshare({false, 10, 0}), 1176 screenshare({false, false, 10, 0}),
1177 analyzer({"", 0.0, 0.0, 0, "", ""}), 1177 analyzer({"", 0.0, 0.0, 0, "", ""}),
1178 pipe(), 1178 pipe(),
1179 ss({std::vector<VideoStream>(), 0, 0, -1, std::vector<SpatialLayer>()}), 1179 ss({std::vector<VideoStream>(), 0, 0, -1, std::vector<SpatialLayer>()}),
1180 logging({false, "", "", ""}) {} 1180 logging({false, "", "", ""}) {}
1181 1181
1182 VideoQualityTest::Params::~Params() = default; 1182 VideoQualityTest::Params::~Params() = default;
1183 1183
1184 void VideoQualityTest::TestBody() {} 1184 void VideoQualityTest::TestBody() {}
1185 1185
1186 std::string VideoQualityTest::GenerateGraphTitle() const { 1186 std::string VideoQualityTest::GenerateGraphTitle() const {
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 static_cast<unsigned char>(params_.video.num_temporal_layers); 1677 static_cast<unsigned char>(params_.video.num_temporal_layers);
1678 vp9_settings.numberOfSpatialLayers = 1678 vp9_settings.numberOfSpatialLayers =
1679 static_cast<unsigned char>(params_.ss.num_spatial_layers); 1679 static_cast<unsigned char>(params_.ss.num_spatial_layers);
1680 video_encoder_config_.encoder_specific_settings = 1680 video_encoder_config_.encoder_specific_settings =
1681 new rtc::RefCountedObject< 1681 new rtc::RefCountedObject<
1682 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings); 1682 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
1683 } 1683 }
1684 // Setup frame generator. 1684 // Setup frame generator.
1685 const size_t kWidth = 1850; 1685 const size_t kWidth = 1850;
1686 const size_t kHeight = 1110; 1686 const size_t kHeight = 1110;
1687 std::vector<std::string> slides = params_.screenshare.slides; 1687 if (params_.screenshare.generate_slides) {
1688 if (slides.size() == 0) { 1688 frame_generator_ = test::FrameGenerator::CreateSlideGenerator(
1689 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv")); 1689 kWidth, kHeight,
1690 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
1691 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
1692 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv"));
1693 }
1694 if (params_.screenshare.scroll_duration == 0) {
1695 // Cycle image every slide_change_interval seconds.
1696 frame_generator_ = test::FrameGenerator::CreateFromYuvFile(
1697 slides, kWidth, kHeight,
1698 params_.screenshare.slide_change_interval * params_.video.fps); 1690 params_.screenshare.slide_change_interval * params_.video.fps);
1699 } else { 1691 } else {
1700 RTC_CHECK_LE(params_.video.width, kWidth); 1692 std::vector<std::string> slides = params_.screenshare.slides;
1701 RTC_CHECK_LE(params_.video.height, kHeight); 1693 if (slides.size() == 0) {
1702 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0); 1694 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
1703 const int kPauseDurationMs = (params_.screenshare.slide_change_interval - 1695 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
1704 params_.screenshare.scroll_duration) * 1696 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
1705 1000; 1697 slides.push_back(
1706 RTC_CHECK_LE(params_.screenshare.scroll_duration, 1698 test::ResourcePath("difficult_photo_1850_1110", "yuv"));
1707 params_.screenshare.slide_change_interval); 1699 }
1700 if (params_.screenshare.scroll_duration == 0) {
1701 // Cycle image every slide_change_interval seconds.
1702 frame_generator_ = test::FrameGenerator::CreateFromYuvFile(
1703 slides, kWidth, kHeight,
1704 params_.screenshare.slide_change_interval * params_.video.fps);
1705 } else {
1706 RTC_CHECK_LE(params_.video.width, kWidth);
1707 RTC_CHECK_LE(params_.video.height, kHeight);
1708 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0);
1709 const int kPauseDurationMs =
1710 (params_.screenshare.slide_change_interval -
1711 params_.screenshare.scroll_duration) *
1712 1000;
1713 RTC_CHECK_LE(params_.screenshare.scroll_duration,
1714 params_.screenshare.slide_change_interval);
1708 1715
1709 frame_generator_ = test::FrameGenerator::CreateScrollingInputFromYuvFiles( 1716 frame_generator_ =
1710 clock_, slides, kWidth, kHeight, params_.video.width, 1717 test::FrameGenerator::CreateScrollingInputFromYuvFiles(
1711 params_.video.height, params_.screenshare.scroll_duration * 1000, 1718 clock_, slides, kWidth, kHeight, params_.video.width,
1712 kPauseDurationMs); 1719 params_.video.height,
1720 params_.screenshare.scroll_duration * 1000, kPauseDurationMs);
1721 }
1713 } 1722 }
1714 } else if (params_.ss.num_spatial_layers > 1) { // For non-screenshare case. 1723 } else if (params_.ss.num_spatial_layers > 1) { // For non-screenshare case.
1715 RTC_CHECK(params_.video.codec == "VP9"); 1724 RTC_CHECK(params_.video.codec == "VP9");
1716 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings(); 1725 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
1717 vp9_settings.numberOfTemporalLayers = 1726 vp9_settings.numberOfTemporalLayers =
1718 static_cast<unsigned char>(params_.video.num_temporal_layers); 1727 static_cast<unsigned char>(params_.video.num_temporal_layers);
1719 vp9_settings.numberOfSpatialLayers = 1728 vp9_settings.numberOfSpatialLayers =
1720 static_cast<unsigned char>(params_.ss.num_spatial_layers); 1729 static_cast<unsigned char>(params_.ss.num_spatial_layers);
1721 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject< 1730 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject<
1722 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings); 1731 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 if (!params_.logging.encoded_frame_base_path.empty()) { 2136 if (!params_.logging.encoded_frame_base_path.empty()) {
2128 std::ostringstream str; 2137 std::ostringstream str;
2129 str << receive_logs_++; 2138 str << receive_logs_++;
2130 std::string path = 2139 std::string path =
2131 params_.logging.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 2140 params_.logging.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
2132 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 2141 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
2133 100000000); 2142 100000000);
2134 } 2143 }
2135 } 2144 }
2136 } // namespace webrtc 2145 } // namespace webrtc
OLDNEW
« webrtc/test/frame_generator_capturer.cc ('K') | « webrtc/video/video_quality_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698