| 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 11 matching lines...) Expand all Loading... |
| 22 #include "webrtc/base/cpu_time.h" | 22 #include "webrtc/base/cpu_time.h" |
| 23 #include "webrtc/base/event.h" | 23 #include "webrtc/base/event.h" |
| 24 #include "webrtc/base/format_macros.h" | 24 #include "webrtc/base/format_macros.h" |
| 25 #include "webrtc/base/memory_usage.h" | 25 #include "webrtc/base/memory_usage.h" |
| 26 #include "webrtc/base/optional.h" | 26 #include "webrtc/base/optional.h" |
| 27 #include "webrtc/base/platform_file.h" | 27 #include "webrtc/base/platform_file.h" |
| 28 #include "webrtc/base/timeutils.h" | 28 #include "webrtc/base/timeutils.h" |
| 29 #include "webrtc/call/call.h" | 29 #include "webrtc/call/call.h" |
| 30 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 30 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 31 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 31 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
| 32 #include "webrtc/media/engine/webrtcvideoengine.h" |
| 32 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" | 33 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" |
| 33 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 34 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| 34 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" | 35 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" |
| 35 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 36 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 36 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" | 37 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
| 37 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" | 38 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
| 38 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" | 39 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" |
| 39 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" | 40 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
| 40 #include "webrtc/system_wrappers/include/cpu_info.h" | 41 #include "webrtc/system_wrappers/include/cpu_info.h" |
| 41 #include "webrtc/system_wrappers/include/field_trial.h" | 42 #include "webrtc/system_wrappers/include/field_trial.h" |
| (...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 | 1164 |
| 1164 // Static. | 1165 // Static. |
| 1165 VideoStream VideoQualityTest::DefaultVideoStream(const Params& params) { | 1166 VideoStream VideoQualityTest::DefaultVideoStream(const Params& params) { |
| 1166 VideoStream stream; | 1167 VideoStream stream; |
| 1167 stream.width = params.video.width; | 1168 stream.width = params.video.width; |
| 1168 stream.height = params.video.height; | 1169 stream.height = params.video.height; |
| 1169 stream.max_framerate = params.video.fps; | 1170 stream.max_framerate = params.video.fps; |
| 1170 stream.min_bitrate_bps = params.video.min_bitrate_bps; | 1171 stream.min_bitrate_bps = params.video.min_bitrate_bps; |
| 1171 stream.target_bitrate_bps = params.video.target_bitrate_bps; | 1172 stream.target_bitrate_bps = params.video.target_bitrate_bps; |
| 1172 stream.max_bitrate_bps = params.video.max_bitrate_bps; | 1173 stream.max_bitrate_bps = params.video.max_bitrate_bps; |
| 1173 stream.max_qp = 52; | 1174 stream.max_qp = cricket::WebRtcVideoChannel::kDefaultQpMax; |
| 1174 // TODO(sprang): Can we make this less of a hack? | 1175 // TODO(sprang): Can we make this less of a hack? |
| 1175 if (params.video.num_temporal_layers == 2) { | 1176 if (params.video.num_temporal_layers == 2) { |
| 1176 stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps); | 1177 stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps); |
| 1177 } else if (params.video.num_temporal_layers == 3) { | 1178 } else if (params.video.num_temporal_layers == 3) { |
| 1178 stream.temporal_layer_thresholds_bps.push_back(stream.max_bitrate_bps / 4); | 1179 stream.temporal_layer_thresholds_bps.push_back(stream.max_bitrate_bps / 4); |
| 1179 stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps); | 1180 stream.temporal_layer_thresholds_bps.push_back(stream.target_bitrate_bps); |
| 1180 } | 1181 } |
| 1181 return stream; | 1182 return stream; |
| 1182 } | 1183 } |
| 1183 | 1184 |
| 1184 // Static. | 1185 // Static. |
| 1185 VideoStream VideoQualityTest::DefaultThumbnailStream() { | 1186 VideoStream VideoQualityTest::DefaultThumbnailStream() { |
| 1186 VideoStream stream; | 1187 VideoStream stream; |
| 1187 stream.width = 320; | 1188 stream.width = 320; |
| 1188 stream.height = 180; | 1189 stream.height = 180; |
| 1189 stream.max_framerate = 7; | 1190 stream.max_framerate = 7; |
| 1190 stream.min_bitrate_bps = 7500; | 1191 stream.min_bitrate_bps = 7500; |
| 1191 stream.target_bitrate_bps = 37500; | 1192 stream.target_bitrate_bps = 37500; |
| 1192 stream.max_bitrate_bps = 50000; | 1193 stream.max_bitrate_bps = 50000; |
| 1193 stream.max_qp = 52; | 1194 stream.max_qp = cricket::WebRtcVideoChannel::kDefaultQpMax; |
| 1194 return stream; | 1195 return stream; |
| 1195 } | 1196 } |
| 1196 | 1197 |
| 1197 // Static. | 1198 // Static. |
| 1198 void VideoQualityTest::FillScalabilitySettings( | 1199 void VideoQualityTest::FillScalabilitySettings( |
| 1199 Params* params, | 1200 Params* params, |
| 1200 const std::vector<std::string>& stream_descriptors, | 1201 const std::vector<std::string>& stream_descriptors, |
| 1201 size_t selected_stream, | 1202 size_t selected_stream, |
| 1202 int num_spatial_layers, | 1203 int num_spatial_layers, |
| 1203 int selected_sl, | 1204 int selected_sl, |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1909 if (!params_.video.encoded_frame_base_path.empty()) { | 1910 if (!params_.video.encoded_frame_base_path.empty()) { |
| 1910 std::ostringstream str; | 1911 std::ostringstream str; |
| 1911 str << receive_logs_++; | 1912 str << receive_logs_++; |
| 1912 std::string path = | 1913 std::string path = |
| 1913 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 1914 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
| 1914 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 1915 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
| 1915 10000000); | 1916 10000000); |
| 1916 } | 1917 } |
| 1917 } | 1918 } |
| 1918 } // namespace webrtc | 1919 } // namespace webrtc |
| OLD | NEW |