libdvbpsi  2.0.0-git
MPEG Transport Stream PSI table parser
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_priv, 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_priv)
 
void dvbpsi_bat_detach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
 Destroy a BAT decoder. More...
 
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. More...
 
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. More...
 
void dvbpsi_bat_empty (dvbpsi_bat_t *p_bat)
 Clean a dvbpsi_bat_t structure. More...
 
void dvbpsi_bat_delete (dvbpsi_bat_t *p_bat)
 Clean and free a dvbpsi_bat_t structure. More...
 
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. More...
 
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. More...
 
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. More...
 
dvbpsi_psi_section_tdvbpsi_bat_sections_generate (dvbpsi_t *p_dvbpsi, dvbpsi_bat_t *p_bat)
 

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

◆ dvbpsi_bat_bouquet_descriptor_add()

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_delete ( dvbpsi_bat_t p_bat)

Clean and free a dvbpsi_bat_t structure.

Parameters
p_batpointer to the BAT structure
Returns
nothing.

◆ dvbpsi_bat_detach()

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.

◆ dvbpsi_bat_empty()

void dvbpsi_bat_empty ( dvbpsi_bat_t p_bat)

Clean a dvbpsi_bat_t structure.

Parameters
p_batpointer to the BAT structure
Returns
nothing.

◆ dvbpsi_bat_init()

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_new()

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_bat_ts_add()

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_bat_ts_descriptor_add()

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.