libdvbpsi 2.0.0-git
MPEG Transport Stream PSI table parser
cat.h File Reference

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

Go to the source code of this file.

Data Structures

struct  dvbpsi_cat_s
 CAT structure. More...
 

Typedefs

typedef struct dvbpsi_cat_s dvbpsi_cat_t
 dvbpsi_cat_t type definition.
 
typedef void(* dvbpsi_cat_callback) (void *p_priv, dvbpsi_cat_t *p_new_cat)
 Callback type definition.
 

Functions

bool dvbpsi_cat_attach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_cat_callback pf_callback, void *p_priv)
 Creation and initialization of a CAT decoder. It will be attached to p_dvbpsi.
 
void dvbpsi_cat_detach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
 Destroy a CAT decoder.
 
void dvbpsi_cat_init (dvbpsi_cat_t *p_cat, uint8_t i_version, bool b_current_next)
 Initialize a user-allocated dvbpsi_cat_t structure.
 
dvbpsi_cat_tdvbpsi_cat_new (uint8_t i_version, bool b_current_next)
 Allocate and initialize a new dvbpsi_cat_t structure.
 
void dvbpsi_cat_empty (dvbpsi_cat_t *p_cat)
 Clean a dvbpsi_cat_t structure.
 
void dvbpsi_cat_delete (dvbpsi_cat_t *p_cat)
 Clean and free a dvbpsi_cat_t structure.
 
dvbpsi_descriptor_tdvbpsi_cat_descriptor_add (dvbpsi_cat_t *p_cat, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
 Add a descriptor in the CAT.
 
dvbpsi_psi_section_tdvbpsi_cat_sections_generate (dvbpsi_t *p_dvbpsi, dvbpsi_cat_t *p_cat)
 CAT generator.
 

Detailed Description

Application interface for the CAT decoder and the CAT generator.

>

Author
Arnaud de Bossoreille de Ribou bozo@.nosp@m.via..nosp@m.ecp.f.nosp@m.r

Application interface for the CAT decoder and the CAT generator. New decoded CAT tables are sent by callback to the application.

Function Documentation

◆ dvbpsi_cat_attach()

bool dvbpsi_cat_attach ( dvbpsi_t * p_dvbpsi,
uint8_t i_table_id,
uint16_t i_extension,
dvbpsi_cat_callback pf_callback,
void * p_priv )

Creation and initialization of a CAT decoder. It will be attached to p_dvbpsi.

Parameters
p_dvbpsiis a pointer to dvbpsi_t which holds a pointer to the decoder
i_table_idTable ID, here 0x01
i_extensionTable ID extension.
pf_callbackfunction to call back on new CAT
p_privprivate data given in argument to the callback
Returns
true on success, false on failure

◆ dvbpsi_cat_delete()

void dvbpsi_cat_delete ( dvbpsi_cat_t * p_cat)

Clean and free a dvbpsi_cat_t structure.

Parameters
p_catpointer to the CAT structure
Returns
nothing.

◆ dvbpsi_cat_descriptor_add()

dvbpsi_descriptor_t * dvbpsi_cat_descriptor_add ( dvbpsi_cat_t * p_cat,
uint8_t i_tag,
uint8_t i_length,
uint8_t * p_data )

Add a descriptor in the CAT.

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

◆ dvbpsi_cat_detach()

void dvbpsi_cat_detach ( dvbpsi_t * p_dvbpsi,
uint8_t i_table_id,
uint16_t i_extension )

Destroy a CAT decoder.

Parameters
p_dvbpsihandle to dvbpsi with attached decoder
i_table_idTable ID, here 0x01
i_extensionTable ID extension.
Returns
nothing.

The handle isn't valid any more.

◆ dvbpsi_cat_empty()

void dvbpsi_cat_empty ( dvbpsi_cat_t * p_cat)

Clean a dvbpsi_cat_t structure.

Parameters
p_catpointer to the CAT structure
Returns
nothing.

◆ dvbpsi_cat_init()

void dvbpsi_cat_init ( dvbpsi_cat_t * p_cat,
uint8_t i_version,
bool b_current_next )

Initialize a user-allocated dvbpsi_cat_t structure.

Parameters
p_catpointer to the CAT structure
i_versionCAT version
b_current_nextcurrent next indicator
Returns
nothing.

◆ dvbpsi_cat_new()

dvbpsi_cat_t * dvbpsi_cat_new ( uint8_t i_version,
bool b_current_next )

Allocate and initialize a new dvbpsi_cat_t structure.

Parameters
i_versionCAT version
b_current_nextcurrent next indicator
Returns
p_cat pointer to the CAT structure

◆ dvbpsi_cat_sections_generate()

dvbpsi_psi_section_t * dvbpsi_cat_sections_generate ( dvbpsi_t * p_dvbpsi,
dvbpsi_cat_t * p_cat )

CAT generator.

Parameters
p_dvbpsihandle to dvbpsi with attached decoder
p_catCAT structure
Returns
a pointer to the list of generated PSI sections.

Generate CAT sections based on the dvbpsi_cat_t structure.