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 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 | 1226 |
1227 // TODO(brandtr): Generalize when we add support for multistream protection. | 1227 // TODO(brandtr): Generalize when we add support for multistream protection. |
1228 if (sp.GetFecFrSsrc(ssrc, &flexfec_config->remote_ssrc)) { | 1228 if (sp.GetFecFrSsrc(ssrc, &flexfec_config->remote_ssrc)) { |
1229 flexfec_config->protected_media_ssrcs = {ssrc}; | 1229 flexfec_config->protected_media_ssrcs = {ssrc}; |
1230 flexfec_config->local_ssrc = config->rtp.local_ssrc; | 1230 flexfec_config->local_ssrc = config->rtp.local_ssrc; |
1231 flexfec_config->rtcp_mode = config->rtp.rtcp_mode; | 1231 flexfec_config->rtcp_mode = config->rtp.rtcp_mode; |
1232 flexfec_config->transport_cc = config->rtp.transport_cc; | 1232 flexfec_config->transport_cc = config->rtp.transport_cc; |
1233 flexfec_config->rtp_header_extensions = config->rtp.extensions; | 1233 flexfec_config->rtp_header_extensions = config->rtp.extensions; |
1234 } | 1234 } |
1235 | 1235 |
1236 for (size_t i = 0; i < recv_codecs_.size(); ++i) { | 1236 sp.GetFidSsrc(ssrc, &config->rtp.rtx_ssrc); |
1237 uint32_t rtx_ssrc; | |
1238 if (recv_codecs_[i].rtx_payload_type != -1 && | |
1239 sp.GetFidSsrc(ssrc, &rtx_ssrc)) { | |
1240 webrtc::VideoReceiveStream::Config::Rtp::Rtx& rtx = | |
1241 config->rtp.rtx[recv_codecs_[i].codec.id]; | |
1242 rtx.ssrc = rtx_ssrc; | |
1243 rtx.payload_type = recv_codecs_[i].rtx_payload_type; | |
1244 } | |
1245 } | |
1246 | 1237 |
1247 config->rtp.extensions = recv_rtp_extensions_; | 1238 config->rtp.extensions = recv_rtp_extensions_; |
1248 } | 1239 } |
1249 | 1240 |
1250 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { | 1241 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { |
1251 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; | 1242 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; |
1252 if (ssrc == 0) { | 1243 if (ssrc == 0) { |
1253 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; | 1244 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; |
1254 return false; | 1245 return false; |
1255 } | 1246 } |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2198 allocated_decoders_.push_back(allocated_decoder); | 2189 allocated_decoders_.push_back(allocated_decoder); |
2199 | 2190 |
2200 webrtc::VideoReceiveStream::Decoder decoder; | 2191 webrtc::VideoReceiveStream::Decoder decoder; |
2201 decoder.decoder = allocated_decoder.decoder; | 2192 decoder.decoder = allocated_decoder.decoder; |
2202 decoder.payload_type = recv_codecs[i].codec.id; | 2193 decoder.payload_type = recv_codecs[i].codec.id; |
2203 decoder.payload_name = recv_codecs[i].codec.name; | 2194 decoder.payload_name = recv_codecs[i].codec.name; |
2204 decoder.codec_params = recv_codecs[i].codec.params; | 2195 decoder.codec_params = recv_codecs[i].codec.params; |
2205 config_.decoders.push_back(decoder); | 2196 config_.decoders.push_back(decoder); |
2206 } | 2197 } |
2207 | 2198 |
2208 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs. | 2199 config_.rtp.rtx_payload_types.clear(); |
| 2200 for (const VideoCodecSettings& recv_codec : recv_codecs) { |
| 2201 config_.rtp.rtx_payload_types[recv_codec.codec.id] = |
| 2202 recv_codec.rtx_payload_type; |
| 2203 } |
| 2204 |
2209 config_.rtp.ulpfec = recv_codecs.front().ulpfec; | 2205 config_.rtp.ulpfec = recv_codecs.front().ulpfec; |
2210 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type; | 2206 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type; |
2211 | 2207 |
2212 config_.rtp.nack.rtp_history_ms = | 2208 config_.rtp.nack.rtp_history_ms = |
2213 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; | 2209 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; |
2214 } | 2210 } |
2215 | 2211 |
2216 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( | 2212 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( |
2217 uint32_t local_ssrc) { | 2213 uint32_t local_ssrc) { |
2218 // TODO(pbos): Consider turning this sanity check into a RTC_DCHECK. You | 2214 // TODO(pbos): Consider turning this sanity check into a RTC_DCHECK. You |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2520 rtx_mapping[video_codecs[i].codec.id] != | 2516 rtx_mapping[video_codecs[i].codec.id] != |
2521 ulpfec_config.red_payload_type) { | 2517 ulpfec_config.red_payload_type) { |
2522 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2518 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2523 } | 2519 } |
2524 } | 2520 } |
2525 | 2521 |
2526 return video_codecs; | 2522 return video_codecs; |
2527 } | 2523 } |
2528 | 2524 |
2529 } // namespace cricket | 2525 } // namespace cricket |
OLD | NEW |