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 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 // Set up A/V sync group based on sync label. | 1223 // Set up A/V sync group based on sync label. |
1224 config.sync_group = sp.sync_label; | 1224 config.sync_group = sp.sync_label; |
1225 | 1225 |
1226 config.rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; | 1226 config.rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; |
1227 config.rtp.transport_cc = | 1227 config.rtp.transport_cc = |
1228 send_codec_ ? HasTransportCc(send_codec_->codec) : false; | 1228 send_codec_ ? HasTransportCc(send_codec_->codec) : false; |
1229 config.disable_prerenderer_smoothing = | 1229 config.disable_prerenderer_smoothing = |
1230 video_config_.disable_prerenderer_smoothing; | 1230 video_config_.disable_prerenderer_smoothing; |
1231 | 1231 |
1232 receive_streams_[ssrc] = new WebRtcVideoReceiveStream( | 1232 receive_streams_[ssrc] = new WebRtcVideoReceiveStream( |
1233 call_, sp, config, external_decoder_factory_, default_stream, | 1233 call_, sp, std::move(config), external_decoder_factory_, default_stream, |
1234 recv_codecs_, red_disabled_by_remote_side_); | 1234 recv_codecs_, red_disabled_by_remote_side_); |
1235 | 1235 |
1236 return true; | 1236 return true; |
1237 } | 1237 } |
1238 | 1238 |
1239 void WebRtcVideoChannel2::ConfigureReceiverRtp( | 1239 void WebRtcVideoChannel2::ConfigureReceiverRtp( |
1240 webrtc::VideoReceiveStream::Config* config, | 1240 webrtc::VideoReceiveStream::Config* config, |
1241 const StreamParams& sp) const { | 1241 const StreamParams& sp) const { |
1242 uint32_t ssrc = sp.first_ssrc(); | 1242 uint32_t ssrc = sp.first_ssrc(); |
1243 | 1243 |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 pending_encoder_reconfiguration_ = false; | 2193 pending_encoder_reconfiguration_ = false; |
2194 | 2194 |
2195 if (sending_) { | 2195 if (sending_) { |
2196 stream_->Start(); | 2196 stream_->Start(); |
2197 } | 2197 } |
2198 } | 2198 } |
2199 | 2199 |
2200 WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( | 2200 WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( |
2201 webrtc::Call* call, | 2201 webrtc::Call* call, |
2202 const StreamParams& sp, | 2202 const StreamParams& sp, |
2203 const webrtc::VideoReceiveStream::Config& config, | 2203 webrtc::VideoReceiveStream::Config config, |
2204 WebRtcVideoDecoderFactory* external_decoder_factory, | 2204 WebRtcVideoDecoderFactory* external_decoder_factory, |
2205 bool default_stream, | 2205 bool default_stream, |
2206 const std::vector<VideoCodecSettings>& recv_codecs, | 2206 const std::vector<VideoCodecSettings>& recv_codecs, |
2207 bool red_disabled_by_remote_side) | 2207 bool red_disabled_by_remote_side) |
2208 : call_(call), | 2208 : call_(call), |
2209 ssrcs_(sp.ssrcs), | 2209 ssrcs_(sp.ssrcs), |
2210 ssrc_groups_(sp.ssrc_groups), | 2210 ssrc_groups_(sp.ssrc_groups), |
2211 stream_(NULL), | 2211 stream_(NULL), |
2212 default_stream_(default_stream), | 2212 default_stream_(default_stream), |
2213 config_(config), | 2213 config_(std::move(config)), |
2214 red_disabled_by_remote_side_(red_disabled_by_remote_side), | 2214 red_disabled_by_remote_side_(red_disabled_by_remote_side), |
2215 external_decoder_factory_(external_decoder_factory), | 2215 external_decoder_factory_(external_decoder_factory), |
2216 sink_(NULL), | 2216 sink_(NULL), |
2217 last_width_(-1), | 2217 last_width_(-1), |
2218 last_height_(-1), | 2218 last_height_(-1), |
2219 first_frame_timestamp_(-1), | 2219 first_frame_timestamp_(-1), |
2220 estimated_remote_start_ntp_time_ms_(0) { | 2220 estimated_remote_start_ntp_time_ms_(0) { |
2221 config_.renderer = this; | 2221 config_.renderer = this; |
2222 std::vector<AllocatedDecoder> old_decoders; | 2222 std::vector<AllocatedDecoder> old_decoders; |
2223 ConfigureCodecs(recv_codecs, &old_decoders); | 2223 ConfigureCodecs(recv_codecs, &old_decoders); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 LOG(LS_INFO) << "RecreateWebRtcStream (recv) because of SetRecvParameters"; | 2380 LOG(LS_INFO) << "RecreateWebRtcStream (recv) because of SetRecvParameters"; |
2381 RecreateWebRtcStream(); | 2381 RecreateWebRtcStream(); |
2382 ClearDecoders(&old_decoders); | 2382 ClearDecoders(&old_decoders); |
2383 } | 2383 } |
2384 } | 2384 } |
2385 | 2385 |
2386 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { | 2386 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { |
2387 if (stream_ != NULL) { | 2387 if (stream_ != NULL) { |
2388 call_->DestroyVideoReceiveStream(stream_); | 2388 call_->DestroyVideoReceiveStream(stream_); |
2389 } | 2389 } |
2390 webrtc::VideoReceiveStream::Config config = config_; | 2390 webrtc::VideoReceiveStream::Config config = config_.Copy(); |
2391 if (red_disabled_by_remote_side_) { | 2391 if (red_disabled_by_remote_side_) { |
2392 config.rtp.fec.red_payload_type = -1; | 2392 config.rtp.fec.red_payload_type = -1; |
2393 config.rtp.fec.ulpfec_payload_type = -1; | 2393 config.rtp.fec.ulpfec_payload_type = -1; |
2394 config.rtp.fec.red_rtx_payload_type = -1; | 2394 config.rtp.fec.red_rtx_payload_type = -1; |
2395 } | 2395 } |
2396 stream_ = call_->CreateVideoReceiveStream(config); | 2396 stream_ = call_->CreateVideoReceiveStream(std::move(config)); |
2397 stream_->Start(); | 2397 stream_->Start(); |
2398 } | 2398 } |
2399 | 2399 |
2400 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( | 2400 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( |
2401 std::vector<AllocatedDecoder>* allocated_decoders) { | 2401 std::vector<AllocatedDecoder>* allocated_decoders) { |
2402 for (size_t i = 0; i < allocated_decoders->size(); ++i) { | 2402 for (size_t i = 0; i < allocated_decoders->size(); ++i) { |
2403 if ((*allocated_decoders)[i].external) { | 2403 if ((*allocated_decoders)[i].external) { |
2404 external_decoder_factory_->DestroyVideoDecoder( | 2404 external_decoder_factory_->DestroyVideoDecoder( |
2405 (*allocated_decoders)[i].external_decoder); | 2405 (*allocated_decoders)[i].external_decoder); |
2406 } | 2406 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 rtx_mapping[video_codecs[i].codec.id] != | 2613 rtx_mapping[video_codecs[i].codec.id] != |
2614 fec_settings.red_payload_type) { | 2614 fec_settings.red_payload_type) { |
2615 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2615 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2616 } | 2616 } |
2617 } | 2617 } |
2618 | 2618 |
2619 return video_codecs; | 2619 return video_codecs; |
2620 } | 2620 } |
2621 | 2621 |
2622 } // namespace cricket | 2622 } // namespace cricket |
OLD | NEW |