2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-02 11:34:53 +01:00
|
|
|
#ifndef MODULES_VIDEO_CODING_DEPRECATED_PACKET_H_
|
|
|
|
|
#define MODULES_VIDEO_CODING_DEPRECATED_PACKET_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-11-28 16:47:49 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2024-08-29 13:00:40 +00:00
|
|
|
#include <optional>
|
|
|
|
|
|
2019-03-12 12:29:22 +01:00
|
|
|
#include "api/rtp_headers.h"
|
2019-06-20 10:05:55 +02:00
|
|
|
#include "api/rtp_packet_info.h"
|
2021-04-30 13:10:56 +02:00
|
|
|
#include "api/units/timestamp.h"
|
2019-03-21 15:43:58 +01:00
|
|
|
#include "api/video/video_frame_type.h"
|
2018-10-02 13:55:47 +02:00
|
|
|
#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor.h"
|
2018-11-28 16:47:49 +01:00
|
|
|
#include "modules/rtp_rtcp/source/rtp_video_header.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-05-07 12:36:21 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2019-03-12 12:29:22 +01:00
|
|
|
// Used to indicate if a received packet contain a complete NALU (or equivalent)
|
|
|
|
|
enum VCMNaluCompleteness {
|
|
|
|
|
kNaluUnset = 0, // Packet has not been filled.
|
|
|
|
|
kNaluComplete = 1, // Packet can be decoded as is.
|
|
|
|
|
kNaluStart, // Packet contain beginning of NALU
|
|
|
|
|
kNaluIncomplete, // Packet is not beginning or end of NALU
|
|
|
|
|
kNaluEnd, // Packet is the end of a NALU
|
|
|
|
|
};
|
|
|
|
|
|
2013-05-07 12:36:21 +00:00
|
|
|
class VCMPacket {
|
2015-12-21 04:12:39 -08:00
|
|
|
public:
|
|
|
|
|
VCMPacket();
|
2019-03-06 14:09:54 +01:00
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
VCMPacket(const uint8_t* ptr,
|
2019-03-06 14:09:54 +01:00
|
|
|
size_t size,
|
|
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
const RTPVideoHeader& video_header,
|
2019-06-20 10:05:55 +02:00
|
|
|
int64_t ntp_time_ms,
|
2021-04-30 13:10:56 +02:00
|
|
|
Timestamp receive_time);
|
2015-12-21 04:12:39 -08:00
|
|
|
|
2018-10-02 13:55:47 +02:00
|
|
|
~VCMPacket();
|
|
|
|
|
|
2019-02-20 13:12:21 +01:00
|
|
|
VideoCodecType codec() const { return video_header.codec; }
|
|
|
|
|
int width() const { return video_header.width; }
|
|
|
|
|
int height() const { return video_header.height; }
|
|
|
|
|
|
|
|
|
|
bool is_first_packet_in_frame() const {
|
|
|
|
|
return video_header.is_first_packet_in_frame;
|
|
|
|
|
}
|
|
|
|
|
bool is_last_packet_in_frame() const {
|
|
|
|
|
return video_header.is_last_packet_in_frame;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
uint8_t payloadType;
|
|
|
|
|
uint32_t timestamp;
|
|
|
|
|
// NTP time of the capture time in local timebase in milliseconds.
|
|
|
|
|
int64_t ntp_time_ms_;
|
|
|
|
|
uint16_t seqNum;
|
|
|
|
|
const uint8_t* dataPtr;
|
|
|
|
|
size_t sizeBytes;
|
|
|
|
|
bool markerBit;
|
2016-05-24 10:20:47 +02:00
|
|
|
int timesNacked;
|
2015-12-21 04:12:39 -08:00
|
|
|
|
|
|
|
|
VCMNaluCompleteness completeNALU; // Default is kNaluIncomplete.
|
|
|
|
|
bool insertStartCode; // True if a start code should be inserted before this
|
|
|
|
|
// packet.
|
2016-06-08 00:24:21 -07:00
|
|
|
RTPVideoHeader video_header;
|
2024-08-29 13:00:40 +00:00
|
|
|
std::optional<RtpGenericFrameDescriptor> generic_descriptor;
|
2015-12-21 04:12:39 -08:00
|
|
|
|
2019-06-20 10:05:55 +02:00
|
|
|
RtpPacketInfo packet_info;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|
2023-03-02 11:34:53 +01:00
|
|
|
#endif // MODULES_VIDEO_CODING_DEPRECATED_PACKET_H_
|