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