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 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 rtc::VideoSourceInterface<webrtc::VideoFrame>* source) { | 1605 rtc::VideoSourceInterface<webrtc::VideoFrame>* source) { |
1606 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetVideoSend"); | 1606 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetVideoSend"); |
1607 RTC_DCHECK_RUN_ON(&thread_checker_); | 1607 RTC_DCHECK_RUN_ON(&thread_checker_); |
1608 | 1608 |
1609 // Ignore |options| pointer if |enable| is false. | 1609 // Ignore |options| pointer if |enable| is false. |
1610 bool options_present = enable && options; | 1610 bool options_present = enable && options; |
1611 | 1611 |
1612 if (options_present) { | 1612 if (options_present) { |
1613 VideoOptions old_options = parameters_.options; | 1613 VideoOptions old_options = parameters_.options; |
1614 parameters_.options.SetAll(*options); | 1614 parameters_.options.SetAll(*options); |
1615 if (parameters_.options != old_options) { | 1615 if (parameters_.options.is_screencast.value_or(false) != |
| 1616 old_options.is_screencast.value_or(false) && |
| 1617 parameters_.codec_settings) { |
| 1618 // If screen content settings change, we may need to recreate the codec |
| 1619 // instance so that the correct type is used. Add a param to force the |
| 1620 // SetCodec() to not resuse the current instance. |
| 1621 allocated_encoder_.codec.params["recreate"] = "true"; |
| 1622 SetCodec(*parameters_.codec_settings); |
| 1623 } else if (parameters_.options != old_options) { |
1616 ReconfigureEncoder(); | 1624 ReconfigureEncoder(); |
1617 } | 1625 } |
1618 } | 1626 } |
1619 | 1627 |
1620 if (source_ && stream_) { | 1628 if (source_ && stream_) { |
1621 stream_->SetSource( | 1629 stream_->SetSource( |
1622 nullptr, webrtc::VideoSendStream::DegradationPreference::kBalanced); | 1630 nullptr, webrtc::VideoSendStream::DegradationPreference::kBalanced); |
1623 } | 1631 } |
1624 // Switch to the new source. | 1632 // Switch to the new source. |
1625 source_ = source; | 1633 source_ = source; |
(...skipping 901 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 |