|
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
#include <packet.h>
Public Types | |
| enum | Flag { FlagUDP = (1 << 0) , FlagRTP = (1 << 1) , FlagFEC = (1 << 2) , FlagRTCP = (1 << 3) , FlagAudio = (1 << 4) , FlagRepair = (1 << 5) , FlagControl = (1 << 6) , FlagPrepared = (1 << 7) , FlagComposed = (1 << 8) , FlagRestored = (1 << 9) } |
| Packet flags. More... | |
Public Member Functions | |
| Packet (core::IPool &packet_pool) | |
| Constructor. | |
| void | add_flags (unsigned flags) |
| Add flags. | |
| bool | has_flags (unsigned flags) const |
| Check specific flag. | |
| unsigned | flags () const |
| Get flags. | |
| const UDP * | udp () const |
| UDP packet. | |
| UDP * | udp () |
| UDP packet. | |
| const RTP * | rtp () const |
| RTP packet. | |
| RTP * | rtp () |
| RTP packet. | |
| const FEC * | fec () const |
| FEC packet. | |
| FEC * | fec () |
| FEC packet. | |
| const RTCP * | rtcp () const |
| RTCP packet. | |
| RTCP * | rtcp () |
| RTCP packet. | |
| const core::Slice< uint8_t > & | buffer () const |
| Get packet buffer. | |
| void | set_buffer (const core::Slice< uint8_t > &data) |
| Set packet buffer. | |
| const core::Slice< uint8_t > & | payload () const |
| Get protocol-dependent packet payload. | |
| bool | has_source_id () const |
| Check if packet has stream identifier. | |
| stream_source_t | source_id () const |
| Get packet stream identifier. | |
| stream_timestamp_t | stream_timestamp () const |
| Get stream timestamp (STS) of the packet. | |
| stream_timestamp_t | duration () const |
| Get duration of the packet. | |
| core::nanoseconds_t | capture_timestamp () const |
| Get capture timestamp (CTS) of the packet. | |
| core::nanoseconds_t | receive_timestamp () const |
| Get receive timestamp (RTS) of the packet. | |
| int | compare (const Packet &other) const |
| Determine packet ordering. | |
| void | print (int flags) const |
| Print packet to stderr. | |
| Public Member Functions inherited from roc::core::RefCounted< Packet, core::PoolAllocation > | |
| RefCounted () | |
| Initialize. | |
| int | getref () const |
| Get reference counter. | |
| void | incref () const |
| Increment reference counter. | |
| void | decref () const |
| Decrement reference counter. | |
| Public Member Functions inherited from roc::core::ListNode< Tag > | |
| ListData * | list_data () const |
| Get pointer to internal data. | |
| Public Member Functions inherited from roc::core::MpscQueueNode< Tag > | |
| MpscQueueData * | mpsc_queue_data () const |
| Get pointer to internal data. | |
Static Public Member Functions | |
| static Packet * | container_of (UDP *udp) |
| Get pointer to packet from a pointer to its UDP part. | |
| 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, don't rely on it. | |
| Static Public Member Functions inherited from roc::core::ListNode< Tag > | |
| static ListNode * | list_node (ListData *data) |
| Get pointer to parent node from pointer to internal data. | |
| Static Public Member Functions inherited from roc::core::MpscQueueNode< Tag > | |
| static MpscQueueNode * | mpsc_queue_node (MpscQueueData *data) |
| Get pointer to parent node from pointer to internal data. | |
Additional Inherited Members | |
| Protected Member Functions inherited from roc::core::PoolAllocation | |
| IPool & | pool () const |
| Get pool. | |
| PoolAllocation (IPool &pool) | |
| Initialize. | |
| template<class T> | |
| void | destroy (T &object) |
| Destroy object and return memory to pool. | |
|
explicit |
Constructor.
| void roc::packet::Packet::add_flags | ( | unsigned | flags | ) |
Add flags.
|
static |
Estimate number of bytes per packet for given number of samples. This is only an approximation, don't rely on it.
| const core::Slice< uint8_t > & roc::packet::Packet::buffer | ( | ) | const |
Get packet buffer.
| core::nanoseconds_t roc::packet::Packet::capture_timestamp | ( | ) | const |
Get capture timestamp (CTS) of the packet.
| int roc::packet::Packet::compare | ( | const Packet & | other | ) | const |
Determine packet ordering.
other packetother packetother packet | stream_timestamp_t roc::packet::Packet::duration | ( | ) | const |
Get duration of the packet.
| unsigned roc::packet::Packet::flags | ( | ) | const |
Get flags.
| bool roc::packet::Packet::has_flags | ( | unsigned | flags | ) | const |
Check specific flag.
| bool roc::packet::Packet::has_source_id | ( | ) | const |
Check if packet has stream identifier.
| const core::Slice< uint8_t > & roc::packet::Packet::payload | ( | ) | const |
|
inline |
| core::nanoseconds_t roc::packet::Packet::receive_timestamp | ( | ) | const |
Get receive timestamp (RTS) of the packet.
| void roc::packet::Packet::set_buffer | ( | const core::Slice< uint8_t > & | data | ) |
Set packet buffer.
| stream_source_t roc::packet::Packet::source_id | ( | ) | const |
Get packet stream identifier.
| stream_timestamp_t roc::packet::Packet::stream_timestamp | ( | ) | const |
Get stream timestamp (STS) of the packet.