Lines Matching defs:packet

13 #include "webrtc/modules/video_coding/main/source/packet.h"
126 VCMPacket& packet = *packet_it;
129 // Calculate the offset into the frame buffer for this packet.
134 // Set the data pointer to pointing to the start of this packet in the
136 const uint8_t* packet_buffer = packet.dataPtr;
137 packet.dataPtr = frame_buffer + offset;
143 if (packet.codecSpecificHeader.codec == kRtpVideoH264 &&
144 packet.codecSpecificHeader.codecHeader.H264.stap_a) {
147 while (nalu_ptr < packet_buffer + packet.sizeBytes) {
150 length + (packet.insertStartCode ? kH264StartCodeLengthBytes : 0);
156 while (nalu_ptr < packet_buffer + packet.sizeBytes) {
161 packet.insertStartCode,
165 packet.sizeBytes = required_length;
166 return packet.sizeBytes;
170 packet.sizeBytes +
171 (packet.insertStartCode ? kH264StartCodeLengthBytes : 0));
173 packet.sizeBytes = Insert(packet_buffer,
174 packet.sizeBytes,
175 packet.insertStartCode,
176 const_cast<uint8_t*>(packet.dataPtr));
177 return packet.sizeBytes;
256 // Find the end of the NAL unit which the packet pointed to by |packet_it|
257 // belongs to. Returns an iterator to the last packet of the frame if the end
370 // Missing packet, the previous packet was the last in sequence.
381 // If the two iterators are pointing to the same packet they are considered
407 // Found a sequence number gap due to packet loss.
438 int VCMSessionInfo::InsertPacket(const VCMPacket& packet,
442 if (packet.frameType == kFrameEmpty) {
443 // Update sequence number of an empty packet.
444 // Only media packets are inserted into the packet list.
445 InformOfEmptyPacket(packet.seqNum);
454 // Find the position of this packet in the packet list in sequence number
458 if (LatestSequenceNumber(packet.seqNum, (*rit).seqNum) == packet.seqNum)
463 (*rit).seqNum == packet.seqNum && (*rit).sizeBytes > 0)
466 if (packet.codec == kVideoCodecH264) {
467 frame_type_ = packet.frameType;
468 if (packet.isFirstPacket &&
470 IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum))) {
471 first_packet_seq_num_ = packet.seqNum;
473 if (packet.markerBit &&
475 IsNewerSequenceNumber(packet.seqNum, last_packet_seq_num_))) {
476 last_packet_seq_num_ = packet.seqNum;
482 // Check if this is first packet (only valid for some codecs)
483 // Should only be set for one packet per session.
484 if (packet.isFirstPacket && first_packet_seq_num_ == -1) {
485 // The first packet in a frame signals the frame type.
486 frame_type_ = packet.frameType;
487 // Store the sequence number for the first packet.
488 first_packet_seq_num_ = static_cast<int>(packet.seqNum);
490 !IsNewerSequenceNumber(packet.seqNum, first_packet_seq_num_)) {
491 LOG(LS_WARNING) << "Received packet with a sequence number which is out "
494 } else if (frame_type_ == kFrameEmpty && packet.frameType != kFrameEmpty) {
495 // Update the frame type with the type of the first media packet.
497 frame_type_ = packet.frameType;
500 // Track the marker bit, should only be set for one packet per session.
501 if (packet.markerBit && last_packet_seq_num_ == -1) {
502 last_packet_seq_num_ = static_cast<int>(packet.seqNum);
504 IsNewerSequenceNumber(packet.seqNum, last_packet_seq_num_)) {
505 LOG(LS_WARNING) << "Received packet with a sequence number which is out "
512 PacketIterator packet_list_it = packets_.insert(rit.base(), packet);