OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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_send_stream.h" | 10 #include "webrtc/video/video_send_stream.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 rtp_rtcp->SetSendingMediaStatus(false); | 87 rtp_rtcp->SetSendingMediaStatus(false); |
88 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); | 88 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); |
89 modules.push_back(rtp_rtcp); | 89 modules.push_back(rtp_rtcp); |
90 } | 90 } |
91 return modules; | 91 return modules; |
92 } | 92 } |
93 | 93 |
94 // TODO(brandtr): Update this function when we support multistream protection. | 94 // TODO(brandtr): Update this function when we support multistream protection. |
95 std::unique_ptr<FlexfecSender> MaybeCreateFlexfecSender( | 95 std::unique_ptr<FlexfecSender> MaybeCreateFlexfecSender( |
96 const VideoSendStream::Config& config) { | 96 const VideoSendStream::Config& config) { |
97 if (config.rtp.flexfec.flexfec_payload_type < 0) { | 97 if (config.rtp.flexfec.payload_type < 0) { |
98 return nullptr; | 98 return nullptr; |
99 } | 99 } |
100 RTC_DCHECK_GE(config.rtp.flexfec.flexfec_payload_type, 0); | 100 RTC_DCHECK_GE(config.rtp.flexfec.payload_type, 0); |
101 RTC_DCHECK_LE(config.rtp.flexfec.flexfec_payload_type, 127); | 101 RTC_DCHECK_LE(config.rtp.flexfec.payload_type, 127); |
102 if (config.rtp.flexfec.flexfec_ssrc == 0) { | 102 if (config.rtp.flexfec.ssrc == 0) { |
103 LOG(LS_WARNING) << "FlexFEC is enabled, but no FlexFEC SSRC given. " | 103 LOG(LS_WARNING) << "FlexFEC is enabled, but no FlexFEC SSRC given. " |
104 "Therefore disabling FlexFEC."; | 104 "Therefore disabling FlexFEC."; |
105 return nullptr; | 105 return nullptr; |
106 } | 106 } |
107 if (config.rtp.flexfec.protected_media_ssrcs.empty()) { | 107 if (config.rtp.flexfec.protected_media_ssrcs.empty()) { |
108 LOG(LS_WARNING) << "FlexFEC is enabled, but no protected media SSRC given. " | 108 LOG(LS_WARNING) << "FlexFEC is enabled, but no protected media SSRC given. " |
109 "Therefore disabling FlexFEC."; | 109 "Therefore disabling FlexFEC."; |
110 return nullptr; | 110 return nullptr; |
111 } | 111 } |
112 | 112 |
113 if (config.rtp.ssrcs.size() > 1) { | 113 if (config.rtp.ssrcs.size() > 1) { |
114 LOG(LS_WARNING) << "Both FlexFEC and simulcast are enabled. This " | 114 LOG(LS_WARNING) << "Both FlexFEC and simulcast are enabled. This " |
115 "combination is however not supported by our current " | 115 "combination is however not supported by our current " |
116 "FlexFEC implementation. Therefore disabling FlexFEC."; | 116 "FlexFEC implementation. Therefore disabling FlexFEC."; |
117 return nullptr; | 117 return nullptr; |
118 } | 118 } |
119 | 119 |
120 if (config.rtp.flexfec.protected_media_ssrcs.size() > 1) { | 120 if (config.rtp.flexfec.protected_media_ssrcs.size() > 1) { |
121 LOG(LS_WARNING) | 121 LOG(LS_WARNING) |
122 << "The supplied FlexfecConfig contained multiple protected " | 122 << "The supplied FlexfecConfig contained multiple protected " |
123 "media streams, but our implementation currently only " | 123 "media streams, but our implementation currently only " |
124 "supports protecting a single media stream. " | 124 "supports protecting a single media stream. " |
125 "To avoid confusion, disabling FlexFEC completely."; | 125 "To avoid confusion, disabling FlexFEC completely."; |
126 return nullptr; | 126 return nullptr; |
127 } | 127 } |
128 | 128 |
129 RTC_DCHECK_EQ(1U, config.rtp.flexfec.protected_media_ssrcs.size()); | 129 RTC_DCHECK_EQ(1U, config.rtp.flexfec.protected_media_ssrcs.size()); |
130 return std::unique_ptr<FlexfecSender>(new FlexfecSender( | 130 return std::unique_ptr<FlexfecSender>(new FlexfecSender( |
131 config.rtp.flexfec.flexfec_payload_type, config.rtp.flexfec.flexfec_ssrc, | 131 config.rtp.flexfec.payload_type, config.rtp.flexfec.ssrc, |
132 config.rtp.flexfec.protected_media_ssrcs[0], config.rtp.extensions, | 132 config.rtp.flexfec.protected_media_ssrcs[0], config.rtp.extensions, |
133 Clock::GetRealTimeClock())); | 133 Clock::GetRealTimeClock())); |
134 } | 134 } |
135 | 135 |
136 } // namespace | 136 } // namespace |
137 | 137 |
138 std::string | 138 std::string |
139 VideoSendStream::Config::EncoderSettings::ToString() const { | 139 VideoSendStream::Config::EncoderSettings::ToString() const { |
140 std::stringstream ss; | 140 std::stringstream ss; |
141 ss << "{payload_name: " << payload_name; | 141 ss << "{payload_name: " << payload_name; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 ss << ", extensions: ["; | 177 ss << ", extensions: ["; |
178 for (size_t i = 0; i < extensions.size(); ++i) { | 178 for (size_t i = 0; i < extensions.size(); ++i) { |
179 ss << extensions[i].ToString(); | 179 ss << extensions[i].ToString(); |
180 if (i != extensions.size() - 1) | 180 if (i != extensions.size() - 1) |
181 ss << ", "; | 181 ss << ", "; |
182 } | 182 } |
183 ss << ']'; | 183 ss << ']'; |
184 | 184 |
185 ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}'; | 185 ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}'; |
186 ss << ", ulpfec: " << ulpfec.ToString(); | 186 ss << ", ulpfec: " << ulpfec.ToString(); |
187 ss << ", flexfec: " << flexfec.ToString(); | 187 |
| 188 ss << ", flexfec: {payload_type: " << flexfec.payload_type; |
| 189 ss << ", ssrc: " << flexfec.ssrc; |
| 190 ss << ", protected_media_ssrcs: ["; |
| 191 for (size_t i = 0; i < flexfec.protected_media_ssrcs.size(); ++i) { |
| 192 ss << flexfec.protected_media_ssrcs[i]; |
| 193 if (i != flexfec.protected_media_ssrcs.size() - 1) |
| 194 ss << ", "; |
| 195 } |
| 196 ss << ']'; |
| 197 |
188 ss << ", rtx: " << rtx.ToString(); | 198 ss << ", rtx: " << rtx.ToString(); |
189 ss << ", c_name: " << c_name; | 199 ss << ", c_name: " << c_name; |
190 ss << '}'; | 200 ss << '}'; |
191 return ss.str(); | 201 return ss.str(); |
192 } | 202 } |
193 | 203 |
194 std::string VideoSendStream::Config::ToString() const { | 204 std::string VideoSendStream::Config::ToString() const { |
195 std::stringstream ss; | 205 std::stringstream ss; |
196 ss << "{encoder_settings: " << encoder_settings.ToString(); | 206 ss << "{encoder_settings: " << encoder_settings.ToString(); |
197 ss << ", rtp: " << rtp.ToString(); | 207 ss << ", rtp: " << rtp.ToString(); |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 std::min(config_->rtp.max_packet_size, | 1308 std::min(config_->rtp.max_packet_size, |
1299 kPathMTU - transport_overhead_bytes_per_packet_); | 1309 kPathMTU - transport_overhead_bytes_per_packet_); |
1300 | 1310 |
1301 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1311 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
1302 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); | 1312 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); |
1303 } | 1313 } |
1304 } | 1314 } |
1305 | 1315 |
1306 } // namespace internal | 1316 } // namespace internal |
1307 } // namespace webrtc | 1317 } // namespace webrtc |
OLD | NEW |