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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
750 | 750 |
751 // Handle send codec. | 751 // Handle send codec. |
752 const std::vector<VideoCodecSettings> supported_codecs = | 752 const std::vector<VideoCodecSettings> supported_codecs = |
753 FilterSupportedCodecs(MapCodecs(params.codecs)); | 753 FilterSupportedCodecs(MapCodecs(params.codecs)); |
754 | 754 |
755 if (supported_codecs.empty()) { | 755 if (supported_codecs.empty()) { |
756 LOG(LS_ERROR) << "No video codecs supported."; | 756 LOG(LS_ERROR) << "No video codecs supported."; |
757 return false; | 757 return false; |
758 } | 758 } |
759 | 759 |
760 if (!send_codec_ || supported_codecs.front() != *send_codec_) { | 760 VideoCodecSettings new_codec = supported_codecs.front(); |
761 changed_params->codec = | 761 // Preference doesn't matter at this point and shouldn't impact comparison. |
762 rtc::Optional<VideoCodecSettings>(supported_codecs.front()); | 762 new_codec.codec.preference = 0; |
pbos-webrtc
2016/04/04 07:58:58
Can we change VideoCodecSettings instead to not co
| |
763 if (!send_codec_ || new_codec != *send_codec_) { | |
764 changed_params->codec = rtc::Optional<VideoCodecSettings>(new_codec); | |
763 } | 765 } |
764 | 766 |
765 // Handle RTP header extensions. | 767 // Handle RTP header extensions. |
766 std::vector<webrtc::RtpExtension> filtered_extensions = FilterRtpExtensions( | 768 std::vector<webrtc::RtpExtension> filtered_extensions = FilterRtpExtensions( |
767 params.extensions, webrtc::RtpExtension::IsSupportedForVideo, true); | 769 params.extensions, webrtc::RtpExtension::IsSupportedForVideo, true); |
768 if (send_rtp_extensions_ != filtered_extensions) { | 770 if (send_rtp_extensions_ != filtered_extensions) { |
769 changed_params->rtp_header_extensions = | 771 changed_params->rtp_header_extensions = |
770 rtc::Optional<std::vector<webrtc::RtpExtension>>(filtered_extensions); | 772 rtc::Optional<std::vector<webrtc::RtpExtension>>(filtered_extensions); |
771 } | 773 } |
772 | 774 |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2593 rtx_mapping[video_codecs[i].codec.id] != | 2595 rtx_mapping[video_codecs[i].codec.id] != |
2594 fec_settings.red_payload_type) { | 2596 fec_settings.red_payload_type) { |
2595 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2597 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2596 } | 2598 } |
2597 } | 2599 } |
2598 | 2600 |
2599 return video_codecs; | 2601 return video_codecs; |
2600 } | 2602 } |
2601 | 2603 |
2602 } // namespace cricket | 2604 } // namespace cricket |
OLD | NEW |