Chromium Code Reviews| 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 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2288 | 2288 |
| 2289 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { | 2289 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() { |
| 2290 if (stream_) { | 2290 if (stream_) { |
| 2291 call_->DestroyVideoReceiveStream(stream_); | 2291 call_->DestroyVideoReceiveStream(stream_); |
| 2292 stream_ = nullptr; | 2292 stream_ = nullptr; |
| 2293 } | 2293 } |
| 2294 if (flexfec_stream_) { | 2294 if (flexfec_stream_) { |
| 2295 call_->DestroyFlexfecReceiveStream(flexfec_stream_); | 2295 call_->DestroyFlexfecReceiveStream(flexfec_stream_); |
| 2296 flexfec_stream_ = nullptr; | 2296 flexfec_stream_ = nullptr; |
| 2297 } | 2297 } |
| 2298 if (IsFlexfecFieldTrialEnabled() && flexfec_config_.IsCompleteAndEnabled()) { | 2298 |
| 2299 const bool use_flexfec = | |
| 2300 IsFlexfecFieldTrialEnabled() && flexfec_config_.IsCompleteAndEnabled(); | |
| 2301 // TODO(nisse): There are way too many copies here. And why isn't | |
| 2302 // the argument to CreateVideoReceiveStream a const ref? | |
|
brandtr
2017/02/23 11:58:32
Agree that this should be cleaned up at some point
nisse-webrtc
2017/02/23 13:01:22
I noticed a std::move(configuration) in Call::Crea
brandtr
2017/02/23 15:28:35
I guess that std::move saves a copy at that call s
| |
| 2303 webrtc::VideoReceiveStream::Config config = config_.Copy(); | |
| 2304 config.rtp.protected_by_flexfec = use_flexfec; | |
| 2305 stream_ = call_->CreateVideoReceiveStream(config.Copy()); | |
| 2306 stream_->Start(); | |
| 2307 | |
| 2308 if (use_flexfec) { | |
| 2299 flexfec_stream_ = call_->CreateFlexfecReceiveStream(flexfec_config_); | 2309 flexfec_stream_ = call_->CreateFlexfecReceiveStream(flexfec_config_); |
| 2300 flexfec_stream_->Start(); | 2310 flexfec_stream_->Start(); |
| 2301 } | 2311 } |
| 2302 stream_ = call_->CreateVideoReceiveStream(config_.Copy()); | |
| 2303 stream_->Start(); | |
| 2304 } | 2312 } |
| 2305 | 2313 |
| 2306 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( | 2314 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( |
| 2307 std::vector<AllocatedDecoder>* allocated_decoders) { | 2315 std::vector<AllocatedDecoder>* allocated_decoders) { |
| 2308 for (size_t i = 0; i < allocated_decoders->size(); ++i) { | 2316 for (size_t i = 0; i < allocated_decoders->size(); ++i) { |
| 2309 if ((*allocated_decoders)[i].external) { | 2317 if ((*allocated_decoders)[i].external) { |
| 2310 external_decoder_factory_->DestroyVideoDecoder( | 2318 external_decoder_factory_->DestroyVideoDecoder( |
| 2311 (*allocated_decoders)[i].external_decoder); | 2319 (*allocated_decoders)[i].external_decoder); |
| 2312 } | 2320 } |
| 2313 delete (*allocated_decoders)[i].decoder; | 2321 delete (*allocated_decoders)[i].decoder; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2527 rtx_mapping[video_codecs[i].codec.id] != | 2535 rtx_mapping[video_codecs[i].codec.id] != |
| 2528 ulpfec_config.red_payload_type) { | 2536 ulpfec_config.red_payload_type) { |
| 2529 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2537 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
| 2530 } | 2538 } |
| 2531 } | 2539 } |
| 2532 | 2540 |
| 2533 return video_codecs; | 2541 return video_codecs; |
| 2534 } | 2542 } |
| 2535 | 2543 |
| 2536 } // namespace cricket | 2544 } // namespace cricket |
| OLD | NEW |