libdvbpsi  1.2.0
Data Structures | Typedefs | Functions
bat.h File Reference

Application interface for the BAT decoder. More...

Go to the source code of this file.

Data Structures

struct  dvbpsi_bat_ts_s
 BAT transport stream description structure. More...
struct  dvbpsi_bat_s
 BAT structure. More...

Typedefs

typedef struct dvbpsi_bat_ts_s dvbpsi_bat_ts_t
 dvbpsi_bat_ts_t type definition.
typedef struct dvbpsi_bat_s dvbpsi_bat_t
 dvbpsi_bat_t type definition.
typedef void(* dvbpsi_bat_callback )(void *p_cb_data, dvbpsi_bat_t *p_new_bat)
 Callback type definition.

Functions

bool dvbpsi_bat_attach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_bat_callback pf_callback, void *p_cb_data)
 Creation and initialization of a BAT decoder. It will be attached to p_dvbpsi.
void dvbpsi_bat_detach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
 Destroy a BAT decoder.
void dvbpsi_bat_init (dvbpsi_bat_t *p_bat, uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next)
 Initialize a user-allocated dvbpsi_bat_t structure.
dvbpsi_bat_tdvbpsi_bat_new (uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next)
 Allocate and initialize a new dvbpsi_bat_t structure.
void dvbpsi_bat_empty (dvbpsi_bat_t *p_bat)
 Clean a dvbpsi_bat_t structure.
void dvbpsi_bat_delete (dvbpsi_bat_t *p_bat)
 Clean and free a dvbpsi_bat_t structure.
dvbpsi_descriptor_tdvbpsi_bat_bouquet_descriptor_add (dvbpsi_bat_t *p_bat, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
 Add a descriptor in the BAT.
dvbpsi_bat_ts_tdvbpsi_bat_ts_add (dvbpsi_bat_t *p_bat, uint16_t i_ts_id, uint16_t i_orig_network_id)
 Add a TS description at the end of the BAT.
dvbpsi_descriptor_tdvbpsi_bat_ts_descriptor_add (dvbpsi_bat_ts_t *p_bat, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
 Add a descriptor in the BAT TS descriptors.
dvbpsi_psi_section_tdvbpsi_bat_sections_generate (dvbpsi_t *p_dvbpsi, dvbpsi_bat_t *p_bat)
 BAT generator.

Detailed Description

Application interface for the BAT decoder.

Author
Zhu zhenglu zhuzl.nosp@m.u@gm.nosp@m.ail.c.nosp@m.om Application interface for the BAT decoder. New decoded BAT are sent by callback to the application. If a table wasn't active (b_current_next == false) and the next is the same but active (b_current_next == true) then the service description list is empty and should be caught from the previous structure. This is a simulation to sdt.h

Function Documentation

bool dvbpsi_bat_attach ( dvbpsi_t p_dvbpsi,
uint8_t  i_table_id,
uint16_t  i_extension,
dvbpsi_bat_callback  pf_callback,
void *  p_cb_data 
)

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

Parameters
p_dvbpsidvbpsi handle to Subtable demultiplexor to which the decoder is attached.
i_table_idTable ID, 0x4a.
i_extensionTable ID extension, here bouquet ID.
pf_callbackfunction to call back on new BAT.
p_cb_dataprivate data given in argument to the callback.
Returns
true on success, false on failure
dvbpsi_descriptor_t * dvbpsi_bat_bouquet_descriptor_add ( dvbpsi_bat_t p_bat,
uint8_t  i_tag,
uint8_t  i_length,
uint8_t *  p_data 
)

Add a descriptor in the BAT.

Parameters
p_batpointer to the BAT structure
i_tagdescriptor's tag
i_lengthdescriptor's length
p_datadescriptor's data
Returns
a pointer to the added descriptor.
dvbpsi_bat_delete ( dvbpsi_bat_t p_bat)

Clean and free a dvbpsi_bat_t structure.

Parameters
p_batpointer to the BAT structure
Returns
nothing.
void dvbpsi_bat_detach ( dvbpsi_t p_dvbpsi,
uint8_t  i_table_id,
uint16_t  i_extension 
)

Destroy a BAT decoder.

Parameters
p_dvbpsidvbpsi handle to Subtable demultiplexor to which the decoder is attached.
i_table_idTable ID, 0x4a.
i_extensionTable ID extension, here bouquet ID.
Returns
nothing.
void dvbpsi_bat_empty ( dvbpsi_bat_t p_bat)

Clean a dvbpsi_bat_t structure.

Parameters
p_batpointer to the BAT structure
Returns
nothing.
void dvbpsi_bat_init ( dvbpsi_bat_t p_bat,
uint8_t  i_table_id,
uint16_t  i_extension,
uint8_t  i_version,
bool  b_current_next 
)

Initialize a user-allocated dvbpsi_bat_t structure.

Parameters
p_batpointer to the BAT structure
i_table_idTable ID, 0x4a.
i_extensionTable ID extension, here bouquet ID.
i_versionBAT version
b_current_nextcurrent next indicator
Returns
nothing.
dvbpsi_bat_t * dvbpsi_bat_new ( uint8_t  i_table_id,
uint16_t  i_extension,
uint8_t  i_version,
bool  b_current_next 
)

Allocate and initialize a new dvbpsi_bat_t structure.

Parameters
i_table_idTable ID, 0x4a.
i_extensionTable ID extension, here bouquet ID.
i_versionBAT version
b_current_nextcurrent next indicator
Returns
p_bat pointer to the BAT structure
dvbpsi_psi_section_t * dvbpsi_bat_sections_generate ( dvbpsi_t p_dvbpsi,
dvbpsi_bat_t p_bat 
)

BAT generator.

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

Generate BAT sections based on the dvbpsi_bat_t structure.

dvbpsi_descriptor_t * dvbpsi_bat_ts_add ( dvbpsi_bat_t p_bat,
uint16_t  i_ts_id,
uint16_t  i_orig_network_id 
)

Add a TS description at the end of the BAT.

Parameters
p_batpointer to the BAT structure
i_ts_iddescriptor's transport stream id
i_orig_network_iddescriptor's original network id
Returns
a pointer to the added descriptor.
dvbpsi_descriptor_t * dvbpsi_bat_ts_descriptor_add ( dvbpsi_bat_ts_t p_bat,
uint8_t  i_tag,
uint8_t  i_length,
uint8_t *  p_data 
)

Add a descriptor in the BAT TS descriptors.

Parameters
p_batpointer to the BAT structure
i_tagdescriptor number
i_lengthlength of descriptor in bytes
p_datapointer to descriptor data
Returns
a pointer to the added descriptor.