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

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

Issue 2047513002: Add proper lifetime of encoder-specific settings. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 4 years, 4 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 <stdio.h> 10 #include <stdio.h>
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 video_receive_configs_[i].rtp.transport_cc = params_.common.send_side_bwe; 906 video_receive_configs_[i].rtp.transport_cc = params_.common.send_side_bwe;
907 } 907 }
908 } 908 }
909 909
910 void VideoQualityTest::SetupScreenshare() { 910 void VideoQualityTest::SetupScreenshare() {
911 RTC_CHECK(params_.screenshare.enabled); 911 RTC_CHECK(params_.screenshare.enabled);
912 912
913 // Fill out codec settings. 913 // Fill out codec settings.
914 video_encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen; 914 video_encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen;
915 if (params_.common.codec == "VP8") { 915 if (params_.common.codec == "VP8") {
916 codec_settings_.VP8 = VideoEncoder::GetDefaultVp8Settings(); 916 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings();
917 codec_settings_.VP8.denoisingOn = false; 917 vp8_settings.denoisingOn = false;
918 codec_settings_.VP8.frameDroppingOn = false; 918 vp8_settings.frameDroppingOn = false;
919 codec_settings_.VP8.numberOfTemporalLayers = 919 vp8_settings.numberOfTemporalLayers =
920 static_cast<unsigned char>(params_.common.num_temporal_layers); 920 static_cast<unsigned char>(params_.common.num_temporal_layers);
921 video_encoder_config_.encoder_specific_settings = &codec_settings_.VP8; 921 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject<
922 VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings);
922 } else if (params_.common.codec == "VP9") { 923 } else if (params_.common.codec == "VP9") {
923 codec_settings_.VP9 = VideoEncoder::GetDefaultVp9Settings(); 924 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
924 codec_settings_.VP9.denoisingOn = false; 925 vp9_settings.denoisingOn = false;
925 codec_settings_.VP9.frameDroppingOn = false; 926 vp9_settings.frameDroppingOn = false;
926 codec_settings_.VP9.numberOfTemporalLayers = 927 vp9_settings.numberOfTemporalLayers =
927 static_cast<unsigned char>(params_.common.num_temporal_layers); 928 static_cast<unsigned char>(params_.common.num_temporal_layers);
928 video_encoder_config_.encoder_specific_settings = &codec_settings_.VP9; 929 vp9_settings.numberOfSpatialLayers =
929 codec_settings_.VP9.numberOfSpatialLayers =
930 static_cast<unsigned char>(params_.ss.num_spatial_layers); 930 static_cast<unsigned char>(params_.ss.num_spatial_layers);
931 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject<
932 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
931 } 933 }
932 934
933 // Setup frame generator. 935 // Setup frame generator.
934 const size_t kWidth = 1850; 936 const size_t kWidth = 1850;
935 const size_t kHeight = 1110; 937 const size_t kHeight = 1110;
936 std::vector<std::string> slides; 938 std::vector<std::string> slides;
937 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv")); 939 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
938 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv")); 940 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
939 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv")); 941 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
940 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv")); 942 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv"));
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 video_send_stream_->Stop(); 1158 video_send_stream_->Stop();
1157 receive_stream->Stop(); 1159 receive_stream->Stop();
1158 1160
1159 call->DestroyVideoReceiveStream(receive_stream); 1161 call->DestroyVideoReceiveStream(receive_stream);
1160 call->DestroyVideoSendStream(video_send_stream_); 1162 call->DestroyVideoSendStream(video_send_stream_);
1161 1163
1162 transport.StopSending(); 1164 transport.StopSending();
1163 } 1165 }
1164 1166
1165 } // namespace webrtc 1167 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698