Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(964)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2740783006: Support removing b=AS bandwidth constraints. (Closed)
Patch Set: update comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 // Handle RTP header extensions. 708 // Handle RTP header extensions.
709 std::vector<webrtc::RtpExtension> filtered_extensions = FilterRtpExtensions( 709 std::vector<webrtc::RtpExtension> filtered_extensions = FilterRtpExtensions(
710 params.extensions, webrtc::RtpExtension::IsSupportedForVideo, true); 710 params.extensions, webrtc::RtpExtension::IsSupportedForVideo, true);
711 if (!send_rtp_extensions_ || (*send_rtp_extensions_ != filtered_extensions)) { 711 if (!send_rtp_extensions_ || (*send_rtp_extensions_ != filtered_extensions)) {
712 changed_params->rtp_header_extensions = 712 changed_params->rtp_header_extensions =
713 rtc::Optional<std::vector<webrtc::RtpExtension>>(filtered_extensions); 713 rtc::Optional<std::vector<webrtc::RtpExtension>>(filtered_extensions);
714 } 714 }
715 715
716 // Handle max bitrate. 716 // Handle max bitrate.
717 if (params.max_bandwidth_bps != send_params_.max_bandwidth_bps && 717 if (params.max_bandwidth_bps != send_params_.max_bandwidth_bps &&
718 params.max_bandwidth_bps >= 0) { 718 params.max_bandwidth_bps >= -1) {
719 // 0 uncaps max bitrate (-1). 719 // 0 or -1 uncaps max bitrate.
720 // TODO(pbos): Reconsider how 0 should be treated. It is not mentioned as a
721 // special value and might very well be used for stopping sending.
720 changed_params->max_bandwidth_bps = rtc::Optional<int>( 722 changed_params->max_bandwidth_bps = rtc::Optional<int>(
721 params.max_bandwidth_bps == 0 ? -1 : params.max_bandwidth_bps); 723 params.max_bandwidth_bps == 0 ? -1 : params.max_bandwidth_bps);
722 } 724 }
723 725
724 // Handle conference mode. 726 // Handle conference mode.
725 if (params.conference_mode != send_params_.conference_mode) { 727 if (params.conference_mode != send_params_.conference_mode) {
726 changed_params->conference_mode = 728 changed_params->conference_mode =
727 rtc::Optional<bool>(params.conference_mode); 729 rtc::Optional<bool>(params.conference_mode);
728 } 730 }
729 731
(...skipping 23 matching lines...) Expand all
753 const VideoCodecSettings& codec_settings = *changed_params.codec; 755 const VideoCodecSettings& codec_settings = *changed_params.codec;
754 send_codec_ = rtc::Optional<VideoCodecSettings>(codec_settings); 756 send_codec_ = rtc::Optional<VideoCodecSettings>(codec_settings);
755 LOG(LS_INFO) << "Using codec: " << codec_settings.codec.ToString(); 757 LOG(LS_INFO) << "Using codec: " << codec_settings.codec.ToString();
756 } 758 }
757 759
758 if (changed_params.rtp_header_extensions) { 760 if (changed_params.rtp_header_extensions) {
759 send_rtp_extensions_ = changed_params.rtp_header_extensions; 761 send_rtp_extensions_ = changed_params.rtp_header_extensions;
760 } 762 }
761 763
762 if (changed_params.codec || changed_params.max_bandwidth_bps) { 764 if (changed_params.codec || changed_params.max_bandwidth_bps) {
765 if (params.max_bandwidth_bps == -1) {
766 // Unset the global max bitrate (max_bitrate_bps) if max_bandwidth_bps is
767 // -1, which corresponds to no "b=AS" attribute in SDP. Note that the
768 // global max bitrate may be set below in GetBitrateConfigForCodec, from
769 // the codec max bitrate.
770 // TODO(pbos): This should be reconsidered (codec max bitrate should
771 // probably not affect global call max bitrate).
772 bitrate_config_.max_bitrate_bps = -1;
773 }
763 if (send_codec_) { 774 if (send_codec_) {
764 // TODO(holmer): Changing the codec parameters shouldn't necessarily mean 775 // TODO(holmer): Changing the codec parameters shouldn't necessarily mean
765 // that we change the min/max of bandwidth estimation. Reevaluate this. 776 // that we change the min/max of bandwidth estimation. Reevaluate this.
766 bitrate_config_ = GetBitrateConfigForCodec(send_codec_->codec); 777 bitrate_config_ = GetBitrateConfigForCodec(send_codec_->codec);
767 if (!changed_params.codec) { 778 if (!changed_params.codec) {
768 // If the codec isn't changing, set the start bitrate to -1 which means 779 // If the codec isn't changing, set the start bitrate to -1 which means
769 // "unchanged" so that BWE isn't affected. 780 // "unchanged" so that BWE isn't affected.
770 bitrate_config_.start_bitrate_bps = -1; 781 bitrate_config_.start_bitrate_bps = -1;
771 } 782 }
772 } 783 }
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 rtx_mapping[video_codecs[i].codec.id] != 2559 rtx_mapping[video_codecs[i].codec.id] !=
2549 ulpfec_config.red_payload_type) { 2560 ulpfec_config.red_payload_type) {
2550 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2561 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2551 } 2562 }
2552 } 2563 }
2553 2564
2554 return video_codecs; 2565 return video_codecs;
2555 } 2566 }
2556 2567
2557 } // namespace cricket 2568 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698