libdvbpsi  2.0.0-git
Data Structures | Typedefs | Functions
nit.h File Reference

Application interface for the NIT decoder and the NIT generator. More...

Go to the source code of this file.

Data Structures

struct  dvbpsi_nit_ts_s
 NIT TS structure. More...
 
struct  dvbpsi_nit_s
 NIT structure. More...
 

Typedefs

typedef struct dvbpsi_nit_ts_s dvbpsi_nit_ts_t
 dvbpsi_nit_ts_t type definition.
 
typedef struct dvbpsi_nit_s dvbpsi_nit_t
 dvbpsi_nit_t type definition.
 
typedef void(* dvbpsi_nit_callback )(void *p_cb_data, dvbpsi_nit_t *p_new_nit)
 Callback type definition.
 

Functions

bool dvbpsi_nit_attach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_nit_callback pf_callback, void *p_cb_data)
 Creation and initialization of a NIT decoder. It is attached to p_dvbpsi. More...
 
void dvbpsi_nit_detach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
 Destroy a NIT decoder. More...
 
void dvbpsi_nit_init (dvbpsi_nit_t *p_nit, uint8_t i_table_id, uint16_t i_extension, uint16_t i_network_id, uint8_t i_version, bool b_current_next)
 Initialize a user-allocated dvbpsi_nit_t structure. More...
 
dvbpsi_nit_tdvbpsi_nit_new (uint8_t i_table_id, uint16_t i_extension, uint16_t i_network_id, uint8_t i_version, bool b_current_next)
 Allocate and initialize a new dvbpsi_nit_t structure. More...
 
void dvbpsi_nit_empty (dvbpsi_nit_t *p_nit)
 Clean a dvbpsi_nit_t structure. More...
 
void dvbpsi_nit_delete (dvbpsi_nit_t *p_nit)
 Clean and free a dvbpsi_nit_t structure. More...
 
dvbpsi_descriptor_tdvbpsi_nit_descriptor_add (dvbpsi_nit_t *p_nit, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
 Add a descriptor in the NIT. More...
 
dvbpsi_nit_ts_tdvbpsi_nit_ts_add (dvbpsi_nit_t *p_nit, uint16_t i_ts_id, uint16_t i_orig_network_id)
 Add an TS in the NIT. More...
 
dvbpsi_descriptor_tdvbpsi_nit_ts_descriptor_add (dvbpsi_nit_ts_t *p_ts, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
 Add a descriptor in the NIT TS. More...
 
dvbpsi_psi_section_tdvbpsi_nit_sections_generate (dvbpsi_t *p_dvbpsi, dvbpsi_nit_t *p_nit, uint8_t i_table_id)
 NIT generator. More...
 

Detailed Description

Application interface for the NIT decoder and the NIT generator.

Author
Johann Hanne Application interface for the NIT decoder and the NIT generator. New decoded NIT tables are sent by callback to the application.

Function Documentation

bool dvbpsi_nit_attach ( dvbpsi_t p_dvbpsi,
uint8_t  i_table_id,
uint16_t  i_extension,
dvbpsi_nit_callback  pf_callback,
void *  p_cb_data 
)

Creation and initialization of a NIT decoder. It is attached to p_dvbpsi.

Parameters
p_dvbpsidvbpsi handle to Subtable demultiplexor to which the decoder is attached.
i_table_idTable ID, 0x40 (actual) or 0x41 (other).
i_extensionTable ID extension, here network ID.
pf_callbackfunction to call back on new NIT.
p_cb_dataprivate data given in argument to the callback.
Returns
true on success, false on failure
dvbpsi_nit_delete ( dvbpsi_nit_t p_nit)

Clean and free a dvbpsi_nit_t structure.

Parameters
p_nitpointer to the NIT structure
Returns
nothing.
dvbpsi_descriptor_t * dvbpsi_nit_descriptor_add ( dvbpsi_nit_t p_nit,
uint8_t  i_tag,
uint8_t  i_length,
uint8_t *  p_data 
)

Add a descriptor in the NIT.

Parameters
p_nitpointer to the NIT structure
i_tagdescriptor's tag
i_lengthdescriptor's length
p_datadescriptor's data
Returns
a pointer to the added descriptor.
void dvbpsi_nit_detach ( dvbpsi_t p_dvbpsi,
uint8_t  i_table_id,
uint16_t  i_extension 
)

Destroy a NIT decoder.

Parameters
p_dvbpsidvbpsi handle to Subtable demultiplexor to which the decoder is attached.
i_table_idTable ID, 0x40 (actual) or 0x41 (other).
i_extensionTable ID extension, here network ID.
Returns
nothing.
void dvbpsi_nit_empty ( dvbpsi_nit_t p_nit)

Clean a dvbpsi_nit_t structure.

Parameters
p_nitpointer to the NIT structure
Returns
nothing.
void dvbpsi_nit_init ( dvbpsi_nit_t p_nit,
uint8_t  i_table_id,
uint16_t  i_extension,
uint16_t  i_network_id,
uint8_t  i_version,
bool  b_current_next 
)

Initialize a user-allocated dvbpsi_nit_t structure.

Parameters
i_table_idTable ID, 0x40 (actual) or 0x41 (other).
i_extensionTable ID extension, here network ID.
p_nitpointer to the NIT structure
i_network_idnetwork id
i_versionNIT version
b_current_nextcurrent next indicator
Returns
nothing.
dvbpsi_nit_t * dvbpsi_nit_new ( uint8_t  i_table_id,
uint16_t  i_extension,
uint16_t  i_network_id,
uint8_t  i_version,
bool  b_current_next 
)

Allocate and initialize a new dvbpsi_nit_t structure.

Parameters
i_table_idTable ID, 0x40 (actual) or 0x41 (other)
i_extensionTable ID extension, here network ID.
i_network_idnetwork id
i_versionNIT version
b_current_nextcurrent next indicator
Returns
p_nit pointer to the NIT structure
dvbpsi_psi_section_t * dvbpsi_nit_sections_generate ( dvbpsi_t p_dvbpsi,
dvbpsi_nit_t p_nit,
uint8_t  i_table_id 
)

NIT generator.

Parameters
p_dvbpsihandle to dvbpsi with attached decoder
p_nitNIT structure
i_table_idtable id, 0x40 = actual network / 0x41 = other network
Returns
a pointer to the list of generated PSI sections.

Generate NIT sections based on the dvbpsi_nit_t structure.

dvbpsi_nit_ts_t * dvbpsi_nit_ts_add ( dvbpsi_nit_t p_nit,
uint16_t  i_ts_id,
uint16_t  i_orig_network_id 
)

Add an TS in the NIT.

Parameters
p_nitpointer to the NIT structure
i_ts_idtype of TS
i_orig_network_idPID of the TS
Returns
a pointer to the added TS.
dvbpsi_descriptor_t * dvbpsi_nit_ts_descriptor_add ( dvbpsi_nit_ts_t p_ts,
uint8_t  i_tag,
uint8_t  i_length,
uint8_t *  p_data 
)

Add a descriptor in the NIT TS.

Parameters
p_tspointer to the TS structure
i_tagdescriptor's tag
i_lengthdescriptor's length
p_datadescriptor's data
Returns
a pointer to the added descriptor.