OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // from an FEC viewpoint, they are part of the payload to be protected. | 214 // from an FEC viewpoint, they are part of the payload to be protected. |
215 // (The base RTP header is already protected by the FEC header.) | 215 // (The base RTP header is already protected by the FEC header.) |
216 return producer_fec_.MaxPacketOverhead() + kRedForFecHeaderLength + | 216 return producer_fec_.MaxPacketOverhead() + kRedForFecHeaderLength + |
217 (rtp_sender_->RtpHeaderLength() - kRtpHeaderSize); | 217 (rtp_sender_->RtpHeaderLength() - kRtpHeaderSize); |
218 } | 218 } |
219 if (ulpfec_enabled()) | 219 if (ulpfec_enabled()) |
220 overhead += producer_fec_.MaxPacketOverhead(); | 220 overhead += producer_fec_.MaxPacketOverhead(); |
221 return overhead; | 221 return overhead; |
222 } | 222 } |
223 | 223 |
224 void RTPSenderVideo::SetFecParameters(const FecProtectionParams* delta_params, | 224 void RTPSenderVideo::SetFecParameters(const FecProtectionParams& delta_params, |
225 const FecProtectionParams* key_params) { | 225 const FecProtectionParams& key_params) { |
226 rtc::CritScope cs(&crit_); | 226 rtc::CritScope cs(&crit_); |
227 RTC_DCHECK(delta_params); | |
228 RTC_DCHECK(key_params); | |
229 if (ulpfec_enabled()) { | 227 if (ulpfec_enabled()) { |
230 delta_fec_params_ = *delta_params; | 228 delta_fec_params_ = delta_params; |
231 key_fec_params_ = *key_params; | 229 key_fec_params_ = key_params; |
232 } | 230 } |
233 } | 231 } |
234 | 232 |
235 bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type, | 233 bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type, |
236 FrameType frame_type, | 234 FrameType frame_type, |
237 int8_t payload_type, | 235 int8_t payload_type, |
238 uint32_t rtp_timestamp, | 236 uint32_t rtp_timestamp, |
239 int64_t capture_time_ms, | 237 int64_t capture_time_ms, |
240 const uint8_t* payload_data, | 238 const uint8_t* payload_data, |
241 size_t payload_size, | 239 size_t payload_size, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 277 |
280 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( | 278 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( |
281 video_type, max_data_payload_length, | 279 video_type, max_data_payload_length, |
282 video_header ? &(video_header->codecHeader) : nullptr, frame_type)); | 280 video_header ? &(video_header->codecHeader) : nullptr, frame_type)); |
283 | 281 |
284 StorageType storage; | 282 StorageType storage; |
285 bool _red_enabled; | 283 bool _red_enabled; |
286 bool first_frame = first_frame_sent_(); | 284 bool first_frame = first_frame_sent_(); |
287 { | 285 { |
288 rtc::CritScope cs(&crit_); | 286 rtc::CritScope cs(&crit_); |
289 FecProtectionParams* fec_params = | 287 const FecProtectionParams& fec_params = |
290 frame_type == kVideoFrameKey ? &key_fec_params_ : &delta_fec_params_; | 288 frame_type == kVideoFrameKey ? key_fec_params_ : delta_fec_params_; |
291 producer_fec_.SetFecParameters(fec_params); | 289 producer_fec_.SetFecParameters(fec_params); |
292 storage = packetizer->GetStorageType(retransmission_settings_); | 290 storage = packetizer->GetStorageType(retransmission_settings_); |
293 _red_enabled = red_enabled(); | 291 _red_enabled = red_enabled(); |
294 } | 292 } |
295 | 293 |
296 // TODO(changbin): we currently don't support to configure the codec to | 294 // TODO(changbin): we currently don't support to configure the codec to |
297 // output multiple partitions for VP8. Should remove below check after the | 295 // output multiple partitions for VP8. Should remove below check after the |
298 // issue is fixed. | 296 // issue is fixed. |
299 const RTPFragmentationHeader* frag = | 297 const RTPFragmentationHeader* frag = |
300 (video_type == kRtpVideoVp8) ? NULL : fragmentation; | 298 (video_type == kRtpVideoVp8) ? NULL : fragmentation; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 rtc::CritScope cs(&crit_); | 354 rtc::CritScope cs(&crit_); |
357 return retransmission_settings_; | 355 return retransmission_settings_; |
358 } | 356 } |
359 | 357 |
360 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { | 358 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { |
361 rtc::CritScope cs(&crit_); | 359 rtc::CritScope cs(&crit_); |
362 retransmission_settings_ = settings; | 360 retransmission_settings_ = settings; |
363 } | 361 } |
364 | 362 |
365 } // namespace webrtc | 363 } // namespace webrtc |
OLD | NEW |