| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 for (size_t j = 12; j < media_packet->length; ++j) | 71 for (size_t j = 12; j < media_packet->length; ++j) |
| 72 media_packet->data[j] = random_->Rand<uint8_t>(); | 72 media_packet->data[j] = random_->Rand<uint8_t>(); |
| 73 seq_num++; | 73 seq_num++; |
| 74 media_packets.push_back(std::move(media_packet)); | 74 media_packets.push_back(std::move(media_packet)); |
| 75 } | 75 } |
| 76 // Last packet, set marker bit. | 76 // Last packet, set marker bit. |
| 77 ForwardErrorCorrection::Packet* media_packet = media_packets.back().get(); | 77 ForwardErrorCorrection::Packet* media_packet = media_packets.back().get(); |
| 78 RTC_DCHECK(media_packet); | 78 RTC_DCHECK(media_packet); |
| 79 media_packet->data[1] |= 0x80; | 79 media_packet->data[1] |= 0x80; |
| 80 | 80 |
| 81 next_seq_num_ = seq_num; | 81 fec_seq_num_ = seq_num; |
| 82 | 82 |
| 83 return media_packets; | 83 return media_packets; |
| 84 } | 84 } |
| 85 | 85 |
| 86 ForwardErrorCorrection::PacketList MediaPacketGenerator::ConstructMediaPackets( | 86 ForwardErrorCorrection::PacketList MediaPacketGenerator::ConstructMediaPackets( |
| 87 int num_media_packets) { | 87 int num_media_packets) { |
| 88 return ConstructMediaPackets(num_media_packets, random_->Rand<uint16_t>()); | 88 return ConstructMediaPackets(num_media_packets, random_->Rand<uint16_t>()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 uint16_t MediaPacketGenerator::GetNextSeqNum() { | 91 uint16_t MediaPacketGenerator::GetFecSeqNum() { |
| 92 return next_seq_num_; | 92 return fec_seq_num_; |
| 93 } | 93 } |
| 94 | 94 |
| 95 AugmentedPacketGenerator::AugmentedPacketGenerator(uint32_t ssrc) | 95 AugmentedPacketGenerator::AugmentedPacketGenerator(uint32_t ssrc) |
| 96 : num_packets_(0), ssrc_(ssrc), seq_num_(0), timestamp_(0) {} | 96 : num_packets_(0), ssrc_(ssrc), seq_num_(0), timestamp_(0) {} |
| 97 | 97 |
| 98 void AugmentedPacketGenerator::NewFrame(size_t num_packets) { | 98 void AugmentedPacketGenerator::NewFrame(size_t num_packets) { |
| 99 num_packets_ = num_packets; | 99 num_packets_ = num_packets; |
| 100 timestamp_ += kPacketTimestampIncrement; | 100 timestamp_ += kPacketTimestampIncrement; |
| 101 } | 101 } |
| 102 | 102 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 red_packet->data[1] &= 0x80; // Reset. | 208 red_packet->data[1] &= 0x80; // Reset. |
| 209 red_packet->data[1] += kRedPayloadType; // Replace. | 209 red_packet->data[1] += kRedPayloadType; // Replace. |
| 210 | 210 |
| 211 // Add RED header, f-bit always 0. | 211 // Add RED header, f-bit always 0. |
| 212 red_packet->data[header_length] = payload_type; | 212 red_packet->data[header_length] = payload_type; |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace fec | 215 } // namespace fec |
| 216 } // namespace test | 216 } // namespace test |
| 217 } // namespace webrtc | 217 } // namespace webrtc |
| OLD | NEW |