OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include "webrtc/video/video_send_stream.h" | 10 #include "webrtc/video/video_send_stream.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 config.rtp.flexfec.payload_type, config.rtp.flexfec.ssrc, | 141 config.rtp.flexfec.payload_type, config.rtp.flexfec.ssrc, |
142 config.rtp.flexfec.protected_media_ssrcs[0], config.rtp.extensions, | 142 config.rtp.flexfec.protected_media_ssrcs[0], config.rtp.extensions, |
143 RTPSender::FecExtensionSizes(), rtp_state, Clock::GetRealTimeClock())); | 143 RTPSender::FecExtensionSizes(), rtp_state, Clock::GetRealTimeClock())); |
144 } | 144 } |
145 | 145 |
146 } // namespace | 146 } // namespace |
147 | 147 |
148 namespace { | 148 namespace { |
149 | 149 |
150 bool PayloadTypeSupportsSkippingFecPackets(const std::string& payload_name) { | 150 bool PayloadTypeSupportsSkippingFecPackets(const std::string& payload_name) { |
151 rtc::Optional<VideoCodecType> codecType = | 151 const VideoCodecType codecType = PayloadStringToCodecType(payload_name); |
152 PayloadNameToCodecType(payload_name); | 152 if (codecType == kVideoCodecVP8 || codecType == kVideoCodecVP9) { |
153 if (codecType && | |
154 (*codecType == kVideoCodecVP8 || *codecType == kVideoCodecVP9)) { | |
155 return true; | 153 return true; |
156 } | 154 } |
157 RTC_DCHECK((codecType && *codecType == kVideoCodecH264) || | |
158 payload_name == "FAKE") | |
159 << "unknown payload_name " << payload_name; | |
160 return false; | 155 return false; |
161 } | 156 } |
162 | 157 |
163 int CalculateMaxPadBitrateBps(std::vector<VideoStream> streams, | 158 int CalculateMaxPadBitrateBps(std::vector<VideoStream> streams, |
164 int min_transmit_bitrate_bps, | 159 int min_transmit_bitrate_bps, |
165 bool pad_to_min_bitrate) { | 160 bool pad_to_min_bitrate) { |
166 int pad_up_to_bitrate_bps = 0; | 161 int pad_up_to_bitrate_bps = 0; |
167 // Calculate max padding bitrate for a multi layer codec. | 162 // Calculate max padding bitrate for a multi layer codec. |
168 if (streams.size() > 1) { | 163 if (streams.size() > 1) { |
169 // Pad to min bitrate of the highest layer. | 164 // Pad to min bitrate of the highest layer. |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 std::min(config_->rtp.max_packet_size, | 1245 std::min(config_->rtp.max_packet_size, |
1251 kPathMTU - transport_overhead_bytes_per_packet_); | 1246 kPathMTU - transport_overhead_bytes_per_packet_); |
1252 | 1247 |
1253 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1248 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
1254 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); | 1249 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); |
1255 } | 1250 } |
1256 } | 1251 } |
1257 | 1252 |
1258 } // namespace internal | 1253 } // namespace internal |
1259 } // namespace webrtc | 1254 } // namespace webrtc |
OLD | NEW |