libdvbpsi  1.2.0
Data Structures | Typedefs | Functions | Variables
tot.h File Reference

Application interface for the TDT/TOT decoder and the TDT/TOT generator. More...

Go to the source code of this file.

Data Structures

struct  dvbpsi_tot_s
 TDT/TOT structure. More...

Typedefs

typedef void(* dvbpsi_tot_callback )(void *p_cb_data, dvbpsi_tot_t *p_new_tot)
 Callback type definition.

Functions

struct dvbpsi_tot_s __attribute__ ((packed)) dvbpsi_tot_t
bool dvbpsi_tot_attach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, dvbpsi_tot_callback pf_callback, void *p_cb_data)
 Creation and initialization of a TDT/TOT decoder.
void dvbpsi_tot_detach (dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
 Destroy a TDT/TOT decoder.
void dvbpsi_tot_init (dvbpsi_tot_t *p_tot, uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint64_t i_utc_time)
 Initialize a user-allocated dvbpsi_tot_t structure.
dvbpsi_tot_t * dvbpsi_tot_new (uint8_t i_table_id, uint16_t i_extension, uint8_t i_version, bool b_current_next, uint64_t i_utc_time)
 Allocate and initialize a new dvbpsi_tot_t structure.
void dvbpsi_tot_empty (dvbpsi_tot_t *p_tot)
 Clean a dvbpsi_tot_t structure.
void dvbpsi_tot_delete (dvbpsi_tot_t *p_tot)
 Clean and free a dvbpsi_tot_t structure.
dvbpsi_descriptor_tdvbpsi_tot_descriptor_add (dvbpsi_tot_t *p_tot, uint8_t i_tag, uint8_t i_length, uint8_t *p_data)
 Add a descriptor in the TOT.
dvbpsi_psi_section_tdvbpsi_tot_sections_generate (dvbpsi_t *p_dvbpsi, dvbpsi_tot_t *p_tot)
 TDT/TOT generator.

Variables

uint8_t i_table_id
uint16_t i_extension
uint8_t i_version
bool b_current_next
uint64_t i_utc_time
dvbpsi_descriptor_tp_first_descriptor

Detailed Description

Application interface for the TDT/TOT decoder and the TDT/TOT generator.

>

Author
Johann Hanne Application interface for the TDT (Time and Date Table)/TOT (Time Offset Table) decoder and the TDT/TOT generator. New decoded TDT/TOT tables are sent by callback to the application.

Function Documentation

bool dvbpsi_tot_attach ( dvbpsi_t p_dvbpsi,
uint8_t  i_table_id,
uint16_t  i_extension,
dvbpsi_tot_callback  pf_callback,
void *  p_cb_data 
)

Creation and initialization of a TDT/TOT decoder.

Parameters
p_dvbpsidvbpsi handle pointing to Subtable demultiplexor to which the decoder is attached.
i_table_idTable ID, usually 0x70
i_extensionTable ID extension, unused in the TDT/TOT
pf_callbackfunction to call back on new TDT/TOT.
p_cb_dataprivate data given in argument to the callback.
Returns
true on success, false on failure
dvbpsi_tot_delete ( dvbpsi_tot_t *  p_tot)

Clean and free a dvbpsi_tot_t structure.

Parameters
p_totpointer to the TDT/TOT structure
Returns
nothing.
dvbpsi_descriptor_t * dvbpsi_tot_descriptor_add ( dvbpsi_tot_t *  p_tot,
uint8_t  i_tag,
uint8_t  i_length,
uint8_t *  p_data 
)

Add a descriptor in the TOT.

Parameters
p_totpointer to the TOT structure
i_tagdescriptor's tag
i_lengthdescriptor's length
p_datadescriptor's data
Returns
a pointer to the added descriptor.
int dvbpsi_tot_detach ( dvbpsi_t p_dvbpsi,
uint8_t  i_table_id,
uint16_t  i_extension 
)

Destroy a TDT/TOT decoder.

Parameters
p_dvbpsiSubtable demultiplexor to which the decoder is attached.
i_table_idTable ID, usually 0x70
i_extensionTable ID extension, unused in the TDT/TOT
Returns
nothing.
void dvbpsi_tot_empty ( dvbpsi_tot_t *  p_tot)

Clean a dvbpsi_tot_t structure.

Parameters
p_totpointer to the TDT/TOT structure
Returns
nothing.
void dvbpsi_tot_init ( dvbpsi_tot_t *  p_tot,
uint8_t  i_table_id,
uint16_t  i_extension,
uint8_t  i_version,
bool  b_current_next,
uint64_t  i_utc_time 
)

Initialize a user-allocated dvbpsi_tot_t structure.

Parameters
p_totpointer to the TDT/TOT structure
i_table_idTable ID, usually 0x70
i_extensionTable ID extension, unused in the TDT/TOT
i_versionSDT version
b_current_nextcurrent next indicator
i_utc_timethe time in UTC
Returns
nothing.
dvbpsi_tot_t * dvbpsi_tot_new ( uint8_t  i_table_id,
uint16_t  i_extension,
uint8_t  i_version,
bool  b_current_next,
uint64_t  i_utc_time 
)

Allocate and initialize a new dvbpsi_tot_t structure.

Parameters
i_table_idTable ID, usually 0x70
i_extensionTable ID extension, unused in the TDT/TOT
i_versionSDT version
b_current_nextcurrent next indicator
i_utc_timethe time in UTC
Returns
p_tot pointer to the TDT/TOT structure
dvbpsi_psi_section_t * dvbpsi_tot_sections_generate ( dvbpsi_t p_dvbpsi,
dvbpsi_tot_t *  p_tot 
)

TDT/TOT generator.

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

Generate TDT/TOT sections based on the dvbpsi_tot_t structure.

Variable Documentation

bool b_current_next

current_next_indicator

uint16_t i_extension

subtable id

uint8_t i_table_id

table id

uint64_t i_utc_time

UTC_time

uint8_t i_version

version_number

dvbpsi_descriptor_t* p_first_descriptor

descriptor list