Data Structures | |
struct | TSPacket_t |
Structure representing an MPEG2 Transport Stream packet with out hamming codes. More... | |
Defines | |
#define | TSPACKET_SIZE (188) |
Constant for the size of a transport packet with out hamming code. | |
#define | TSPACKET_GETPID(packet) (((((packet).header[1] & 0x1f) << 8) | ((packet).header[2] & 0xff))) |
Retrieves the PID of packet from the packet header. | |
#define | TSPACKET_SETPID(packet, pid) |
Sets the PID of the packet in the packet header. | |
#define | TSPACKET_GETCOUNT(packet) ((packet).header[3] & 0x0f) |
Retrieves the packet sequence count. | |
#define | TSPACKET_SETCOUNT(packet, count) ((packet).header[3] = ((packet).header[3] & 0xf0) | ((count) & 0x0f)) |
Sets the packet sequence count. | |
#define | TSPACKET_ISPAYLOADUNITSTART(packet) (((packet).header[1] & 0x40) == 0x40) |
Boolean test to determine whether this packet is the start of a payload. | |
#define | TSPACKET_ISVALID(packet) (((packet).header[1] & 0x80) == 0x00) |
Boolean test to determine whether this packet is valid, transport_error_indicator is not set. | |
#define | TSPACKET_GETPRIORITY(packet) (((packet).header[1] & 0x20) >> 4) |
Retrieves the priority field of the packet. | |
#define | TSPACKET_SETPRIORITY(packet, priority) ((packet).header[1] = ((packet).header[1] & 0xdf) | (((priority) << 4) & 0x20)) |
Set the priority field of the packet. | |
#define | TSPACKET_GETADAPTATION(packet) (((packet).header[3] & 0x30) >> 4) |
Retrieve whether the packet has an adaptation field. | |
#define | TSPACKET_SETADAPTATION(packet, adaptation) ((packet).header[3] = ((packet).header[3] & 0xcf) | (((adaptation) << 4) & 0x30)) |
Set whether the packet has an adaptation field. | |
#define | TSPACKET_GETADAPTATION_LEN(packet) ((packet).payload[0]) |
Retrieves the adaptation field length. |
#define TSPACKET_GETADAPTATION | ( | packet | ) | (((packet).header[3] & 0x30) >> 4) |
Retrieve whether the packet has an adaptation field.
packet | The packet to check. |
#define TSPACKET_GETADAPTATION_LEN | ( | packet | ) | ((packet).payload[0]) |
Retrieves the adaptation field length.
packet | The packet to check. |
#define TSPACKET_GETCOUNT | ( | packet | ) | ((packet).header[3] & 0x0f) |
Retrieves the packet sequence count.
packet | The packet to extract the count from. |
#define TSPACKET_GETPID | ( | packet | ) | (((((packet).header[1] & 0x1f) << 8) | ((packet).header[2] & 0xff))) |
Retrieves the PID of packet from the packet header.
packet | The packet to extract the PID from. |
#define TSPACKET_GETPRIORITY | ( | packet | ) | (((packet).header[1] & 0x20) >> 4) |
Retrieves the priority field of the packet.
packet | The packet to check. |
#define TSPACKET_ISPAYLOADUNITSTART | ( | packet | ) | (((packet).header[1] & 0x40) == 0x40) |
Boolean test to determine whether this packet is the start of a payload.
packet | The packet to check. |
#define TSPACKET_ISVALID | ( | packet | ) | (((packet).header[1] & 0x80) == 0x00) |
Boolean test to determine whether this packet is valid, transport_error_indicator is not set.
packet | The packet to check. |
#define TSPACKET_SETADAPTATION | ( | packet, | |||
adaptation | ) | ((packet).header[3] = ((packet).header[3] & 0xcf) | (((adaptation) << 4) & 0x30)) |
Set whether the packet has an adaptation field.
packet | The packet to update. | |
adaptation | The new adaptation field flags. |
#define TSPACKET_SETCOUNT | ( | packet, | |||
count | ) | ((packet).header[3] = ((packet).header[3] & 0xf0) | ((count) & 0x0f)) |
Sets the packet sequence count.
packet | The packet to update. | |
count | The new sequence count to set. |
#define TSPACKET_SETPID | ( | packet, | |||
pid | ) |
Value:
do{ \ (packet).header[1] = ((packet).header[1] & 0xe0) | ((pid >> 8) & 0x1f); \ (packet).header[2] = pid & 0xff; \ }while(0)
packet | The packet to update. | |
pid | The new PID to set. |
#define TSPACKET_SETPRIORITY | ( | packet, | |||
priority | ) | ((packet).header[1] = ((packet).header[1] & 0xdf) | (((priority) << 4) & 0x20)) |
Set the priority field of the packet.
packet | The packet to update. | |
priority | Either 1 or 0 to indicate that this is a priority packet. |