12 #ifndef ROC_PACKET_PACKET_H_
13 #define ROC_PACKET_PACKET_H_
Base class for List element.
Base class for MpscQueue element.
Base class for object with reference counter.
const FEC * fec() const
FEC packet.
void print(int flags) const
Print packet to stderr.
stream_source_t source_id() const
Get packet stream identifier.
const UDP * udp() const
UDP packet.
static size_t approx_size(size_t n_samples)
Estimate number of bytes per packet for given number of samples. This is only an approximation,...
bool has_source_id() const
Check if packet has stream identifier.
static Packet * container_of(UDP *udp)
Get pointer to packet from a pointer to its UDP part.
int compare(const Packet &other) const
Determine packet ordering.
const core::Slice< uint8_t > & payload() const
Get protocol-dependent packet payload.
stream_timestamp_t duration() const
Get duration of the packet.
unsigned flags() const
Get flags.
Packet(core::IPool &packet_pool)
Constructor.
const RTP * rtp() const
RTP packet.
RTCP * rtcp()
RTCP packet.
core::nanoseconds_t receive_timestamp() const
Get receive timestamp (RTS) of the packet.
const RTCP * rtcp() const
RTCP packet.
const core::Slice< uint8_t > & buffer() const
Get packet buffer.
@ FlagRestored
Packet was restored using FEC decoder.
@ FlagPrepared
Packet was prepared for composing.
@ FlagRTCP
Packet contains RTCP compound packet.
@ FlagRepair
Packet contains repair FEC symbols.
@ FlagControl
Packet contains control message.
@ FlagRTP
Packet contains RTP header.
@ FlagAudio
Packet contains audio samples.
@ FlagComposed
Packet was composed.
@ FlagUDP
Packet contains UDP header.
@ FlagFEC
Packet contains FEC header.
void set_buffer(const core::Slice< uint8_t > &data)
Set packet buffer.
core::nanoseconds_t capture_timestamp() const
Get capture timestamp (CTS) of the packet.
stream_timestamp_t stream_timestamp() const
Get stream timestamp (STS) of the packet.
bool has_flags(unsigned flags) const
Check specific flag.
void add_flags(unsigned flags)
Add flags.
#define ROC_CONTAINER_OF(ptr, type, member)
Cast a member of a structure out to the containing structure.
int64_t nanoseconds_t
Nanoseconds.
uint32_t stream_source_t
Packet stream identifier.
core::SharedPtr< Packet > PacketPtr
Packet smart pointer.
uint32_t stream_timestamp_t
Packet stream timestamp.
void print_packet(const Packet &packet, int flags)
Print packet to stderr.
Base class for object with reference counter.
Shared ownership intrusive pointer.