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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 // Set up A/V sync group based on sync label. | 1210 // Set up A/V sync group based on sync label. |
1211 config.sync_group = sp.sync_label; | 1211 config.sync_group = sp.sync_label; |
1212 | 1212 |
1213 config.rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; | 1213 config.rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; |
1214 config.rtp.transport_cc = | 1214 config.rtp.transport_cc = |
1215 send_codec_ ? HasTransportCc(send_codec_->codec) : false; | 1215 send_codec_ ? HasTransportCc(send_codec_->codec) : false; |
1216 config.disable_prerenderer_smoothing = | 1216 config.disable_prerenderer_smoothing = |
1217 video_config_.disable_prerenderer_smoothing; | 1217 video_config_.disable_prerenderer_smoothing; |
1218 | 1218 |
1219 receive_streams_[ssrc] = new WebRtcVideoReceiveStream( | 1219 receive_streams_[ssrc] = new WebRtcVideoReceiveStream( |
1220 call_, sp, config, external_decoder_factory_, default_stream, | 1220 call_, sp, std::move(config), external_decoder_factory_, default_stream, |
1221 recv_codecs_, red_disabled_by_remote_side_); | 1221 recv_codecs_, red_disabled_by_remote_side_); |
1222 | 1222 |
1223 return true; | 1223 return true; |
1224 } | 1224 } |
1225 | 1225 |
1226 void WebRtcVideoChannel2::ConfigureReceiverRtp( | 1226 void WebRtcVideoChannel2::ConfigureReceiverRtp( |
1227 webrtc::VideoReceiveStream::Config* config, | 1227 webrtc::VideoReceiveStream::Config* config, |
1228 const StreamParams& sp) const { | 1228 const StreamParams& sp) const { |
1229 uint32_t ssrc = sp.first_ssrc(); | 1229 uint32_t ssrc = sp.first_ssrc(); |
1230 | 1230 |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 pending_encoder_reconfiguration_ = false; | 2204 pending_encoder_reconfiguration_ = false; |
2205 | 2205 |
2206 if (sending_) { | 2206 if (sending_) { |
2207 stream_->Start(); | 2207 stream_->Start(); |
2208 } | 2208 } |
2209 } | 2209 } |
2210 | 2210 |
2211 WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( | 2211 WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( |
2212 webrtc::Call* call, | 2212 webrtc::Call* call, |
2213 const StreamParams& sp, | 2213 const StreamParams& sp, |
2214 const webrtc::VideoReceiveStream::Config& config, | 2214 webrtc::VideoReceiveStream::Config config, |
2215 WebRtcVideoDecoderFactory* external_decoder_factory, | 2215 WebRtcVideoDecoderFactory* external_decoder_factory, |
2216 bool default_stream, | 2216 bool default_stream, |
2217 const std::vector<VideoCodecSettings>& recv_codecs, | 2217 const std::vector<VideoCodecSettings>& recv_codecs, |
2218 bool red_disabled_by_remote_side) | 2218 bool red_disabled_by_remote_side) |
2219 : call_(call), | 2219 : call_(call), |
2220 ssrcs_(sp.ssrcs), | 2220 ssrcs_(sp.ssrcs), |
2221 ssrc_groups_(sp.ssrc_groups), | 2221 ssrc_groups_(sp.ssrc_groups), |
2222 stream_(NULL), | 2222 stream_(NULL), |
2223 default_stream_(default_stream), | 2223 default_stream_(default_stream), |
2224 config_(config), | 2224 config_(std::move(config)), |
2225 red_disabled_by_remote_side_(red_disabled_by_remote_side), | 2225 red_disabled_by_remote_side_(red_disabled_by_remote_side), |
2226 external_decoder_factory_(external_decoder_factory), | 2226 external_decoder_factory_(external_decoder_factory), |
2227 sink_(NULL), | 2227 sink_(NULL), |
2228 last_width_(-1), | 2228 last_width_(-1), |
2229 last_height_(-1), | 2229 last_height_(-1), |
2230 first_frame_timestamp_(-1), | 2230 first_frame_timestamp_(-1), |
2231 estimated_remote_start_ntp_time_ms_(0) { | 2231 estimated_remote_start_ntp_time_ms_(0) { |
2232 config_.renderer = this; | 2232 config_.renderer = this; |
2233 std::vector<AllocatedDecoder> old_decoders; | 2233 std::vector<AllocatedDecoder> old_decoders; |
2234 ConfigureCodecs(recv_codecs, &old_decoders); | 2234 ConfigureCodecs(recv_codecs, &old_decoders); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2391 LOG(LS_INFO) << "RecreateWebRtcStream (recv) because of SetRecvParameters"; | 2391 LOG(LS_INFO) << "RecreateWebRtcStream (recv) because of SetRecvParameters"; |
2392 RecreateWebRtcStream(); | 2392 RecreateWebRtcStream(); |
2393 ClearDecoders(&old_decoders); | 2393 ClearDecoders(&old_decoders); |
2394 } | 2394 } |
2395 } | 2395 } |
2396 | 2396 |
2397 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { | 2397 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { |
2398 if (stream_ != NULL) { | 2398 if (stream_ != NULL) { |
2399 call_->DestroyVideoReceiveStream(stream_); | 2399 call_->DestroyVideoReceiveStream(stream_); |
2400 } | 2400 } |
2401 webrtc::VideoReceiveStream::Config config = config_; | 2401 webrtc::VideoReceiveStream::Config config = config_.Copy(); |
2402 if (red_disabled_by_remote_side_) { | 2402 if (red_disabled_by_remote_side_) { |
2403 config.rtp.fec.red_payload_type = -1; | 2403 config.rtp.fec.red_payload_type = -1; |
2404 config.rtp.fec.ulpfec_payload_type = -1; | 2404 config.rtp.fec.ulpfec_payload_type = -1; |
2405 config.rtp.fec.red_rtx_payload_type = -1; | 2405 config.rtp.fec.red_rtx_payload_type = -1; |
2406 } | 2406 } |
2407 stream_ = call_->CreateVideoReceiveStream(config); | 2407 stream_ = call_->CreateVideoReceiveStream(std::move(config)); |
2408 stream_->Start(); | 2408 stream_->Start(); |
2409 } | 2409 } |
2410 | 2410 |
2411 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( | 2411 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( |
2412 std::vector<AllocatedDecoder>* allocated_decoders) { | 2412 std::vector<AllocatedDecoder>* allocated_decoders) { |
2413 for (size_t i = 0; i < allocated_decoders->size(); ++i) { | 2413 for (size_t i = 0; i < allocated_decoders->size(); ++i) { |
2414 if ((*allocated_decoders)[i].external) { | 2414 if ((*allocated_decoders)[i].external) { |
2415 external_decoder_factory_->DestroyVideoDecoder( | 2415 external_decoder_factory_->DestroyVideoDecoder( |
2416 (*allocated_decoders)[i].external_decoder); | 2416 (*allocated_decoders)[i].external_decoder); |
2417 } | 2417 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2624 rtx_mapping[video_codecs[i].codec.id] != | 2624 rtx_mapping[video_codecs[i].codec.id] != |
2625 fec_settings.red_payload_type) { | 2625 fec_settings.red_payload_type) { |
2626 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2626 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2627 } | 2627 } |
2628 } | 2628 } |
2629 | 2629 |
2630 return video_codecs; | 2630 return video_codecs; |
2631 } | 2631 } |
2632 | 2632 |
2633 } // namespace cricket | 2633 } // namespace cricket |
OLD | NEW |