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

Chain PSI table decoders for demuxing based on table_id and extension. More...

Go to the source code of this file.

Functions

bool dvbpsi_chain_demux_new (dvbpsi_t *p_dvbpsi, dvbpsi_callback_new_t pf_new, dvbpsi_callback_del_t pf_del, void *p_data)
 dvbpsi_chain_demux_new creates a decoder for demuxing PSI tables and subtables. More...
 
bool dvbpsi_chain_demux_delete (dvbpsi_t *p_dvbpsi)
 dvbpsi_chain_demux_delete walks the chain of PSI (sub-)table decoders and removes them from the chain before calling its pf_detach callback. The pointers to the PSI (sub-)table decoders are no longer valid after this function has been called. Nor is the decoder chain list valid. More...
 
bool dvbpsi_decoder_chain_add (dvbpsi_t *p_dvbpsi, dvbpsi_decoder_t *p_decoder)
 Adds decoder to the chain in handle 'p_dvbpsi' at dvbpsi_t::dvbpsi_decoder_t. More...
 
bool dvbpsi_decoder_chain_remove (dvbpsi_t *p_dvbpsi, const dvbpsi_decoder_t *p_decoder)
 Deletes decoder from the chain in handle 'p_dvbpsi' at dvbpsi_t::dvbpsi_decoder_t. More...
 
dvbpsi_decoder_tdvbpsi_decoder_chain_get (dvbpsi_t *p_dvbpsi, const uint16_t table_id, const uint16_t extension)
 Gets decoder from the chain based on given table_id and extension. If extension is 0, then the search is performed on table_id only and the first match is returned. More...
 

Detailed Description

Chain PSI table decoders for demuxing based on table_id and extension.

>

Author
Jean-Paul Saman jpsam.nosp@m.an@v.nosp@m.ideol.nosp@m.an.o.nosp@m.rg

Chain PSI table decoders for demuxing based on table_id and extension. The decoder chain is kept inside the dvbpsi_t handle at the dvbpsi_t::dvbpsi_decoder_t member variable.

Note
: The use of demux.h API's has been discontinued and replaced by the API's in this description. The table below shows how a mapping from old to new API's:

- Old demux API from demux.h | is replaced by chain.h -

- dvbspi_DetachDemuxSubDecoder | @see dvbpsi_decoder_chain_remove -

Note that for dvbpsi_Demux(), dvbpsi_NewDemuxSubDecoder(), dvbpsi_AttachDemuxSubDecoder(), and dvbspi_DetachDemuxSubDecoder() no replacement API is available. These functions are discontinued since the dvbpsi_subdec_t indirection has been removed. A dvbpsi_decoder_t can be added in a demux chain directly using dvbpsi_decoder_chain_add() or removed using dvbpsi_decoder_chain_remove() API. It is IMPORTANT to use the API call dvbpsi_demux_chain_new(), since that will install the callback function dvbpsi_decoder_chain_demux(). This will do the same job dvbpsi_Demux() function had in the subsdecoder architecture of demux.h.

Function Documentation

◆ dvbpsi_chain_demux_delete()

bool dvbpsi_chain_demux_delete ( dvbpsi_t p_dvbpsi)

dvbpsi_chain_demux_delete walks the chain of PSI (sub-)table decoders and removes them from the chain before calling its pf_detach callback. The pointers to the PSI (sub-)table decoders are no longer valid after this function has been called. Nor is the decoder chain list valid.

Parameters
p_dvbpsipointer to dvbpsi_t handle
Returns
true on success, false on failure

◆ dvbpsi_chain_demux_new()

bool dvbpsi_chain_demux_new ( dvbpsi_t p_dvbpsi,
dvbpsi_callback_new_t  pf_new,
dvbpsi_callback_del_t  pf_del,
void *  p_data 
)

dvbpsi_chain_demux_new creates a decoder for demuxing PSI tables and subtables.

Parameters
p_dvbpsipointer to dvbpsi_t handle
pf_newcallback function for calling the specific PSI table/subtable attach function
pf_delcallback function for calling the specific PSI table/subtable detach function
p_datapointer to data that must be passed to PSI table/subtable its dvbpsi_xxx_attach() function
Returns
true on success, false on failure

◆ dvbpsi_decoder_chain_add()

bool dvbpsi_decoder_chain_add ( dvbpsi_t p_dvbpsi,
dvbpsi_decoder_t p_decoder 
)

Adds decoder to the chain in handle 'p_dvbpsi' at dvbpsi_t::dvbpsi_decoder_t.

Parameters
p_dvbpsipointer to dvbpsi_t handle
p_decoderpointer to dvbpsi_decoder_t for adding to chain
Returns
true on success, false on failure

◆ dvbpsi_decoder_chain_get()

dvbpsi_decoder_t * dvbpsi_decoder_chain_get ( dvbpsi_t p_dvbpsi,
const uint16_t  table_id,
const uint16_t  extension 
)

Gets decoder from the chain based on given table_id and extension. If extension is 0, then the search is performed on table_id only and the first match is returned.

Parameters
p_dvbpsipointer to dvbpsi_t handle
table_idPSI table id to get
extensionPSI subtable id to get
Returns
returns pointer to dvbpsi_decoder_t on success, or NULL on failure

◆ dvbpsi_decoder_chain_remove()

bool dvbpsi_decoder_chain_remove ( dvbpsi_t p_dvbpsi,
const dvbpsi_decoder_t p_decoder 
)

Deletes decoder from the chain in handle 'p_dvbpsi' at dvbpsi_t::dvbpsi_decoder_t.

Note
Use
See also
dvbpsi_decoder_chain_get() to find the decoder pointer, then call dvbpsi_decoder_chain_remove() to remove the pointer from the chain. The caller is responsible for freeing the associated memory of the just removed decoder pointer and needs to call decoder_delete(p_decoder).
Parameters
p_dvbpsipointer to dvbpsi_t handle
p_decoderpointer to dvbpsi_decoder_t for deletion from chain
Returns
true on success, false on failure