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

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

Issue 2740783006: Support removing b=AS bandwidth constraints. (Closed)
Patch Set: add back useful todo change 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 // Removing b=AS: does (currently) not take presedence over codec max
767 // bitrate. This is to make an as minimal as possible change to be able to
768 // effectively remove b=AS in SDP. This should be reconsidered (codec max
769 // bitrate should probably not affect global call max bitrate).
Taylor Brandstetter 2017/03/10 18:42:08 nit: I think this comment would be unclear to some
pbos-webrtc 2017/03/10 18:52:09 Done. (But with my ldap.)
770 bitrate_config_.max_bitrate_bps = -1;
771 }
763 if (send_codec_) { 772 if (send_codec_) {
764 // TODO(holmer): Changing the codec parameters shouldn't necessarily mean 773 // TODO(holmer): Changing the codec parameters shouldn't necessarily mean
765 // that we change the min/max of bandwidth estimation. Reevaluate this. 774 // that we change the min/max of bandwidth estimation. Reevaluate this.
766 bitrate_config_ = GetBitrateConfigForCodec(send_codec_->codec); 775 bitrate_config_ = GetBitrateConfigForCodec(send_codec_->codec);
767 if (!changed_params.codec) { 776 if (!changed_params.codec) {
768 // If the codec isn't changing, set the start bitrate to -1 which means 777 // If the codec isn't changing, set the start bitrate to -1 which means
769 // "unchanged" so that BWE isn't affected. 778 // "unchanged" so that BWE isn't affected.
770 bitrate_config_.start_bitrate_bps = -1; 779 bitrate_config_.start_bitrate_bps = -1;
771 } 780 }
772 } 781 }
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 rtx_mapping[video_codecs[i].codec.id] != 2557 rtx_mapping[video_codecs[i].codec.id] !=
2549 ulpfec_config.red_payload_type) { 2558 ulpfec_config.red_payload_type) {
2550 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2559 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2551 } 2560 }
2552 } 2561 }
2553 2562
2554 return video_codecs; 2563 return video_codecs;
2555 } 2564 }
2556 2565
2557 } // namespace cricket 2566 } // 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