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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1012 rtc::CritScope stream_lock(&stream_crit_); | 1012 rtc::CritScope stream_lock(&stream_crit_); |
1013 for (const auto& kv : send_streams_) { | 1013 for (const auto& kv : send_streams_) { |
1014 kv.second->SetSend(send); | 1014 kv.second->SetSend(send); |
1015 } | 1015 } |
1016 } | 1016 } |
1017 sending_ = send; | 1017 sending_ = send; |
1018 return true; | 1018 return true; |
1019 } | 1019 } |
1020 | 1020 |
1021 // TODO(nisse): The enable argument was used for mute logic which has | 1021 // TODO(nisse): The enable argument was used for mute logic which has |
1022 // been moved to VideoBroadcaster. So delete this method, and use | 1022 // been moved to VideoBroadcaster. So remove the argument from this |
1023 // SetOptions instead. | 1023 // method. |
1024 bool WebRtcVideoChannel2::SetVideoSend(uint32_t ssrc, bool enable, | 1024 bool WebRtcVideoChannel2::SetVideoSend( |
1025 const VideoOptions* options) { | 1025 uint32_t ssrc, |
1026 bool enable, | |
1027 const VideoOptions* options, | |
1028 rtc::VideoSourceInterface<cricket::VideoFrame>* source) { | |
1026 TRACE_EVENT0("webrtc", "SetVideoSend"); | 1029 TRACE_EVENT0("webrtc", "SetVideoSend"); |
1030 RTC_DCHECK(ssrc != 0); | |
1027 LOG(LS_INFO) << "SetVideoSend (ssrc= " << ssrc << ", enable = " << enable | 1031 LOG(LS_INFO) << "SetVideoSend (ssrc= " << ssrc << ", enable = " << enable |
1028 << "options: " << (options ? options->ToString() : "nullptr") | 1032 << ", options: " << (options ? options->ToString() : "nullptr") |
1029 << ")."; | 1033 << ", source = " << (source != nullptr ? "(source)" : "NULL") |
pbos-webrtc
2016/05/14 00:42:39
"nullptr"
Taylor Brandstetter
2016/05/16 19:03:00
Done.
| |
1034 << ")"; | |
1030 | 1035 |
1031 if (enable && options) { | 1036 rtc::CritScope stream_lock(&stream_crit_); |
1032 SetOptions(ssrc, *options); | 1037 const auto& kv = send_streams_.find(ssrc); |
1038 if (kv == send_streams_.end()) { | |
1039 // Allow unknown ssrc only if source is null. | |
1040 RTC_CHECK(source == nullptr); | |
1041 LOG(LS_ERROR) << "No sending stream on ssrc " << ssrc; | |
pbos-webrtc
2016/05/14 00:42:39
This log will never happen, do RTC_CHECK(...) <<
Taylor Brandstetter
2016/05/16 19:03:00
I believe it actually can happen due to this issue
pbos-webrtc
2016/05/16 19:04:50
Oh, totally misread this. Carry on. :)
| |
1042 return false; | |
1033 } | 1043 } |
1034 return true; | 1044 |
1045 return kv->second->SetVideoSend(enable, options, source); | |
1035 } | 1046 } |
1036 | 1047 |
1037 bool WebRtcVideoChannel2::ValidateSendSsrcAvailability( | 1048 bool WebRtcVideoChannel2::ValidateSendSsrcAvailability( |
1038 const StreamParams& sp) const { | 1049 const StreamParams& sp) const { |
1039 for (uint32_t ssrc : sp.ssrcs) { | 1050 for (uint32_t ssrc : sp.ssrcs) { |
1040 if (send_ssrcs_.find(ssrc) != send_ssrcs_.end()) { | 1051 if (send_ssrcs_.find(ssrc) != send_ssrcs_.end()) { |
1041 LOG(LS_ERROR) << "Send stream with SSRC '" << ssrc << "' already exists."; | 1052 LOG(LS_ERROR) << "Send stream with SSRC '" << ssrc << "' already exists."; |
1042 return false; | 1053 return false; |
1043 } | 1054 } |
1044 } | 1055 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1323 // Get send stream bitrate stats. | 1334 // Get send stream bitrate stats. |
1324 rtc::CritScope stream_lock(&stream_crit_); | 1335 rtc::CritScope stream_lock(&stream_crit_); |
1325 for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator stream = | 1336 for (std::map<uint32_t, WebRtcVideoSendStream*>::iterator stream = |
1326 send_streams_.begin(); | 1337 send_streams_.begin(); |
1327 stream != send_streams_.end(); ++stream) { | 1338 stream != send_streams_.end(); ++stream) { |
1328 stream->second->FillBandwidthEstimationInfo(&bwe_info); | 1339 stream->second->FillBandwidthEstimationInfo(&bwe_info); |
1329 } | 1340 } |
1330 video_media_info->bw_estimations.push_back(bwe_info); | 1341 video_media_info->bw_estimations.push_back(bwe_info); |
1331 } | 1342 } |
1332 | 1343 |
1333 void WebRtcVideoChannel2::SetSource( | |
1334 uint32_t ssrc, | |
1335 rtc::VideoSourceInterface<cricket::VideoFrame>* source) { | |
1336 LOG(LS_INFO) << "SetSource: " << ssrc << " -> " | |
1337 << (source ? "(source)" : "NULL"); | |
1338 RTC_DCHECK(ssrc != 0); | |
1339 | |
1340 rtc::CritScope stream_lock(&stream_crit_); | |
1341 const auto& kv = send_streams_.find(ssrc); | |
1342 if (kv == send_streams_.end()) { | |
1343 // Allow unknown ssrc only if source is null. | |
1344 RTC_CHECK(source == nullptr); | |
1345 } else { | |
1346 kv->second->SetSource(source); | |
1347 } | |
1348 } | |
1349 | |
1350 void WebRtcVideoChannel2::OnPacketReceived( | 1344 void WebRtcVideoChannel2::OnPacketReceived( |
1351 rtc::CopyOnWriteBuffer* packet, | 1345 rtc::CopyOnWriteBuffer* packet, |
1352 const rtc::PacketTime& packet_time) { | 1346 const rtc::PacketTime& packet_time) { |
1353 const webrtc::PacketTime webrtc_packet_time(packet_time.timestamp, | 1347 const webrtc::PacketTime webrtc_packet_time(packet_time.timestamp, |
1354 packet_time.not_before); | 1348 packet_time.not_before); |
1355 const webrtc::PacketReceiver::DeliveryStatus delivery_result = | 1349 const webrtc::PacketReceiver::DeliveryStatus delivery_result = |
1356 call_->Receiver()->DeliverPacket( | 1350 call_->Receiver()->DeliverPacket( |
1357 webrtc::MediaType::VIDEO, | 1351 webrtc::MediaType::VIDEO, |
1358 packet->cdata(), packet->size(), | 1352 packet->cdata(), packet->size(), |
1359 webrtc_packet_time); | 1353 webrtc_packet_time); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1426 webrtc::MediaType::VIDEO, | 1420 webrtc::MediaType::VIDEO, |
1427 ready ? webrtc::kNetworkUp : webrtc::kNetworkDown); | 1421 ready ? webrtc::kNetworkUp : webrtc::kNetworkDown); |
1428 } | 1422 } |
1429 | 1423 |
1430 void WebRtcVideoChannel2::OnNetworkRouteChanged( | 1424 void WebRtcVideoChannel2::OnNetworkRouteChanged( |
1431 const std::string& transport_name, | 1425 const std::string& transport_name, |
1432 const rtc::NetworkRoute& network_route) { | 1426 const rtc::NetworkRoute& network_route) { |
1433 call_->OnNetworkRouteChanged(transport_name, network_route); | 1427 call_->OnNetworkRouteChanged(transport_name, network_route); |
1434 } | 1428 } |
1435 | 1429 |
1436 // TODO(pbos): Remove SetOptions in favor of SetSendParameters. | |
1437 void WebRtcVideoChannel2::SetOptions(uint32_t ssrc, | |
1438 const VideoOptions& options) { | |
1439 LOG(LS_INFO) << "SetOptions: ssrc " << ssrc << ": " << options.ToString(); | |
1440 | |
1441 rtc::CritScope stream_lock(&stream_crit_); | |
1442 const auto& kv = send_streams_.find(ssrc); | |
1443 if (kv == send_streams_.end()) { | |
1444 return; | |
1445 } | |
1446 kv->second->SetOptions(options); | |
1447 } | |
1448 | |
1449 void WebRtcVideoChannel2::SetInterface(NetworkInterface* iface) { | 1430 void WebRtcVideoChannel2::SetInterface(NetworkInterface* iface) { |
1450 MediaChannel::SetInterface(iface); | 1431 MediaChannel::SetInterface(iface); |
1451 // Set the RTP recv/send buffer to a bigger size | 1432 // Set the RTP recv/send buffer to a bigger size |
1452 MediaChannel::SetOption(NetworkInterface::ST_RTP, | 1433 MediaChannel::SetOption(NetworkInterface::ST_RTP, |
1453 rtc::Socket::OPT_RCVBUF, | 1434 rtc::Socket::OPT_RCVBUF, |
1454 kVideoRtpBufferSize); | 1435 kVideoRtpBufferSize); |
1455 | 1436 |
1456 // Speculative change to increase the outbound socket buffer size. | 1437 // Speculative change to increase the outbound socket buffer size. |
1457 // In b/15152257, we are seeing a significant number of packets discarded | 1438 // In b/15152257, we are seeing a significant number of packets discarded |
1458 // due to lack of socket buffer space, although it's not yet clear what the | 1439 // due to lack of socket buffer space, although it's not yet clear what the |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1607 // Not sending, abort after reconfiguration. Reconfiguration should still | 1588 // Not sending, abort after reconfiguration. Reconfiguration should still |
1608 // occur to permit sending this input as quickly as possible once we start | 1589 // occur to permit sending this input as quickly as possible once we start |
1609 // sending (without having to reconfigure then). | 1590 // sending (without having to reconfigure then). |
1610 if (!sending_) { | 1591 if (!sending_) { |
1611 return; | 1592 return; |
1612 } | 1593 } |
1613 | 1594 |
1614 stream_->Input()->IncomingCapturedFrame(video_frame); | 1595 stream_->Input()->IncomingCapturedFrame(video_frame); |
1615 } | 1596 } |
1616 | 1597 |
1617 void WebRtcVideoChannel2::WebRtcVideoSendStream::SetSource( | 1598 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend( |
1599 bool enable, | |
1600 const VideoOptions* options, | |
1618 rtc::VideoSourceInterface<cricket::VideoFrame>* source) { | 1601 rtc::VideoSourceInterface<cricket::VideoFrame>* source) { |
1619 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetSource"); | 1602 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetVideoSend"); |
1620 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 1603 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
1621 | 1604 |
1622 if (!source && !source_) | 1605 bool source_changing = source_ != source; |
1623 return; | 1606 if (source_changing) { |
1624 DisconnectSource(); | 1607 DisconnectSource(); |
1608 } | |
1625 | 1609 |
1626 { | 1610 { |
1627 rtc::CritScope cs(&lock_); | 1611 rtc::CritScope cs(&lock_); |
1628 | 1612 |
1629 // Reset timestamps to realign new incoming frames to a webrtc timestamp. A | 1613 if (enable && options) { |
1630 // new capturer may have a different timestamp delta than the previous one. | 1614 VideoOptions old_options = parameters_.options; |
1631 first_frame_timestamp_ms_ = rtc::Optional<int64_t>(); | 1615 parameters_.options.SetAll(*options); |
1616 // Reconfigure encoder settings on the naext frame or stream | |
1617 // recreation if the options changed. | |
1618 if (parameters_.options != old_options) { | |
1619 pending_encoder_reconfiguration_ = true; | |
1620 } | |
1621 } | |
1632 | 1622 |
1633 if (source == NULL) { | 1623 if (source_changing) { |
1634 if (stream_ != NULL) { | 1624 // Reset timestamps to realign new incoming frames to a webrtc timestamp. |
1625 // A new source may have a different timestamp delta than the previous | |
1626 // one. | |
1627 first_frame_timestamp_ms_ = rtc::Optional<int64_t>(); | |
1628 | |
1629 if (source == nullptr && stream_ != nullptr) { | |
1635 LOG(LS_VERBOSE) << "Disabling capturer, sending black frame."; | 1630 LOG(LS_VERBOSE) << "Disabling capturer, sending black frame."; |
1636 // Force this black frame not to be dropped due to timestamp order | 1631 // Force this black frame not to be dropped due to timestamp order |
1637 // check. As IncomingCapturedFrame will drop the frame if this frame's | 1632 // check. As IncomingCapturedFrame will drop the frame if this frame's |
1638 // timestamp is less than or equal to last frame's timestamp, it is | 1633 // timestamp is less than or equal to last frame's timestamp, it is |
1639 // necessary to give this black frame a larger timestamp than the | 1634 // necessary to give this black frame a larger timestamp than the |
1640 // previous one. | 1635 // previous one. |
1641 last_frame_timestamp_ms_ += 1; | 1636 last_frame_timestamp_ms_ += 1; |
1642 stream_->Input()->IncomingCapturedFrame( | 1637 stream_->Input()->IncomingCapturedFrame( |
1643 CreateBlackFrame(last_dimensions_.width, last_dimensions_.height, | 1638 CreateBlackFrame(last_dimensions_.width, last_dimensions_.height, |
1644 last_frame_timestamp_ms_, last_rotation_)); | 1639 last_frame_timestamp_ms_, last_rotation_)); |
1645 | |
1646 | |
1647 } | 1640 } |
1641 source_ = source; | |
1648 } | 1642 } |
1649 } | 1643 } |
1650 source_ = source; | 1644 |
1651 // |source_->AddOrUpdateSink| may not be called while holding |lock_| since | 1645 // |source_->AddOrUpdateSink| may not be called while holding |lock_| since |
1652 // that might cause a lock order inversion. | 1646 // that might cause a lock order inversion. |
1653 if (source_) { | 1647 if (source_changing && source_ != nullptr) { |
pbos-webrtc
2016/05/14 00:42:39
&& source_
Taylor Brandstetter
2016/05/16 19:03:00
Done.
| |
1654 source_->AddOrUpdateSink(this, sink_wants_); | 1648 source_->AddOrUpdateSink(this, sink_wants_); |
1655 } | 1649 } |
1650 return true; | |
1656 } | 1651 } |
1657 | 1652 |
1658 void WebRtcVideoChannel2::WebRtcVideoSendStream::DisconnectSource() { | 1653 void WebRtcVideoChannel2::WebRtcVideoSendStream::DisconnectSource() { |
1659 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 1654 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
1660 if (source_ == NULL) { | 1655 if (source_ == NULL) { |
1661 return; | 1656 return; |
1662 } | 1657 } |
1663 | 1658 |
1664 // |source_->RemoveSink| may not be called while holding |lock_| since | 1659 // |source_->RemoveSink| may not be called while holding |lock_| since |
1665 // that might cause a lock order inversion. | 1660 // that might cause a lock order inversion. |
1666 source_->RemoveSink(this); | 1661 source_->RemoveSink(this); |
1667 source_ = nullptr; | 1662 source_ = nullptr; |
1668 // Reset |cpu_restricted_counter_| if the capturer is changed. It is not | 1663 // Reset |cpu_restricted_counter_| if the source is changed. It is not |
1669 // possible to know if the video resolution is restricted by CPU usage after | 1664 // possible to know if the video resolution is restricted by CPU usage after |
1670 // the capturer is changed since the next capturer might be screen capture | 1665 // the source is changed since the next source might be screen capture |
1671 // with another resolution and frame rate. | 1666 // with another resolution and frame rate. |
1672 cpu_restricted_counter_ = 0; | 1667 cpu_restricted_counter_ = 0; |
1673 } | 1668 } |
1674 | 1669 |
1675 const std::vector<uint32_t>& | 1670 const std::vector<uint32_t>& |
1676 WebRtcVideoChannel2::WebRtcVideoSendStream::GetSsrcs() const { | 1671 WebRtcVideoChannel2::WebRtcVideoSendStream::GetSsrcs() const { |
1677 return ssrcs_; | 1672 return ssrcs_; |
1678 } | 1673 } |
1679 | 1674 |
1680 void WebRtcVideoChannel2::WebRtcVideoSendStream::SetOptions( | |
1681 const VideoOptions& options) { | |
1682 rtc::CritScope cs(&lock_); | |
1683 | |
1684 VideoOptions old_options = parameters_.options; | |
1685 parameters_.options.SetAll(options); | |
1686 // Reconfigure encoder settings on the next frame or stream | |
1687 // recreation if the options changed. | |
1688 if (parameters_.options != old_options) { | |
1689 pending_encoder_reconfiguration_ = true; | |
1690 } | |
1691 } | |
1692 | |
1693 webrtc::VideoCodecType CodecTypeFromName(const std::string& name) { | 1675 webrtc::VideoCodecType CodecTypeFromName(const std::string& name) { |
1694 if (CodecNamesEq(name, kVp8CodecName)) { | 1676 if (CodecNamesEq(name, kVp8CodecName)) { |
1695 return webrtc::kVideoCodecVP8; | 1677 return webrtc::kVideoCodecVP8; |
1696 } else if (CodecNamesEq(name, kVp9CodecName)) { | 1678 } else if (CodecNamesEq(name, kVp9CodecName)) { |
1697 return webrtc::kVideoCodecVP9; | 1679 return webrtc::kVideoCodecVP9; |
1698 } else if (CodecNamesEq(name, kH264CodecName)) { | 1680 } else if (CodecNamesEq(name, kH264CodecName)) { |
1699 return webrtc::kVideoCodecH264; | 1681 return webrtc::kVideoCodecH264; |
1700 } | 1682 } |
1701 return webrtc::kVideoCodecUnknown; | 1683 return webrtc::kVideoCodecUnknown; |
1702 } | 1684 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1818 SetCodec(*parameters_.codec_settings); | 1800 SetCodec(*parameters_.codec_settings); |
1819 recreate_stream = false; // SetCodec has already recreated the stream. | 1801 recreate_stream = false; // SetCodec has already recreated the stream. |
1820 } | 1802 } |
1821 if (recreate_stream) { | 1803 if (recreate_stream) { |
1822 LOG(LS_INFO) | 1804 LOG(LS_INFO) |
1823 << "RecreateWebRtcStream (send) because of SetSendParameters"; | 1805 << "RecreateWebRtcStream (send) because of SetSendParameters"; |
1824 RecreateWebRtcStream(); | 1806 RecreateWebRtcStream(); |
1825 } | 1807 } |
1826 } // release |lock_| | 1808 } // release |lock_| |
1827 | 1809 |
1828 // |capturer_->AddOrUpdateSink| may not be called while holding |lock_| since | 1810 // |source_->AddOrUpdateSink| may not be called while holding |lock_| since |
1829 // that might cause a lock order inversion. | 1811 // that might cause a lock order inversion. |
1830 if (params.rtp_header_extensions) { | 1812 if (params.rtp_header_extensions) { |
1831 sink_wants_.rotation_applied = !ContainsHeaderExtension( | 1813 sink_wants_.rotation_applied = !ContainsHeaderExtension( |
1832 *params.rtp_header_extensions, kRtpVideoRotationHeaderExtension); | 1814 *params.rtp_header_extensions, kRtpVideoRotationHeaderExtension); |
1833 if (source_) { | 1815 if (source_) { |
1834 source_->AddOrUpdateSink(this, sink_wants_); | 1816 source_->AddOrUpdateSink(this, sink_wants_); |
1835 } | 1817 } |
1836 } | 1818 } |
1837 } | 1819 } |
1838 | 1820 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2013 if (parameters_.options.is_screencast.value_or(false)) | 1995 if (parameters_.options.is_screencast.value_or(false)) |
2014 return; | 1996 return; |
2015 | 1997 |
2016 rtc::Optional<int> max_pixel_count; | 1998 rtc::Optional<int> max_pixel_count; |
2017 rtc::Optional<int> max_pixel_count_step_up; | 1999 rtc::Optional<int> max_pixel_count_step_up; |
2018 if (load == kOveruse) { | 2000 if (load == kOveruse) { |
2019 if (cpu_restricted_counter_ >= kMaxCpuDowngrades) { | 2001 if (cpu_restricted_counter_ >= kMaxCpuDowngrades) { |
2020 return; | 2002 return; |
2021 } | 2003 } |
2022 // The input video frame size will have a resolution with less than or | 2004 // The input video frame size will have a resolution with less than or |
2023 // equal to |max_pixel_count| depending on how the capturer can scale the | 2005 // equal to |max_pixel_count| depending on how the source can scale the |
2024 // input frame size. | 2006 // input frame size. |
2025 max_pixel_count = rtc::Optional<int>( | 2007 max_pixel_count = rtc::Optional<int>( |
2026 (last_dimensions_.height * last_dimensions_.width * 3) / 5); | 2008 (last_dimensions_.height * last_dimensions_.width * 3) / 5); |
2027 // Increase |number_of_cpu_adapt_changes_| if | 2009 // Increase |number_of_cpu_adapt_changes_| if |
2028 // sink_wants_.max_pixel_count will be changed since | 2010 // sink_wants_.max_pixel_count will be changed since |
2029 // last time |capturer_->AddOrUpdateSink| was called. That is, this will | 2011 // last time |source_->AddOrUpdateSink| was called. That is, this will |
2030 // result in a new request for the capturer to change resolution. | 2012 // result in a new request for the source to change resolution. |
2031 if (!sink_wants_.max_pixel_count || | 2013 if (!sink_wants_.max_pixel_count || |
2032 *sink_wants_.max_pixel_count > *max_pixel_count) { | 2014 *sink_wants_.max_pixel_count > *max_pixel_count) { |
2033 ++number_of_cpu_adapt_changes_; | 2015 ++number_of_cpu_adapt_changes_; |
2034 ++cpu_restricted_counter_; | 2016 ++cpu_restricted_counter_; |
2035 } | 2017 } |
2036 } else { | 2018 } else { |
2037 RTC_DCHECK(load == kUnderuse); | 2019 RTC_DCHECK(load == kUnderuse); |
2038 // The input video frame size will have a resolution with "one step up" | 2020 // The input video frame size will have a resolution with "one step up" |
2039 // pixels than |max_pixel_count_step_up| where "one step up" depends on | 2021 // pixels than |max_pixel_count_step_up| where "one step up" depends on |
2040 // how the capturer can scale the input frame size. | 2022 // how the source can scale the input frame size. |
2041 max_pixel_count_step_up = rtc::Optional<int>(last_dimensions_.height * | 2023 max_pixel_count_step_up = rtc::Optional<int>(last_dimensions_.height * |
2042 last_dimensions_.width); | 2024 last_dimensions_.width); |
2043 // Increase |number_of_cpu_adapt_changes_| if | 2025 // Increase |number_of_cpu_adapt_changes_| if |
2044 // sink_wants_.max_pixel_count_step_up will be changed since | 2026 // sink_wants_.max_pixel_count_step_up will be changed since |
2045 // last time |capturer_->AddOrUpdateSink| was called. That is, this will | 2027 // last time |source_->AddOrUpdateSink| was called. That is, this will |
2046 // result in a new request for the capturer to change resolution. | 2028 // result in a new request for the source to change resolution. |
2047 if (sink_wants_.max_pixel_count || | 2029 if (sink_wants_.max_pixel_count || |
2048 (sink_wants_.max_pixel_count_step_up && | 2030 (sink_wants_.max_pixel_count_step_up && |
2049 *sink_wants_.max_pixel_count_step_up < *max_pixel_count_step_up)) { | 2031 *sink_wants_.max_pixel_count_step_up < *max_pixel_count_step_up)) { |
2050 ++number_of_cpu_adapt_changes_; | 2032 ++number_of_cpu_adapt_changes_; |
2051 --cpu_restricted_counter_; | 2033 --cpu_restricted_counter_; |
2052 } | 2034 } |
2053 } | 2035 } |
2054 sink_wants_.max_pixel_count = max_pixel_count; | 2036 sink_wants_.max_pixel_count = max_pixel_count; |
2055 sink_wants_.max_pixel_count_step_up = max_pixel_count_step_up; | 2037 sink_wants_.max_pixel_count_step_up = max_pixel_count_step_up; |
2056 } | 2038 } |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2587 rtx_mapping[video_codecs[i].codec.id] != | 2569 rtx_mapping[video_codecs[i].codec.id] != |
2588 fec_settings.red_payload_type) { | 2570 fec_settings.red_payload_type) { |
2589 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2571 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2590 } | 2572 } |
2591 } | 2573 } |
2592 | 2574 |
2593 return video_codecs; | 2575 return video_codecs; |
2594 } | 2576 } |
2595 | 2577 |
2596 } // namespace cricket | 2578 } // namespace cricket |
OLD | NEW |