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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // issue is fixed. | 355 // issue is fixed. |
356 const RTPFragmentationHeader* frag = | 356 const RTPFragmentationHeader* frag = |
357 (video_type == kRtpVideoVp8) ? nullptr : fragmentation; | 357 (video_type == kRtpVideoVp8) ? nullptr : fragmentation; |
358 packetizer->SetPayloadData(payload_data, payload_size, frag); | 358 packetizer->SetPayloadData(payload_data, payload_size, frag); |
359 | 359 |
360 bool first_frame = first_frame_sent_(); | 360 bool first_frame = first_frame_sent_(); |
361 bool first = true; | 361 bool first = true; |
362 bool last = false; | 362 bool last = false; |
363 while (!last) { | 363 while (!last) { |
364 std::unique_ptr<RtpPacketToSend> packet(new RtpPacketToSend(*rtp_header)); | 364 std::unique_ptr<RtpPacketToSend> packet(new RtpPacketToSend(*rtp_header)); |
365 uint8_t* payload = packet->AllocatePayload(max_data_payload_length); | |
366 RTC_DCHECK(payload); | |
367 | 365 |
368 size_t payload_bytes_in_packet = 0; | 366 if (!packetizer->NextPacket(packet.get(), &last)) |
369 if (!packetizer->NextPacket(payload, &payload_bytes_in_packet, &last)) | |
370 return false; | 367 return false; |
| 368 RTC_DCHECK_LE(packet->payload_size(), max_data_payload_length); |
371 | 369 |
372 packet->SetPayloadSize(payload_bytes_in_packet); | |
373 packet->SetMarker(last); | |
374 if (!rtp_sender_->AssignSequenceNumber(packet.get())) | 370 if (!rtp_sender_->AssignSequenceNumber(packet.get())) |
375 return false; | 371 return false; |
376 | 372 |
377 const bool protect_packet = | 373 const bool protect_packet = |
378 (packetizer->GetProtectionType() == kProtectedPacket); | 374 (packetizer->GetProtectionType() == kProtectedPacket); |
379 if (flexfec_enabled()) { | 375 if (flexfec_enabled()) { |
380 // TODO(brandtr): Remove the FlexFEC code path when FlexfecSender | 376 // TODO(brandtr): Remove the FlexFEC code path when FlexfecSender |
381 // is wired up to PacedSender instead. | 377 // is wired up to PacedSender instead. |
382 SendVideoPacketWithFlexfec(std::move(packet), storage, protect_packet); | 378 SendVideoPacketWithFlexfec(std::move(packet), storage, protect_packet); |
383 } else if (red_enabled) { | 379 } else if (red_enabled) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 rtc::CritScope cs(&crit_); | 415 rtc::CritScope cs(&crit_); |
420 return retransmission_settings_; | 416 return retransmission_settings_; |
421 } | 417 } |
422 | 418 |
423 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { | 419 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { |
424 rtc::CritScope cs(&crit_); | 420 rtc::CritScope cs(&crit_); |
425 retransmission_settings_ = settings; | 421 retransmission_settings_ = settings; |
426 } | 422 } |
427 | 423 |
428 } // namespace webrtc | 424 } // namespace webrtc |
OLD | NEW |