OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 | 10 |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1217 // "recv_params" to "receiver_params", we should get this out of | 1217 // "recv_params" to "receiver_params", we should get this out of |
1218 // receiver_params_. | 1218 // receiver_params_. |
1219 config->rtp.rtcp_mode = send_params_.rtcp.reduced_size | 1219 config->rtp.rtcp_mode = send_params_.rtcp.reduced_size |
1220 ? webrtc::RtcpMode::kReducedSize | 1220 ? webrtc::RtcpMode::kReducedSize |
1221 : webrtc::RtcpMode::kCompound; | 1221 : webrtc::RtcpMode::kCompound; |
1222 | 1222 |
1223 config->rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; | 1223 config->rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; |
1224 config->rtp.transport_cc = | 1224 config->rtp.transport_cc = |
1225 send_codec_ ? HasTransportCc(send_codec_->codec) : false; | 1225 send_codec_ ? HasTransportCc(send_codec_->codec) : false; |
1226 | 1226 |
1227 sp.GetFidSsrc(ssrc, &config->rtp.rtx_ssrc); | |
1228 | |
1229 config->rtp.extensions = recv_rtp_extensions_; | |
1230 | |
1227 // TODO(brandtr): Generalize when we add support for multistream protection. | 1231 // TODO(brandtr): Generalize when we add support for multistream protection. |
1228 if (sp.GetFecFrSsrc(ssrc, &flexfec_config->remote_ssrc)) { | 1232 if (sp.GetFecFrSsrc(ssrc, &flexfec_config->remote_ssrc)) { |
1229 flexfec_config->protected_media_ssrcs = {ssrc}; | 1233 flexfec_config->protected_media_ssrcs = {ssrc}; |
1230 flexfec_config->local_ssrc = config->rtp.local_ssrc; | 1234 flexfec_config->local_ssrc = config->rtp.local_ssrc; |
1231 flexfec_config->rtcp_mode = config->rtp.rtcp_mode; | 1235 flexfec_config->rtcp_mode = config->rtp.rtcp_mode; |
1236 // TODO(brandtr): We should be spec-compliant and set |transport_cc| here | |
1237 // based on the rtcp-fb for the FlexFEC codec, not the media codec. | |
1232 flexfec_config->transport_cc = config->rtp.transport_cc; | 1238 flexfec_config->transport_cc = config->rtp.transport_cc; |
1233 flexfec_config->rtp_header_extensions = config->rtp.extensions; | 1239 flexfec_config->rtp_header_extensions = config->rtp.extensions; |
brandtr
2017/02/01 10:11:40
Note how this assignment is affected by the move o
| |
1234 } | 1240 } |
1235 | |
1236 sp.GetFidSsrc(ssrc, &config->rtp.rtx_ssrc); | |
1237 | |
1238 config->rtp.extensions = recv_rtp_extensions_; | |
1239 } | 1241 } |
1240 | 1242 |
1241 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { | 1243 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { |
1242 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; | 1244 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; |
1243 if (ssrc == 0) { | 1245 if (ssrc == 0) { |
1244 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; | 1246 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; |
1245 return false; | 1247 return false; |
1246 } | 1248 } |
1247 | 1249 |
1248 rtc::CritScope stream_lock(&stream_crit_); | 1250 rtc::CritScope stream_lock(&stream_crit_); |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2243 << "Ignoring call to SetFeedbackParameters because parameters are " | 2245 << "Ignoring call to SetFeedbackParameters because parameters are " |
2244 "unchanged; nack=" | 2246 "unchanged; nack=" |
2245 << nack_enabled << ", remb=" << remb_enabled | 2247 << nack_enabled << ", remb=" << remb_enabled |
2246 << ", transport_cc=" << transport_cc_enabled; | 2248 << ", transport_cc=" << transport_cc_enabled; |
2247 return; | 2249 return; |
2248 } | 2250 } |
2249 config_.rtp.remb = remb_enabled; | 2251 config_.rtp.remb = remb_enabled; |
2250 config_.rtp.nack.rtp_history_ms = nack_history_ms; | 2252 config_.rtp.nack.rtp_history_ms = nack_history_ms; |
2251 config_.rtp.transport_cc = transport_cc_enabled; | 2253 config_.rtp.transport_cc = transport_cc_enabled; |
2252 config_.rtp.rtcp_mode = rtcp_mode; | 2254 config_.rtp.rtcp_mode = rtcp_mode; |
2253 flexfec_config_.rtcp_mode = rtcp_mode; | 2255 // TODO(brandtr): We should be spec-compliant and set |transport_cc| here |
2256 // based on the rtcp-fb for the FlexFEC codec, not the media codec. | |
2257 flexfec_config_.transport_cc = config_.rtp.transport_cc; | |
2258 flexfec_config_.rtcp_mode = config_.rtp.rtcp_mode; | |
2254 LOG(LS_INFO) | 2259 LOG(LS_INFO) |
2255 << "RecreateWebRtcStream (recv) because of SetFeedbackParameters; nack=" | 2260 << "RecreateWebRtcStream (recv) because of SetFeedbackParameters; nack=" |
2256 << nack_enabled << ", remb=" << remb_enabled | 2261 << nack_enabled << ", remb=" << remb_enabled |
2257 << ", transport_cc=" << transport_cc_enabled; | 2262 << ", transport_cc=" << transport_cc_enabled; |
2258 RecreateWebRtcStream(); | 2263 RecreateWebRtcStream(); |
2259 } | 2264 } |
2260 | 2265 |
2261 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRecvParameters( | 2266 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRecvParameters( |
2262 const ChangedRecvParameters& params) { | 2267 const ChangedRecvParameters& params) { |
2263 bool needs_recreation = false; | 2268 bool needs_recreation = false; |
2264 std::vector<AllocatedDecoder> old_decoders; | 2269 std::vector<AllocatedDecoder> old_decoders; |
2265 if (params.codec_settings) { | 2270 if (params.codec_settings) { |
2266 ConfigureCodecs(*params.codec_settings, &old_decoders); | 2271 ConfigureCodecs(*params.codec_settings, &old_decoders); |
2267 needs_recreation = true; | 2272 needs_recreation = true; |
2268 } | 2273 } |
2269 if (params.rtp_header_extensions) { | 2274 if (params.rtp_header_extensions) { |
2270 config_.rtp.extensions = *params.rtp_header_extensions; | 2275 config_.rtp.extensions = *params.rtp_header_extensions; |
2276 flexfec_config_.rtp_header_extensions = *params.rtp_header_extensions; | |
2271 needs_recreation = true; | 2277 needs_recreation = true; |
2272 } | 2278 } |
2273 if (needs_recreation) { | 2279 if (needs_recreation) { |
2274 LOG(LS_INFO) << "RecreateWebRtcStream (recv) because of SetRecvParameters"; | 2280 LOG(LS_INFO) << "RecreateWebRtcStream (recv) because of SetRecvParameters"; |
2275 RecreateWebRtcStream(); | 2281 RecreateWebRtcStream(); |
2276 ClearDecoders(&old_decoders); | 2282 ClearDecoders(&old_decoders); |
2277 } | 2283 } |
2278 } | 2284 } |
2279 | 2285 |
2280 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { | 2286 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2517 rtx_mapping[video_codecs[i].codec.id] != | 2523 rtx_mapping[video_codecs[i].codec.id] != |
2518 ulpfec_config.red_payload_type) { | 2524 ulpfec_config.red_payload_type) { |
2519 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2525 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2520 } | 2526 } |
2521 } | 2527 } |
2522 | 2528 |
2523 return video_codecs; | 2529 return video_codecs; |
2524 } | 2530 } |
2525 | 2531 |
2526 } // namespace cricket | 2532 } // namespace cricket |
OLD | NEW |