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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 voe->receive_channel_id = -1; | 86 voe->receive_channel_id = -1; |
87 voe->base->Release(); | 87 voe->base->Release(); |
88 voe->base = nullptr; | 88 voe->base = nullptr; |
89 voe->codec->Release(); | 89 voe->codec->Release(); |
90 voe->codec = nullptr; | 90 voe->codec = nullptr; |
91 | 91 |
92 webrtc::VoiceEngine::Delete(voe->voice_engine); | 92 webrtc::VoiceEngine::Delete(voe->voice_engine); |
93 voe->voice_engine = nullptr; | 93 voe->voice_engine = nullptr; |
94 } | 94 } |
95 | 95 |
| 96 class VideoStreamFactory |
| 97 : public webrtc::VideoEncoderConfig::VideoStreamFactoryInterface { |
| 98 public: |
| 99 explicit VideoStreamFactory(const std::vector<webrtc::VideoStream>& streams) |
| 100 : streams_(streams) {} |
| 101 |
| 102 private: |
| 103 std::vector<webrtc::VideoStream> CreateEncoderStreams( |
| 104 int width, |
| 105 int height, |
| 106 const webrtc::VideoEncoderConfig& encoder_config) override { |
| 107 return streams_; |
| 108 } |
| 109 |
| 110 std::vector<webrtc::VideoStream> streams_; |
| 111 }; |
| 112 |
96 } // namespace | 113 } // namespace |
97 | 114 |
98 namespace webrtc { | 115 namespace webrtc { |
99 | 116 |
100 class VideoAnalyzer : public PacketReceiver, | 117 class VideoAnalyzer : public PacketReceiver, |
101 public Transport, | 118 public Transport, |
102 public rtc::VideoSinkInterface<VideoFrame>, | 119 public rtc::VideoSinkInterface<VideoFrame>, |
103 public EncodedFrameObserver { | 120 public EncodedFrameObserver { |
104 public: | 121 public: |
105 VideoAnalyzer(test::LayerFilteringTransport* transport, | 122 VideoAnalyzer(test::LayerFilteringTransport* transport, |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 video_send_config_.rtp.extensions.push_back( | 1024 video_send_config_.rtp.extensions.push_back( |
1008 RtpExtension(RtpExtension::kTransportSequenceNumberUri, | 1025 RtpExtension(RtpExtension::kTransportSequenceNumberUri, |
1009 test::kTransportSequenceNumberExtensionId)); | 1026 test::kTransportSequenceNumberExtensionId)); |
1010 } else { | 1027 } else { |
1011 video_send_config_.rtp.extensions.push_back(RtpExtension( | 1028 video_send_config_.rtp.extensions.push_back(RtpExtension( |
1012 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId)); | 1029 RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId)); |
1013 } | 1030 } |
1014 | 1031 |
1015 video_encoder_config_.min_transmit_bitrate_bps = | 1032 video_encoder_config_.min_transmit_bitrate_bps = |
1016 params_.common.min_transmit_bps; | 1033 params_.common.min_transmit_bps; |
1017 video_encoder_config_.streams = params_.ss.streams; | 1034 |
| 1035 video_encoder_config_.number_of_streams = params_.ss.streams.size(); |
| 1036 video_encoder_config_.max_bitrate_bps = 0; |
| 1037 for (size_t i = 0; i < params_.ss.streams.size(); ++i) { |
| 1038 video_encoder_config_.max_bitrate_bps += |
| 1039 params_.ss.streams[i].max_bitrate_bps; |
| 1040 } |
| 1041 video_encoder_config_.video_stream_factory = |
| 1042 new rtc::RefCountedObject<VideoStreamFactory>(params_.ss.streams); |
| 1043 |
1018 video_encoder_config_.spatial_layers = params_.ss.spatial_layers; | 1044 video_encoder_config_.spatial_layers = params_.ss.spatial_layers; |
1019 | 1045 |
1020 CreateMatchingReceiveConfigs(recv_transport); | 1046 CreateMatchingReceiveConfigs(recv_transport); |
1021 | 1047 |
1022 for (size_t i = 0; i < num_streams; ++i) { | 1048 for (size_t i = 0; i < num_streams; ++i) { |
1023 video_receive_configs_[i].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; | 1049 video_receive_configs_[i].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; |
1024 video_receive_configs_[i].rtp.rtx[payload_type].ssrc = kSendRtxSsrcs[i]; | 1050 video_receive_configs_[i].rtp.rtx[payload_type].ssrc = kSendRtxSsrcs[i]; |
1025 video_receive_configs_[i].rtp.rtx[payload_type].payload_type = | 1051 video_receive_configs_[i].rtp.rtx[payload_type].payload_type = |
1026 kSendRtxPayloadType; | 1052 kSendRtxPayloadType; |
1027 video_receive_configs_[i].rtp.transport_cc = params_.common.send_side_bwe; | 1053 video_receive_configs_[i].rtp.transport_cc = params_.common.send_side_bwe; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 std::ostringstream str; | 1416 std::ostringstream str; |
1391 str << receive_logs_++; | 1417 str << receive_logs_++; |
1392 std::string path = | 1418 std::string path = |
1393 params_.common.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 1419 params_.common.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
1394 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 1420 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
1395 10000000); | 1421 10000000); |
1396 } | 1422 } |
1397 } | 1423 } |
1398 | 1424 |
1399 } // namespace webrtc | 1425 } // namespace webrtc |
OLD | NEW |