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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 | 1235 |
1236 // TODO(brandtr): Generalize when we add support for multistream protection. | 1236 // TODO(brandtr): Generalize when we add support for multistream protection. |
1237 if (sp.GetFecFrSsrc(ssrc, &flexfec_config->remote_ssrc)) { | 1237 if (sp.GetFecFrSsrc(ssrc, &flexfec_config->remote_ssrc)) { |
1238 flexfec_config->protected_media_ssrcs = {ssrc}; | 1238 flexfec_config->protected_media_ssrcs = {ssrc}; |
1239 flexfec_config->local_ssrc = config->rtp.local_ssrc; | 1239 flexfec_config->local_ssrc = config->rtp.local_ssrc; |
1240 flexfec_config->rtcp_mode = config->rtp.rtcp_mode; | 1240 flexfec_config->rtcp_mode = config->rtp.rtcp_mode; |
1241 flexfec_config->transport_cc = config->rtp.transport_cc; | 1241 flexfec_config->transport_cc = config->rtp.transport_cc; |
1242 flexfec_config->rtp_header_extensions = config->rtp.extensions; | 1242 flexfec_config->rtp_header_extensions = config->rtp.extensions; |
1243 } | 1243 } |
1244 | 1244 |
1245 sp.GetFidSsrc(ssrc, &config->rtp.rtx_ssrc); | 1245 for (size_t i = 0; i < recv_codecs_.size(); ++i) { |
| 1246 uint32_t rtx_ssrc; |
| 1247 if (recv_codecs_[i].rtx_payload_type != -1 && |
| 1248 sp.GetFidSsrc(ssrc, &rtx_ssrc)) { |
| 1249 webrtc::VideoReceiveStream::Config::Rtp::Rtx& rtx = |
| 1250 config->rtp.rtx[recv_codecs_[i].codec.id]; |
| 1251 rtx.ssrc = rtx_ssrc; |
| 1252 rtx.payload_type = recv_codecs_[i].rtx_payload_type; |
| 1253 } |
| 1254 } |
1246 | 1255 |
1247 config->rtp.extensions = recv_rtp_extensions_; | 1256 config->rtp.extensions = recv_rtp_extensions_; |
1248 } | 1257 } |
1249 | 1258 |
1250 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { | 1259 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { |
1251 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; | 1260 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; |
1252 if (ssrc == 0) { | 1261 if (ssrc == 0) { |
1253 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; | 1262 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; |
1254 return false; | 1263 return false; |
1255 } | 1264 } |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 allocated_decoders_.push_back(allocated_decoder); | 2194 allocated_decoders_.push_back(allocated_decoder); |
2186 | 2195 |
2187 webrtc::VideoReceiveStream::Decoder decoder; | 2196 webrtc::VideoReceiveStream::Decoder decoder; |
2188 decoder.decoder = allocated_decoder.decoder; | 2197 decoder.decoder = allocated_decoder.decoder; |
2189 decoder.payload_type = recv_codecs[i].codec.id; | 2198 decoder.payload_type = recv_codecs[i].codec.id; |
2190 decoder.payload_name = recv_codecs[i].codec.name; | 2199 decoder.payload_name = recv_codecs[i].codec.name; |
2191 decoder.codec_params = recv_codecs[i].codec.params; | 2200 decoder.codec_params = recv_codecs[i].codec.params; |
2192 config_.decoders.push_back(decoder); | 2201 config_.decoders.push_back(decoder); |
2193 } | 2202 } |
2194 | 2203 |
2195 config_.rtp.rtx_payload_types.clear(); | 2204 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs. |
2196 for (const VideoCodecSettings& recv_codec : recv_codecs) { | |
2197 config_.rtp.rtx_payload_types[recv_codec.codec.id] = | |
2198 recv_codec.rtx_payload_type; | |
2199 } | |
2200 | |
2201 config_.rtp.ulpfec = recv_codecs.front().ulpfec; | 2205 config_.rtp.ulpfec = recv_codecs.front().ulpfec; |
2202 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type; | 2206 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type; |
2203 | 2207 |
2204 config_.rtp.nack.rtp_history_ms = | 2208 config_.rtp.nack.rtp_history_ms = |
2205 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; | 2209 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; |
2206 } | 2210 } |
2207 | 2211 |
2208 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( | 2212 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( |
2209 uint32_t local_ssrc) { | 2213 uint32_t local_ssrc) { |
2210 // 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... |
2512 rtx_mapping[video_codecs[i].codec.id] != | 2516 rtx_mapping[video_codecs[i].codec.id] != |
2513 ulpfec_config.red_payload_type) { | 2517 ulpfec_config.red_payload_type) { |
2514 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]; |
2515 } | 2519 } |
2516 } | 2520 } |
2517 | 2521 |
2518 return video_codecs; | 2522 return video_codecs; |
2519 } | 2523 } |
2520 | 2524 |
2521 } // namespace cricket | 2525 } // namespace cricket |
OLD | NEW |