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

Unified Diff: webrtc/video/video_quality_test.cc

Issue 2386573002: Releand of Let ViEEncoder handle resolution changes. (Closed)
Patch Set: Rebased Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_quality_test.cc
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index 41054db900345eb053dfaf92bf3458bc1473f419..4ac86d1a1521a929675cda583432086793951ff1 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -93,6 +93,23 @@ void DestroyVoiceEngine(VoiceEngineState* voe) {
voe->voice_engine = nullptr;
}
+class VideoStreamFactory
+ : public webrtc::VideoEncoderConfig::VideoStreamFactoryInterface {
+ public:
+ explicit VideoStreamFactory(const std::vector<webrtc::VideoStream>& streams)
+ : streams_(streams) {}
+
+ private:
+ std::vector<webrtc::VideoStream> CreateEncoderStreams(
+ int width,
+ int height,
+ const webrtc::VideoEncoderConfig& encoder_config) override {
+ return streams_;
+ }
+
+ std::vector<webrtc::VideoStream> streams_;
+};
+
} // namespace
namespace webrtc {
@@ -1014,7 +1031,16 @@ void VideoQualityTest::SetupCommon(Transport* send_transport,
video_encoder_config_.min_transmit_bitrate_bps =
params_.common.min_transmit_bps;
- video_encoder_config_.streams = params_.ss.streams;
+
+ video_encoder_config_.number_of_streams = params_.ss.streams.size();
+ video_encoder_config_.max_bitrate_bps = 0;
+ for (size_t i = 0; i < params_.ss.streams.size(); ++i) {
+ video_encoder_config_.max_bitrate_bps +=
+ params_.ss.streams[i].max_bitrate_bps;
+ }
+ video_encoder_config_.video_stream_factory =
+ new rtc::RefCountedObject<VideoStreamFactory>(params_.ss.streams);
+
video_encoder_config_.spatial_layers = params_.ss.spatial_layers;
CreateMatchingReceiveConfigs(recv_transport);
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698