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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // from an FEC viewpoint, they are part of the payload to be protected. | 220 // from an FEC viewpoint, they are part of the payload to be protected. |
221 // (The base RTP header is already protected by the FEC header.) | 221 // (The base RTP header is already protected by the FEC header.) |
222 return ulpfec_generator_.MaxPacketOverhead() + kRedForFecHeaderLength + | 222 return ulpfec_generator_.MaxPacketOverhead() + kRedForFecHeaderLength + |
223 (rtp_sender_->RtpHeaderLength() - kRtpHeaderSize); | 223 (rtp_sender_->RtpHeaderLength() - kRtpHeaderSize); |
224 } | 224 } |
225 if (ulpfec_enabled()) | 225 if (ulpfec_enabled()) |
226 overhead += ulpfec_generator_.MaxPacketOverhead(); | 226 overhead += ulpfec_generator_.MaxPacketOverhead(); |
227 return overhead; | 227 return overhead; |
228 } | 228 } |
229 | 229 |
230 void RTPSenderVideo::SetFecParameters(const FecProtectionParams* delta_params, | 230 void RTPSenderVideo::SetFecParameters(const FecProtectionParams& delta_params, |
231 const FecProtectionParams* key_params) { | 231 const FecProtectionParams& key_params) { |
232 rtc::CritScope cs(&crit_); | 232 rtc::CritScope cs(&crit_); |
233 RTC_DCHECK(delta_params); | |
234 RTC_DCHECK(key_params); | |
235 if (ulpfec_enabled()) { | 233 if (ulpfec_enabled()) { |
236 delta_fec_params_ = *delta_params; | 234 delta_fec_params_ = delta_params; |
237 key_fec_params_ = *key_params; | 235 key_fec_params_ = key_params; |
238 } | 236 } |
239 } | 237 } |
240 | 238 |
241 bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type, | 239 bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type, |
242 FrameType frame_type, | 240 FrameType frame_type, |
243 int8_t payload_type, | 241 int8_t payload_type, |
244 uint32_t rtp_timestamp, | 242 uint32_t rtp_timestamp, |
245 int64_t capture_time_ms, | 243 int64_t capture_time_ms, |
246 const uint8_t* payload_data, | 244 const uint8_t* payload_data, |
247 size_t payload_size, | 245 size_t payload_size, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 283 |
286 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( | 284 std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create( |
287 video_type, max_data_payload_length, | 285 video_type, max_data_payload_length, |
288 video_header ? &(video_header->codecHeader) : nullptr, frame_type)); | 286 video_header ? &(video_header->codecHeader) : nullptr, frame_type)); |
289 | 287 |
290 StorageType storage; | 288 StorageType storage; |
291 bool red_enabled; | 289 bool red_enabled; |
292 bool first_frame = first_frame_sent_(); | 290 bool first_frame = first_frame_sent_(); |
293 { | 291 { |
294 rtc::CritScope cs(&crit_); | 292 rtc::CritScope cs(&crit_); |
295 FecProtectionParams* fec_params = | 293 const FecProtectionParams& fec_params = |
296 frame_type == kVideoFrameKey ? &key_fec_params_ : &delta_fec_params_; | 294 frame_type == kVideoFrameKey ? key_fec_params_ : delta_fec_params_; |
297 ulpfec_generator_.SetFecParameters(fec_params); | 295 ulpfec_generator_.SetFecParameters(fec_params); |
298 storage = packetizer->GetStorageType(retransmission_settings_); | 296 storage = packetizer->GetStorageType(retransmission_settings_); |
299 red_enabled = this->red_enabled(); | 297 red_enabled = this->red_enabled(); |
300 } | 298 } |
301 | 299 |
302 // TODO(changbin): we currently don't support to configure the codec to | 300 // TODO(changbin): we currently don't support to configure the codec to |
303 // output multiple partitions for VP8. Should remove below check after the | 301 // output multiple partitions for VP8. Should remove below check after the |
304 // issue is fixed. | 302 // issue is fixed. |
305 const RTPFragmentationHeader* frag = | 303 const RTPFragmentationHeader* frag = |
306 (video_type == kRtpVideoVp8) ? NULL : fragmentation; | 304 (video_type == kRtpVideoVp8) ? NULL : fragmentation; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 rtc::CritScope cs(&crit_); | 360 rtc::CritScope cs(&crit_); |
363 return retransmission_settings_; | 361 return retransmission_settings_; |
364 } | 362 } |
365 | 363 |
366 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { | 364 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { |
367 rtc::CritScope cs(&crit_); | 365 rtc::CritScope cs(&crit_); |
368 retransmission_settings_ = settings; | 366 retransmission_settings_ = settings; |
369 } | 367 } |
370 | 368 |
371 } // namespace webrtc | 369 } // namespace webrtc |
OLD | NEW |