Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2646073004: Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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)) {
brandtr 2017/01/20 14:49:22 Since |ssrc| is invariant in this loop, sp.GetFidS
1249 webrtc::VideoReceiveStream::Config::Rtp::Rtx& rtx =
1250 config->rtp.rtx[recv_codecs_[i].codec.id];
1251 rtx.ssrc = rtx_ssrc;
brandtr 2017/01/20 14:49:22 ... and therefore all key-value pairs in |rtx| hav
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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 allocated_decoders_.push_back(allocated_decoder); 2182 allocated_decoders_.push_back(allocated_decoder);
2192 2183
2193 webrtc::VideoReceiveStream::Decoder decoder; 2184 webrtc::VideoReceiveStream::Decoder decoder;
2194 decoder.decoder = allocated_decoder.decoder; 2185 decoder.decoder = allocated_decoder.decoder;
2195 decoder.payload_type = recv_codecs[i].codec.id; 2186 decoder.payload_type = recv_codecs[i].codec.id;
2196 decoder.payload_name = recv_codecs[i].codec.name; 2187 decoder.payload_name = recv_codecs[i].codec.name;
2197 decoder.codec_params = recv_codecs[i].codec.params; 2188 decoder.codec_params = recv_codecs[i].codec.params;
2198 config_.decoders.push_back(decoder); 2189 config_.decoders.push_back(decoder);
2199 } 2190 }
2200 2191
2201 // TODO(pbos): Reconfigure RTX based on incoming recv_codecs. 2192 config_.rtp.rtx_payload_types.clear();
2193 for (const VideoCodecSettings& recv_codec : recv_codecs) {
2194 config_.rtp.rtx_payload_types[recv_codec.codec.id] =
2195 recv_codec.rtx_payload_type;
2196 }
2197
2202 config_.rtp.ulpfec = recv_codecs.front().ulpfec; 2198 config_.rtp.ulpfec = recv_codecs.front().ulpfec;
2203 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type; 2199 flexfec_config_.payload_type = recv_codecs.front().flexfec_payload_type;
2204 2200
2205 config_.rtp.nack.rtp_history_ms = 2201 config_.rtp.nack.rtp_history_ms =
2206 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; 2202 HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0;
2207 } 2203 }
2208 2204
2209 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( 2205 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc(
2210 uint32_t local_ssrc) { 2206 uint32_t local_ssrc) {
2211 // TODO(pbos): Consider turning this sanity check into a RTC_DCHECK. You 2207 // TODO(pbos): Consider turning this sanity check into a RTC_DCHECK. You
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 rtx_mapping[video_codecs[i].codec.id] != 2506 rtx_mapping[video_codecs[i].codec.id] !=
2511 ulpfec_config.red_payload_type) { 2507 ulpfec_config.red_payload_type) {
2512 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2508 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2513 } 2509 }
2514 } 2510 }
2515 2511
2516 return video_codecs; 2512 return video_codecs;
2517 } 2513 }
2518 2514
2519 } // namespace cricket 2515 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698