dvb_table - Man Page
Digital TV table parsing
Synopsis
Files
file descriptors.h
Provides a way to handle MPEG-TS descriptors found on Digital TV streams.
file header.h
Provides the MPEG TS table headers.
file atsc_header.h
Provides some common ATSC stuff.
file atsc_eit.h
Provides the table parser for the ATSC EIT (Event Information Table)
file cat.h
Provides the table parser for the CAT (Conditional Access Table)
file eit.h
Provides the table parser for the DVB EIT (Event Information Table)
file mgt.h
Provides the table parser for the ATSC MGT (Master Guide Table)
file nit.h
Provides the descriptors for NIT MPEG-TS table.
file pat.h
Provides the descriptors for PAT MPEG-TS table.
file pmt.h
Provides the descriptors for PMT MPEG-TS table.
file sdt.h
Provides the descriptors for SDT MPEG-TS table.
file vct.h
Provides the descriptors for TVCT and CVCT tables.
file mpeg_es.h
Provides the table parser for the MPEG-TS Elementary Stream.
file mpeg_pes.h
Provides the table parser for the MPEG-PES Elementary Stream.
file mpeg_ts.h
Provides the table parser for the MPEG-PES Elementary Stream.
Data Structures
struct dvb_desc
Linked list containing the several descriptors found on a MPEG-TS table.
struct dvb_descriptor
Contains the parser information for the MPEG-TS parser code.
struct dvb_ts_packet_header
Header of a MPEG-TS transport packet.
struct dvb_table_header
Header of a MPEG-TS table.
struct atsc_table_eit_event
ATSC EIT event table.
union atsc_table_eit_desc_length
ATSC EIT descriptor length.
struct atsc_table_eit
ATSC EIT table.
struct dvb_table_eit_event
DVB EIT event table.
struct dvb_table_eit
DVB EIT table.
struct atsc_table_mgt_table
ATSC tables descrition at MGT table.
struct atsc_table_mgt
ATSC MGT table.
union dvb_table_nit_transport_header
MPEG-TS NIT transport header.
struct dvb_table_nit_transport
MPEG-TS NIT transport table.
struct dvb_table_nit
MPEG-TS NIT table.
struct dvb_table_pat_program
MPEG-TS PAT program table.
struct dvb_table_pat
MPEG-TS PAT table.
struct dvb_table_pmt_stream
MPEG-TS PMT stream table.
struct dvb_table_pmt
MPEG-TS PMT table.
struct dvb_table_sdt_service
MPEG-TS SDT service table.
struct dvb_table_sdt
MPEG-TS SDT table.
struct atsc_table_vct_channel
ATSC VCT channel table (covers both CVCT and TVCT)
struct atsc_table_vct
ATSC VCT table (covers both CVCT and TVCT)
union atsc_table_vct_descriptor_length
ATSC VCT descriptor length.
struct dvb_mpeg_es_seq_start
MPEG ES Sequence header.
struct dvb_mpeg_es_pic_start
MPEG ES Picture start header.
struct ts_t
MPEG PES timestamp structure, used for dts and pts.
struct dvb_mpeg_pes_optional
MPEG PES optional header.
struct dvb_mpeg_pes
MPEG PES data structure.
struct dvb_mpeg_ts_adaption
MPEG TS header adaption field.
struct dvb_mpeg_ts
MPEG TS header.
Macros
#define DVB_MAX_PAYLOAD_PACKET_SIZE
Maximum size of a table session to be parsed.
#define DVB_CRC_SIZE
number of bytes for the descriptor's CRC check
#define ATSC_BASE_PID
ATSC PID for the Program and System Information Protocol.
#define ATSC_TABLE_EIT
ATSC EIT table ID.
#define atsc_eit_event_foreach(_event, _eit)
Macro used to find event on an ATSC EIT table.
#define DVB_TABLE_CAT
ATSC CAT table ID.
#define DVB_TABLE_CAT_PID
ATSC PID table ID.
#define DVB_TABLE_EIT
DVB EIT table ID for the actual TS.
#define DVB_TABLE_EIT_OTHER
DVB EIT table ID for other TS.
#define DVB_TABLE_EIT_PID
DVB EIT Program ID.
#define DVB_TABLE_EIT_SCHEDULE
Start table ID for the DVB EIT schedule data on the actual TS The range has 0x0f elements (0x50 to 0x5F).
#define DVB_TABLE_EIT_SCHEDULE_OTHER
Start table ID for the DVB EIT schedule data on other TS The range has 0x0f elements (0x60 to 0x6F).
#define dvb_eit_event_foreach(_event, _eit)
Macro used to find event on a DVB EIT table.
#define ATSC_TABLE_MGT
ATSC MGT table ID.
#define DVB_TABLE_NIT
NIT table ID.
#define DVB_TABLE_NIT2
NIT table ID (alternative table ID)
#define DVB_TABLE_NIT_PID
NIT Program ID.
#define dvb_nit_transport_foreach(_tran, _nit)
Macro used to find a transport inside a NIT table.
#define DVB_TABLE_PAT
PAT table ID.
#define DVB_TABLE_PAT_PID
PAT Program ID.
#define dvb_pat_program_foreach(_pgm, _pat)
Macro used to find programs on a PAT table.
#define DVB_TABLE_PMT
PMT table ID.
#define dvb_pmt_stream_foreach(_stream, _pmt)
Macro used to find streams on a PMT table.
#define DVB_TABLE_SDT
SDT table ID.
#define DVB_TABLE_SDT2
SDT table ID (alternative table ID)
#define DVB_TABLE_SDT_PID
SDT Program ID.
#define dvb_sdt_service_foreach(_service, _sdt)
Macro used to find services on a SDT table.
#define ATSC_TABLE_TVCT
TVCT table ID.
#define ATSC_TABLE_CVCT
CVCT table ID.
#define ATSC_TABLE_VCT_PID
Program ID with the VCT tables on it.
#define atsc_vct_channel_foreach(_channel, _vct)
Macro used to find channels on a VCT table.
#define DVB_MPEG_ES_PIC_START
Picture Start.
#define DVB_MPEG_ES_USER_DATA
User Data.
#define DVB_MPEG_ES_SEQ_START
Sequence Start.
#define DVB_MPEG_ES_SEQ_EXT
Extension.
#define DVB_MPEG_ES_GOP
Group Of Pictures.
#define DVB_MPEG_ES_SLICES
Slices.
#define DVB_MPEG_PES
MPEG Packetized Elementary Stream magic.
#define DVB_MPEG_PES_AUDIO
PES Audio.
#define DVB_MPEG_PES_VIDEO
PES Video.
#define DVB_MPEG_STREAM_MAP
PES Stream map.
#define DVB_MPEG_STREAM_PADDING
PES padding.
#define DVB_MPEG_STREAM_PRIVATE_2
PES private.
#define DVB_MPEG_STREAM_ECM
PES ECM Stream.
#define DVB_MPEG_STREAM_EMM
PES EMM Stream.
#define DVB_MPEG_STREAM_DIRECTORY
PES Stream directory.
#define DVB_MPEG_STREAM_DSMCC
PES DSMCC.
#define DVB_MPEG_STREAM_H222E
PES H.222.1 type E.
#define DVB_MPEG_TS
MPEG Transport Stream magic.
#define DVB_MPEG_TS_PACKET_SIZE
Size of an MPEG packet.
Typedefs
typedef void(* dvb_table_init_func) (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, void **table)
Function prototype for a function that initializes the descriptors parsing on a table.
typedef int(* dvb_desc_init_func) (struct dvb_v5_fe_parms *parms, const uint8_t *buf, struct dvb_desc *desc)
Function prototype for the descriptors parsing init code.
typedef void(* dvb_desc_print_func) (struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc)
Function prototype for the descriptors parsing print code.
typedef void(* dvb_desc_free_func) (struct dvb_desc *desc)
Function prototype for the descriptors memory free code.
typedef void nit_handler_callback_t(struct dvb_table_nit *nit, struct dvb_desc *desc, void *priv)
typedef for a callback used when a NIT table entry is found
typedef void nit_tran_handler_callback_t(struct dvb_table_nit *nit, struct dvb_table_nit_transport *tran, struct dvb_desc *desc, void *priv)
typedef for a callback used when a NIT transport table entry is found
typedef int(* dvb_desc_ext_init_func) (struct dvb_v5_fe_parms *parms, const uint8_t *buf, struct dvb_extension_descriptor *ext, void *desc)
Function prototype for the extended descriptors parsing init code.
typedef void(* dvb_desc_ext_print_func) (struct dvb_v5_fe_parms *parms, const struct dvb_extension_descriptor *ext, const void *desc)
Function prototype for the extended descriptors parsing print code.
typedef void(* dvb_desc_ext_free_func) (const void *desc)
Function prototype for the extended descriptors parsing free code.
Functions
uint32_t dvb_bcd (uint32_t bcd)
Converts from BCD to CPU integer internal representation.
void dvb_hexdump (struct dvb_v5_fe_parms *parms, const char *prefix, const unsigned char *buf, int len)
dumps data into the logs in hexadecimal format
int dvb_desc_parse (struct dvb_v5_fe_parms *parms, const uint8_t *buf, uint16_t buflen, struct dvb_desc **head_desc)
parse MPEG-TS descriptors
void dvb_desc_free (struct dvb_desc **list)
frees a dvb_desc linked list
void dvb_desc_print (struct dvb_v5_fe_parms *parms, struct dvb_desc *desc)
prints the contents of a struct dvb_desc linked list
void dvb_table_header_init (struct dvb_table_header *header)
Initializes and parses MPEG-TS table header.
void dvb_table_header_print (struct dvb_v5_fe_parms *parms, const struct dvb_table_header *header)
Prints the content of the MPEG-TS table header.
ssize_t atsc_table_eit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct atsc_table_eit **table)
Initializes and parses ATSC EIT table.
void atsc_table_eit_free (struct atsc_table_eit *table)
Frees all data allocated by the ATSC EIT table parser.
void atsc_table_eit_print (struct dvb_v5_fe_parms *parms, struct atsc_table_eit *table)
Prints the content of the ATSC EIT table.
ssize_t dvb_table_eit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_eit **table)
Initializes and parses EIT table.
void dvb_table_eit_free (struct dvb_table_eit *table)
Frees all data allocated by the DVB EIT table parser.
void dvb_table_eit_print (struct dvb_v5_fe_parms *parms, struct dvb_table_eit *table)
Prints the content of the DVB EIT table.
void dvb_time (const uint8_t data[5], struct tm *tm)
Converts a DVB EIT formatted timestamp into struct tm.
ssize_t atsc_table_mgt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct atsc_table_mgt **table)
Initializes and parses MGT table.
void atsc_table_mgt_free (struct atsc_table_mgt *table)
Frees all data allocated by the MGT table parser.
void atsc_table_mgt_print (struct dvb_v5_fe_parms *parms, struct atsc_table_mgt *table)
Prints the content of the MGT table.
ssize_t dvb_table_nit_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_nit **table)
Initializes and parses NIT table.
void dvb_table_nit_free (struct dvb_table_nit *table)
Frees all data allocated by the NIT table parser.
void dvb_table_nit_print (struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table)
Prints the content of the NIT table.
void dvb_table_nit_descriptor_handler (struct dvb_v5_fe_parms *parms, struct dvb_table_nit *table, enum descriptors descriptor, nit_handler_callback_t *call_nit, nit_tran_handler_callback_t *call_tran, void *priv)
For each entry at NIT and NIT transport tables, call a callback.
ssize_t dvb_table_pat_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_pat **table)
Initializes and parses PAT table.
void dvb_table_pat_free (struct dvb_table_pat *table)
Frees all data allocated by the PAT table parser.
void dvb_table_pat_print (struct dvb_v5_fe_parms *parms, struct dvb_table_pat *table)
Prints the content of the PAT table.
ssize_t dvb_table_pmt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_pmt **table)
Initializes and parses PMT table.
void dvb_table_pmt_free (struct dvb_table_pmt *table)
Frees all data allocated by the PMT table parser.
void dvb_table_pmt_print (struct dvb_v5_fe_parms *parms, const struct dvb_table_pmt *table)
Prints the content of the PAT table.
ssize_t dvb_table_sdt_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct dvb_table_sdt **table)
Initializes and parses SDT table.
void dvb_table_sdt_free (struct dvb_table_sdt *table)
Frees all data allocated by the SDT table parser.
void dvb_table_sdt_print (struct dvb_v5_fe_parms *parms, struct dvb_table_sdt *table)
Prints the content of the SDT table.
ssize_t atsc_table_vct_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, struct atsc_table_vct **table)
Initializes and parses VCT table.
void atsc_table_vct_free (struct atsc_table_vct *table)
Frees all data allocated by the VCT table parser.
void atsc_table_vct_print (struct dvb_v5_fe_parms *parms, struct atsc_table_vct *table)
Prints the content of the VCT table.
int dvb_mpeg_es_seq_start_init (const uint8_t *buf, ssize_t buflen, struct dvb_mpeg_es_seq_start *seq_start)
Initialize a struct dvb_mpeg_es_seq_start from buffer.
void dvb_mpeg_es_seq_start_print (struct dvb_v5_fe_parms *parms, struct dvb_mpeg_es_seq_start *seq_start)
Print details of struct dvb_mpeg_es_seq_start.
int dvb_mpeg_es_pic_start_init (const uint8_t *buf, ssize_t buflen, struct dvb_mpeg_es_pic_start *pic_start)
Initialize a struct dvb_mpeg_es_pic_start from buffer.
void dvb_mpeg_es_pic_start_print (struct dvb_v5_fe_parms *parms, struct dvb_mpeg_es_pic_start *pic_start)
Print details of struct dvb_mpeg_es_pic_start.
ssize_t dvb_mpeg_pes_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, uint8_t *table)
Initialize a struct dvb_mpeg_pes from buffer.
void dvb_mpeg_pes_free (struct dvb_mpeg_pes *pes)
Deallocate memory associated with a struct dvb_mpeg_pes.
void dvb_mpeg_pes_print (struct dvb_v5_fe_parms *parms, struct dvb_mpeg_pes *pes)
Print details of struct dvb_mpeg_pes.
ssize_t dvb_mpeg_ts_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, uint8_t *table, ssize_t *table_length)
Initialize a struct dvb_mpeg_ts from buffer.
void dvb_mpeg_ts_free (struct dvb_mpeg_ts *ts)
Deallocate memory associated with a struct dvb_mpeg_ts.
void dvb_mpeg_ts_print (struct dvb_v5_fe_parms *parms, struct dvb_mpeg_ts *ts)
Print details of struct dvb_mpeg_ts.
Variables
const dvb_table_init_func dvb_table_initializers [256]
Table with all possible descriptors.
const struct dvb_descriptor dvb_descriptors []
Contains the parsers for the several descriptors.
const char * pmt_stream_name []
Converts from enum dvb_streams into a string.
const char * dvb_mpeg_es_frame_names [5]
Vector that translates from enum dvb_mpeg_es_frame_t to string.
Detailed Description
Macro Definition Documentation
#define ATSC_BASE_PID
ATSC PID for the Program and System Information Protocol.
Definition at line 44 of file atsc_header.h.
#define atsc_eit_event_foreach(_event, _eit)
Macro used to find event on an ATSC EIT table.
Parameters
_event event to seek
_eit pointer to struct atsc_table_eit_event
Definition at line 160 of file atsc_eit.h.
#define ATSC_TABLE_CVCT
CVCT table ID.
Definition at line 60 of file vct.h.
#define ATSC_TABLE_EIT
ATSC EIT table ID.
Definition at line 53 of file atsc_eit.h.
#define ATSC_TABLE_MGT
ATSC MGT table ID.
Definition at line 51 of file mgt.h.
#define ATSC_TABLE_TVCT
TVCT table ID.
Definition at line 59 of file vct.h.
#define ATSC_TABLE_VCT_PID
Program ID with the VCT tables on it.
Definition at line 61 of file vct.h.
#define atsc_vct_channel_foreach(_channel, _vct)
Macro used to find channels on a VCT table.
Parameters
_channel channel to seek
_vct pointer to struct atsc_table_vct_channel
Definition at line 202 of file vct.h.
#define DVB_CRC_SIZE
number of bytes for the descriptor's CRC check
Definition at line 61 of file descriptors.h.
#define dvb_eit_event_foreach(_event, _eit)
Macro used to find event on a DVB EIT table.
Parameters
_event event to seek
_eit pointer to struct dvb_table_eit_event
Definition at line 162 of file eit.h.
#define DVB_MAX_PAYLOAD_PACKET_SIZE
Maximum size of a table session to be parsed.
Definition at line 55 of file descriptors.h.
#define DVB_MPEG_ES_GOP
Group Of Pictures.
Definition at line 67 of file mpeg_es.h.
#define DVB_MPEG_ES_PIC_START
Picture Start.
Definition at line 63 of file mpeg_es.h.
#define DVB_MPEG_ES_SEQ_EXT
Extension.
Definition at line 66 of file mpeg_es.h.
#define DVB_MPEG_ES_SEQ_START
Sequence Start.
Definition at line 65 of file mpeg_es.h.
#define DVB_MPEG_ES_SLICES
Slices.
Definition at line 68 of file mpeg_es.h.
#define DVB_MPEG_ES_USER_DATA
User Data.
Definition at line 64 of file mpeg_es.h.
#define DVB_MPEG_PES
MPEG Packetized Elementary Stream magic.
Definition at line 80 of file mpeg_pes.h.
#define DVB_MPEG_PES_AUDIO
PES Audio.
Definition at line 82 of file mpeg_pes.h.
#define DVB_MPEG_PES_VIDEO
PES Video.
Definition at line 83 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_DIRECTORY
PES Stream directory.
Definition at line 90 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_DSMCC
PES DSMCC.
Definition at line 91 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_ECM
PES ECM Stream.
Definition at line 88 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_EMM
PES EMM Stream.
Definition at line 89 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_H222E
PES H.222.1 type E.
Definition at line 92 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_MAP
PES Stream map.
Definition at line 85 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_PADDING
PES padding.
Definition at line 86 of file mpeg_pes.h.
#define DVB_MPEG_STREAM_PRIVATE_2
PES private.
Definition at line 87 of file mpeg_pes.h.
#define DVB_MPEG_TS
MPEG Transport Stream magic.
Definition at line 50 of file mpeg_ts.h.
#define DVB_MPEG_TS_PACKET_SIZE
Size of an MPEG packet.
Definition at line 51 of file mpeg_ts.h.
#define dvb_nit_transport_foreach(_tran, _nit)
Macro used to find a transport inside a NIT table.
Parameters
_tran transport to seek
_nit pointer to struct dvb_table_nit_transport
Definition at line 189 of file nit.h.
#define dvb_pat_program_foreach(_pgm, _pat)
Macro used to find programs on a PAT table.
Parameters
_pgm program to seek
_pat pointer to struct dvb_table_pat_program
Definition at line 121 of file pat.h.
#define dvb_pmt_stream_foreach(_stream, _pmt)
Macro used to find streams on a PMT table.
Parameters
_stream stream to seek
_pmt pointer to struct dvb_table_pmt_stream
Definition at line 249 of file pmt.h.
#define dvb_sdt_service_foreach(_service, _sdt)
Macro used to find services on a SDT table.
Parameters
_service service to seek
_sdt pointer to struct dvb_table_sdt_service
Definition at line 137 of file sdt.h.
#define DVB_TABLE_CAT
ATSC CAT table ID.
Definition at line 47 of file cat.h.
#define DVB_TABLE_CAT_PID
ATSC PID table ID.
Definition at line 48 of file cat.h.
#define DVB_TABLE_EIT
DVB EIT table ID for the actual TS.
Definition at line 68 of file eit.h.
#define DVB_TABLE_EIT_OTHER
DVB EIT table ID for other TS.
Definition at line 69 of file eit.h.
#define DVB_TABLE_EIT_PID
DVB EIT Program ID.
Definition at line 70 of file eit.h.
#define DVB_TABLE_EIT_SCHEDULE
Start table ID for the DVB EIT schedule data on the actual TS The range has 0x0f elements (0x50 to 0x5F).
Definition at line 72 of file eit.h.
#define DVB_TABLE_EIT_SCHEDULE_OTHER
Start table ID for the DVB EIT schedule data on other TS The range has 0x0f elements (0x60 to 0x6F).
Definition at line 73 of file eit.h.
#define DVB_TABLE_NIT
NIT table ID.
Definition at line 61 of file nit.h.
#define DVB_TABLE_NIT2
NIT table ID (alternative table ID)
Definition at line 62 of file nit.h.
#define DVB_TABLE_NIT_PID
NIT Program ID.
Definition at line 63 of file nit.h.
#define DVB_TABLE_PAT
PAT table ID.
Definition at line 55 of file pat.h.
#define DVB_TABLE_PAT_PID
PAT Program ID.
Definition at line 56 of file pat.h.
#define DVB_TABLE_PMT
PMT table ID.
Definition at line 52 of file pmt.h.
#define DVB_TABLE_SDT
SDT table ID.
Definition at line 58 of file sdt.h.
#define DVB_TABLE_SDT2
SDT table ID (alternative table ID)
Definition at line 59 of file sdt.h.
#define DVB_TABLE_SDT_PID
SDT Program ID.
Definition at line 60 of file sdt.h.
Typedef Documentation
typedef void(* dvb_desc_ext_free_func) (const void *desc)
Function prototype for the extended descriptors parsing free code.
- Parameters
desc struct dvb_desc pointer
Definition at line 157 of file desc_extension.h.
typedef int(* dvb_desc_ext_init_func) (struct dvb_v5_fe_parms *parms, const uint8_t *buf, struct dvb_extension_descriptor *ext, void *desc)
Function prototype for the extended descriptors parsing init code.
- Parameters
parms Struct dvb_v5_fe_parms pointer
buf buffer with the content of the descriptor
ext struct dvb_extension_descriptor pointer
desc struct dvb_desc pointer
Definition at line 135 of file desc_extension.h.
typedef void(* dvb_desc_ext_print_func) (struct dvb_v5_fe_parms *parms, const struct dvb_extension_descriptor *ext, const void *desc)
Function prototype for the extended descriptors parsing print code.
- Parameters
parms Struct dvb_v5_fe_parms pointer
buf buffer with the content of the descriptor
ext struct dvb_extension_descriptor pointer
desc struct dvb_desc pointer
Definition at line 148 of file desc_extension.h.
typedef void(* dvb_desc_free_func) (struct dvb_desc *desc)
Function prototype for the descriptors memory free code.
- Parameters
desc pointer to struct dvb_desc pointer to be freed
Definition at line 234 of file descriptors.h.
typedef int(* dvb_desc_init_func) (struct dvb_v5_fe_parms *parms, const uint8_t *buf, struct dvb_desc *desc)
Function prototype for the descriptors parsing init code.
- Parameters
parms Struct dvb_v5_fe_parms pointer
buf buffer with the content of the descriptor
desc struct dvb_desc pointer
Definition at line 215 of file descriptors.h.
typedef void(* dvb_desc_print_func) (struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc)
Function prototype for the descriptors parsing print code.
- Parameters
parms Struct dvb_v5_fe_parms pointer
desc struct dvb_desc pointer
Definition at line 225 of file descriptors.h.
typedef void(* dvb_table_init_func) (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, void **table)
Function prototype for a function that initializes the descriptors parsing on a table.
- Parameters
parms Struct dvb_v5_fe_parms pointer
buf Buffer with data to be parsed
buflen Size of the buffer to be parsed
table pointer to a place where the allocated memory with the table structure will be stored.
Definition at line 79 of file descriptors.h.
typedef void nit_handler_callback_t(struct dvb_table_nit *nit, struct dvb_desc *desc, void *priv)
typedef for a callback used when a NIT table entry is found
- Parameters
nit a struct dvb_table_nit pointer
desc a struct dvb_desc pointer
priv an opaque optional pointer
Definition at line 164 of file nit.h.
typedef void nit_tran_handler_callback_t(struct dvb_table_nit *nit, struct dvb_table_nit_transport *tran, struct dvb_desc *desc, void *priv)
typedef for a callback used when a NIT transport table entry is found
- Parameters
nit a struct dvb_table_nit pointer
tran a struct dvb_table_nit_transport pointer
desc a struct dvb_desc pointer
priv an opaque optional pointer
Definition at line 177 of file nit.h.
Function Documentation
void atsc_table_eit_free (struct atsc_table_eit * table)
Frees all data allocated by the ATSC EIT table parser.
- Parameters
table pointer to struct atsc_table_eit to be freed
ssize_t atsc_table_eit_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct atsc_table_eit ** table)
Initializes and parses ATSC EIT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the EIT raw data
buflen length of the buffer
table pointer to struct atsc_table_eit to be allocated and filled
This function allocates an ATSC EIT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void atsc_table_eit_print (struct dvb_v5_fe_parms * parms, struct atsc_table_eit * table)
Prints the content of the ATSC EIT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct atsc_table_eit
void atsc_table_mgt_free (struct atsc_table_mgt * table)
Frees all data allocated by the MGT table parser.
- Parameters
table pointer to struct atsc_table_mgt to be freed
ssize_t atsc_table_mgt_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct atsc_table_mgt ** table)
Initializes and parses MGT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the MGT raw data
buflen length of the buffer
table pointer to struct atsc_table_mgt to be allocated and filled
This function allocates an ATSC MGT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void atsc_table_mgt_print (struct dvb_v5_fe_parms * parms, struct atsc_table_mgt * table)
Prints the content of the MGT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct atsc_table_mgt
void atsc_table_vct_free (struct atsc_table_vct * table)
Frees all data allocated by the VCT table parser.
- Parameters
table pointer to struct atsc_table_vct to be freed
ssize_t atsc_table_vct_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct atsc_table_vct ** table)
Initializes and parses VCT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the VCT raw data
buflen length of the buffer
table pointer to struct atsc_table_vct to be allocated and filled
This function allocates an ATSC VCT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void atsc_table_vct_print (struct dvb_v5_fe_parms * parms, struct atsc_table_vct * table)
Prints the content of the VCT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct atsc_table_vct
uint32_t dvb_bcd (uint32_t bcd)
Converts from BCD to CPU integer internal representation.
- Parameters
bcd value in BCD encoding
void dvb_desc_free (struct dvb_desc ** list)
frees a dvb_desc linked list
- Parameters
list struct dvb_desc pointer.
int dvb_desc_parse (struct dvb_v5_fe_parms * parms, const uint8_t * buf, uint16_t buflen, struct dvb_desc ** head_desc)
parse MPEG-TS descriptors
- Parameters
parms Struct dvb_v5_fe_parms pointer
buf Buffer with data to be parsed
buflen Size of the buffer to be parsed
head_desc pointer to the place to store the parsed data
This function takes a buf as argument and parses it to find the MPEG-TS descriptors inside it, creating a linked list.
On success, head_desc will be allocated and filled with a linked list with the descriptors found inside the buffer.
This function is used by the several MPEG-TS table handlers to parse the entire table that got read by dvb_read_sessions and other similar functions.
- Returns
Returns 0 on success, a negative value otherwise.
void dvb_desc_print (struct dvb_v5_fe_parms * parms, struct dvb_desc * desc)
prints the contents of a struct dvb_desc linked list
- Parameters
parms Struct dvb_v5_fe_parms pointer
desc struct dvb_desc pointer.
void dvb_hexdump (struct dvb_v5_fe_parms * parms, const char * prefix, const unsigned char * buf, int len)
dumps data into the logs in hexadecimal format
- Parameters
parms Struct dvb_v5_fe_parms pointer
prefix String to be printed before the dvb_hexdump
buf Buffer to hex dump
len Number of bytes to show
int dvb_mpeg_es_pic_start_init (const uint8_t * buf, ssize_t buflen, struct dvb_mpeg_es_pic_start * pic_start)
Initialize a struct dvb_mpeg_es_pic_start from buffer.
- Parameters
buf Buffer
buflen Length of buffer
pic_start Pointer to allocated structdvb_mpeg_es_pic_start- Returns
If buflen too small, return -1, 0 otherwise.
This function copies the length of struct dvb_mpeg_es_pic_start to pic_start and fixes endianness. seq_start has to be allocated with malloc.
void dvb_mpeg_es_pic_start_print (struct dvb_v5_fe_parms * parms, struct dvb_mpeg_es_pic_start * pic_start)
Print details of struct dvb_mpeg_es_pic_start.
- Parameters
parms struct dvb_v5_fe_parms for log functions
pic_start Pointer to struct dvb_mpeg_es_pic_start to print
This function prints the fields of struct dvb_mpeg_es_pic_start
int dvb_mpeg_es_seq_start_init (const uint8_t * buf, ssize_t buflen, struct dvb_mpeg_es_seq_start * seq_start)
Initialize a struct dvb_mpeg_es_seq_start from buffer.
- Parameters
buf Buffer
buflen Length of buffer
seq_start Pointer to allocated struct dvb_mpeg_es_seq_start- Returns
If buflen too small, return -1, 0 otherwise.
This function copies the length of struct dvb_mpeg_es_seq_start to seq_start and fixes endianness. seq_start has to be allocated with malloc.
void dvb_mpeg_es_seq_start_print (struct dvb_v5_fe_parms * parms, struct dvb_mpeg_es_seq_start * seq_start)
Print details of struct dvb_mpeg_es_seq_start.
- Parameters
parms struct dvb_v5_fe_parms for log functions
seq_start Pointer to struct dvb_mpeg_es_seq_start to print
This function prints the fields of struct dvb_mpeg_es_seq_start
void dvb_mpeg_pes_free (struct dvb_mpeg_pes * pes)
Deallocate memory associated with a struct dvb_mpeg_pes.
- Parameters
pes struct dvb_mpeg_pes to be deallocated
If the pointer pes was allocated dynamically, this function can be used to free the memory.
ssize_t dvb_mpeg_pes_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, uint8_t * table)
Initialize a struct dvb_mpeg_pes from buffer.
- Parameters
parms struct dvb_v5_fe_parms for log functions
buf Buffer
buflen Length of buffer
table Pointer to allocated struct dvb_mpeg_pes- Returns
Length of data in table
This function copies the length of struct dvb_mpeg_pes to table and fixes endianness. The pointer table has to be allocated on stack or dynamically.
void dvb_mpeg_pes_print (struct dvb_v5_fe_parms * parms, struct dvb_mpeg_pes * pes)
Print details of struct dvb_mpeg_pes.
- Parameters
parms struct dvb_v5_fe_parms for log functions
pes Pointer to struct dvb_mpeg_pes to print
This function prints the fields of struct dvb_mpeg_pes
void dvb_mpeg_ts_free (struct dvb_mpeg_ts * ts)
Deallocate memory associated with a struct dvb_mpeg_ts.
- Parameters
ts struct dvb_mpeg_ts to be deallocated
If ts was allocated dynamically, this function can be used to free the memory.
ssize_t dvb_mpeg_ts_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, uint8_t * table, ssize_t * table_length)
Initialize a struct dvb_mpeg_ts from buffer.
- Parameters
parms struct dvb_v5_fe_parms for log functions
buf Buffer
buflen Length of buffer
table Pointer to allocated struct dvb_mpeg_ts
table_length Pointer to size_t where length will be written to- Returns
Length of data in table
This function copies the length of struct dvb_mpeg_ts to table and fixes endianness. The pointer table has to be allocated on stack or dynamically.
void dvb_mpeg_ts_print (struct dvb_v5_fe_parms * parms, struct dvb_mpeg_ts * ts)
Print details of struct dvb_mpeg_ts.
- Parameters
parms struct dvb_v5_fe_parms for log functions
ts Pointer to struct dvb_mpeg_ts to print
This function prints the fields of struct dvb_mpeg_ts
void dvb_table_eit_free (struct dvb_table_eit * table)
Frees all data allocated by the DVB EIT table parser.
- Parameters
table pointer to struct dvb_table_eit to be freed
ssize_t dvb_table_eit_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct dvb_table_eit ** table)
Initializes and parses EIT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the EIT raw data
buflen length of the buffer
table pointer to struct dvb_table_eit to be allocated and filled
This function allocates an EIT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void dvb_table_eit_print (struct dvb_v5_fe_parms * parms, struct dvb_table_eit * table)
Prints the content of the DVB EIT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct dvb_table_eit
void dvb_table_header_init (struct dvb_table_header * header)
Initializes and parses MPEG-TS table header.
- Parameters
header pointer to struct dvb_table_header to be parsed
void dvb_table_header_print (struct dvb_v5_fe_parms * parms, const struct dvb_table_header * header)
Prints the content of the MPEG-TS table header.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
header pointer to struct dvb_table_header to be printed
void dvb_table_nit_descriptor_handler (struct dvb_v5_fe_parms * parms, struct dvb_table_nit * table, enum descriptors descriptor, nit_handler_callback_t * call_nit, nit_tran_handler_callback_t * call_tran, void * priv)
For each entry at NIT and NIT transport tables, call a callback.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct dvb_table_nit
descriptor indicates the NIT table descriptor to seek
call_nit a nit_handler_callback_t function to be called when a new entry at the NIT table is found (or NULL).
call_tran a nit_tran_handler_callback_t function to be called when a new entry at the NIT transport table is found (or NULL).
priv an opaque pointer to be optionally used by the callbacks. The function won't touch on it, just use as an argument for the callback functions.
When parsing a NIT entry, we need to call some code to properly handle when a given descriptor in the table is found. This is used, for example, to create newer transponders to seek during scan.
For example, to seek for the CATV delivery system descriptor and call a function that would add a new transponder to a scan procedure:
dvb_table_nit_descriptor_handler( &parms->p, dvb_scan_handler->nit, cable_delivery_system_descriptor, NULL, add_update_nit_dvbc, &tr);
void dvb_table_nit_free (struct dvb_table_nit * table)
Frees all data allocated by the NIT table parser.
- Parameters
table pointer to struct dvb_table_nit to be freed
ssize_t dvb_table_nit_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct dvb_table_nit ** table)
Initializes and parses NIT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the NIT raw data
buflen length of the buffer
table pointer to struct dvb_table_nit to be allocated and filled
This function allocates a NIT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void dvb_table_nit_print (struct dvb_v5_fe_parms * parms, struct dvb_table_nit * table)
Prints the content of the NIT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct dvb_table_nit
void dvb_table_pat_free (struct dvb_table_pat * table)
Frees all data allocated by the PAT table parser.
- Parameters
table pointer to struct dvb_table_pat to be freed
ssize_t dvb_table_pat_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct dvb_table_pat ** table)
Initializes and parses PAT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the PAT raw data
buflen length of the buffer
table pointer to struct dvb_table_pat to be allocated and filled
This function allocates a PAT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void dvb_table_pat_print (struct dvb_v5_fe_parms * parms, struct dvb_table_pat * table)
Prints the content of the PAT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct dvb_table_pat
void dvb_table_pmt_free (struct dvb_table_pmt * table)
Frees all data allocated by the PMT table parser.
- Parameters
table pointer to struct dvb_table_pmt to be freed
ssize_t dvb_table_pmt_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct dvb_table_pmt ** table)
Initializes and parses PMT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the PMT raw data
buflen length of the buffer
table pointer to struct dvb_table_pmt to be allocated and filled
This function allocates a PMT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void dvb_table_pmt_print (struct dvb_v5_fe_parms * parms, const struct dvb_table_pmt * table)
Prints the content of the PAT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct dvb_table_pmt
void dvb_table_sdt_free (struct dvb_table_sdt * table)
Frees all data allocated by the SDT table parser.
- Parameters
table pointer to struct dvb_table_sdt to be freed
ssize_t dvb_table_sdt_init (struct dvb_v5_fe_parms * parms, const uint8_t * buf, ssize_t buflen, struct dvb_table_sdt ** table)
Initializes and parses SDT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
buf buffer containing the SDT raw data
buflen length of the buffer
table pointer to struct dvb_table_sdt to be allocated and filled
This function allocates a SDT table and fills the fields inside the struct. It also makes sure that all fields will follow the CPU endianness. Due to that, the content of the buffer may change.
- Returns
On success, it returns the size of the allocated struct. A negative value indicates an error.
void dvb_table_sdt_print (struct dvb_v5_fe_parms * parms, struct dvb_table_sdt * table)
Prints the content of the SDT table.
- Parameters
parms struct dvb_v5_fe_parms pointer to the opened device
table pointer to struct dvb_table_sdt
void dvb_time (const uint8_t data[5], struct tm * tm)
Converts a DVB EIT formatted timestamp into struct tm.
- Parameters
data event on DVB EIT time format
tm pointer to struct tm where the converted timestamp will be stored.
Variable Documentation
const struct dvb_descriptor dvb_descriptors[] [extern]
Contains the parsers for the several descriptors.
const char* dvb_mpeg_es_frame_names[5] [extern]
Vector that translates from enum dvb_mpeg_es_frame_t to string.
const dvb_table_init_func dvb_table_initializers[256] [extern]
Table with all possible descriptors.
const char* pmt_stream_name[] [extern]
Converts from enum dvb_streams into a string.
Author
Generated automatically by Doxygen for libdvbv5 from the source code.