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 for (size_t i = 0; i < recv_codecs_.size(); ++i) { | 1245 sp.GetFidSsrc(ssrc, &config->rtp.rtx_ssrc); |
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 } | |
1255 | 1246 |
1256 config->rtp.extensions = recv_rtp_extensions_; | 1247 config->rtp.extensions = recv_rtp_extensions_; |
1257 } | 1248 } |
1258 | 1249 |
1259 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { | 1250 bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { |
1260 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; | 1251 LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; |
1261 if (ssrc == 0) { | 1252 if (ssrc == 0) { |
1262 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; | 1253 LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; |
1263 return false; | 1254 return false; |
1264 } | 1255 } |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2194 allocated_decoders_.push_back(allocated_decoder); | 2185 allocated_decoders_.push_back(allocated_decoder); |
2195 | 2186 |
2196 webrtc::VideoReceiveStream::Decoder decoder; | 2187 webrtc::VideoReceiveStream::Decoder decoder; |
2197 decoder.decoder = allocated_decoder.decoder; | 2188 decoder.decoder = allocated_decoder.decoder; |
2198 decoder.payload_type = recv_codecs[i].codec.id; | 2189 decoder.payload_type = recv_codecs[i].codec.id; |
2199 decoder.payload_name = recv_codecs[i].codec.name; | 2190 decoder.payload_name = recv_codecs[i].codec.name; |
2200 decoder.codec_params = recv_codecs[i].codec.params; | 2191 decoder.codec_params = recv_codecs[i].codec.params; |
2201 config_.decoders.push_back(decoder); | 2192 config_.decoders.push_back(decoder); |
2202 } | 2193 } |
2203 | 2194 |
2204 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs. | 2195 config_.rtp.rtx_payload_types.clear(); |
| 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 |
2205 config_.rtp.ulpfec = recv_codecs.front().ulpfec; | 2201 config_.rtp.ulpfec = recv_codecs.front().ulpfec; |
2206 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type; | 2202 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type; |
2207 | 2203 |
2208 config_.rtp.nack.rtp_history_ms = | 2204 config_.rtp.nack.rtp_history_ms = |
2209 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; | 2205 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; |
2210 } | 2206 } |
2211 | 2207 |
2212 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( | 2208 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( |
2213 uint32_t local_ssrc) { | 2209 uint32_t local_ssrc) { |
2214 // TODO(pbos): Consider turning this sanity check into a RTC_DCHECK. You | 2210 // 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... |
2516 rtx_mapping[video_codecs[i].codec.id] != | 2512 rtx_mapping[video_codecs[i].codec.id] != |
2517 ulpfec_config.red_payload_type) { | 2513 ulpfec_config.red_payload_type) { |
2518 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2514 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2519 } | 2515 } |
2520 } | 2516 } |
2521 | 2517 |
2522 return video_codecs; | 2518 return video_codecs; |
2523 } | 2519 } |
2524 | 2520 |
2525 } // namespace cricket | 2521 } // namespace cricket |
OLD | NEW |