Transport Stream Packet Access


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 Documentation

#define TSPACKET_GETADAPTATION ( packet   )     (((packet).header[3] & 0x30) >> 4)

Retrieve whether the packet has an adaptation field.

Parameters:
packet The packet to check.
Returns:
The adapatation field control flags.

#define TSPACKET_GETADAPTATION_LEN ( packet   )     ((packet).payload[0])

Retrieves the adaptation field length.

Parameters:
packet The packet to check.
Returns:
The length of the adaptation field.

#define TSPACKET_GETCOUNT ( packet   )     ((packet).header[3] & 0x0f)

Retrieves the packet sequence count.

Parameters:
packet The packet to extract the count from.
Returns:
The packet sequence count as a 4 bit integer.

#define TSPACKET_GETPID ( packet   )     (((((packet).header[1] & 0x1f) << 8) | ((packet).header[2] & 0xff)))

Retrieves the PID of packet from the packet header.

Parameters:
packet The packet to extract the PID from.
Returns:
The PID of the packet as a 16bit integer.

#define TSPACKET_GETPRIORITY ( packet   )     (((packet).header[1] & 0x20) >> 4)

Retrieves the priority field of the packet.

Parameters:
packet The packet to check.
Returns:
The packet priority.

#define TSPACKET_ISPAYLOADUNITSTART ( packet   )     (((packet).header[1] & 0x40) == 0x40)

Boolean test to determine whether this packet is the start of a payload.

Parameters:
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.

Parameters:
packet The packet to check.
Returns:
True if the packet is valid, false otherwise.

#define TSPACKET_SETADAPTATION ( packet,
adaptation   )     ((packet).header[3] = ((packet).header[3] & 0xcf) | (((adaptation) << 4) & 0x30))

Set whether the packet has an adaptation field.

Parameters:
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.

Parameters:
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)
Sets the PID of the packet in the packet header.

Parameters:
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.

Parameters:
packet The packet to update.
priority Either 1 or 0 to indicate that this is a priority packet.


Generated on Thu Jun 26 12:58:32 2008 for DVBStreamer by  doxygen 1.5.5