dvbpsi.h File Reference

Application interface for all DVB/PSI decoders. More...

Go to the source code of this file.

Data Structures

struct  dvbpsi_s
 DVBPSI handle structure. More...
struct  dvbpsi_decoder_s
 PSI decoder structure. More...

Defines

#define DVBPSI_VERSION   1.1.2
#define DVBPSI_VERSION_INT   ((1<<16)+(1<<8)+1)
#define DVBPSI_GCC_VERSION(maj, min)   (0)
 Helper macro for GCC version check.
#define DVBPSI_DECODER(x)   ((dvbpsi_decoder_t *)(x))
 Helper macro for casting a private decoder into a dvbpsi_decoder_t.
#define DVBPSI_DECODER_COMMON
 Common members for all dvbpsi table decoders. These should be the first members of a table decoder struct, such that they can be casted to a dvbpsi_decoder_t type.

Typedefs

typedef struct dvbpsi_s dvbpsi_t
 DVBPSI handle structure abstration.
typedef enum dvbpsi_msg_level dvbpsi_msg_level_t
 DVBPSI message level enumeration type definition.
typedef void(* dvbpsi_message_cb )(dvbpsi_t *handle, const dvbpsi_msg_level_t level, const char *msg)
 Callback type definition.
typedef struct dvbpsi_decoder_s dvbpsi_decoder_t
 dvbpsi_decoder_t type definition.
typedef struct dvbpsi_psi_section_s dvbpsi_psi_section_t
 dvbpsi_psi_section_t type definition.
typedef void(* dvbpsi_callback_gather_t )(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section)
 Callback used for gathering psi sections on behalf of PSI decoders.

Enumerations

enum  dvbpsi_msg_level { DVBPSI_MSG_NONE = -1, DVBPSI_MSG_ERROR = 0, DVBPSI_MSG_WARN = 1, DVBPSI_MSG_DEBUG = 2 }
 

DVBPSI message level enumeration type.

More...

Functions

dvbpsi_tdvbpsi_new (dvbpsi_message_cb callback, enum dvbpsi_msg_level level)
 Create a new dvbpsi_t handle to be used by PSI decoders or encoders.
void dvbpsi_delete (dvbpsi_t *p_dvbpsi)
 Deletes a dvbpsi_t handle created with dvbpsi_new.
bool dvbpsi_packet_push (dvbpsi_t *p_dvbpsi, uint8_t *p_data)
 Injection of a TS packet into a PSI decoder.
void * dvbpsi_decoder_new (dvbpsi_callback_gather_t pf_gather, const int i_section_max_size, const bool b_discontinuity, const size_t psi_size)
 Create a new (private) dvbpsi decoder.
void dvbpsi_decoder_delete (dvbpsi_decoder_t *p_decoder)
 Deletes decoder struct and frees its memory.
void dvbpsi_decoder_reset (dvbpsi_decoder_t *p_decoder, const bool b_force)
 Resets a decoder internal state.
bool dvbpsi_decoder_psi_sections_completed (dvbpsi_decoder_t *p_decoder)
 Have all sections for this decoder been received?
bool dvbpsi_decoder_psi_section_add (dvbpsi_decoder_t *p_decoder, dvbpsi_psi_section_t *p_section)
 Add a section to the dvbpsi_decoder_t::p_sections list.
bool dvbpsi_decoder_present (dvbpsi_t *p_dvbpsi)
 Determines if a decoder has been attached to dvbpsi_t handle.

Detailed Description

Application interface for all DVB/PSI decoders.

>

Author:
Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> Jean-Paul Saman <jpsaman@videolan.org> Application interface for all DVB/PSI decoders. The generic decoder structure is public so that external decoders are allowed.

Define Documentation

#define DVBPSI_DECODER_COMMON
Value:
                                                                               \
                                                                           \
    uint8_t  i_magic[3];                              \
    bool     b_complete_header;                 \
    bool     b_discontinuity;                           \
    bool     b_current_valid;                      \
    uint8_t  i_continuity_counter;                      \
    uint8_t  i_last_section_number;           \
    dvbpsi_psi_section_t *p_current_section;               \
    dvbpsi_psi_section_t *p_sections;        \
    dvbpsi_callback_gather_t  pf_gather;            \
    int      i_section_max_size;    \
    int      i_need;

Common members for all dvbpsi table decoders. These should be the first members of a table decoder struct, such that they can be casted to a dvbpsi_decoder_t type.

#define DVBPSI_VERSION   1.1.2

Human readible DVBPSI version

#define DVBPSI_VERSION_INT   ((1<<16)+(1<<8)+1)

Machine readible DVBPSI version


Typedef Documentation

void(* dvbpsi_callback_gather_t)(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section)

Callback used for gathering psi sections on behalf of PSI decoders.

pointer to psi section

DVBPSI handle structure abstration.

dvbpsi_t type definition.


Enumeration Type Documentation

DVBPSI message level enumeration type.

Enumerator:
DVBPSI_MSG_NONE 

No messages

DVBPSI_MSG_ERROR 

Error messages only

DVBPSI_MSG_WARN 

Error and Warning messages

DVBPSI_MSG_DEBUG 

Error, warning and debug messages


Function Documentation

void dvbpsi_decoder_delete ( dvbpsi_decoder_t p_decoder  ) 

Deletes decoder struct and frees its memory.

Parameters:
p_decoder pointer to dvbpsi_decoder_t with decoder
Returns:
nothing

Delets a dvbpsi_t handle by calling free(handle). Make sure to detach any decoder of encoder before deleting the dvbpsi handle.

void * dvbpsi_decoder_new ( dvbpsi_callback_gather_t  pf_gather,
const int  i_section_max_size,
const bool  b_discontinuity,
const size_t  psi_size 
)

Create a new (private) dvbpsi decoder.

Parameters:
pf_gather pointer to gather function for PSI decoder.
i_section_max_size Max size of a section for this decoder
b_discontinuity Discontinuity flag
psi_size size of new PSI struct, eg: sizeof(dvbpsi_pat_t)
Returns:
pointer to memory of size 'psi_size' that can be casted into a dvbpsi_decoder_t.

Creates a void pointer that points to a private dvbpsi decoder struct (eg: dvbpsi_pat_t). The first elements in this newly created decoder should contain DVBPSI_DECODER_COMMON, which corresponds to a dvbpsi_decoder_t. Upon return the pointer should be casted to the correct type. Delete the pointer with

See also:
dvbpsi_decoder_delete() function.
bool dvbpsi_decoder_present ( dvbpsi_t p_dvbpsi  ) 

Determines if a decoder has been attached to dvbpsi_t handle.

Parameters:
p_dvbpsi handle to dvbpsi with attached decoder
Returns:
true when decoder is attached, else it will return false.

Determines if a decoder is attached to this dvbpsi_t handle. When the dvbpsi handle is invalid the fuction will return false.

bool dvbpsi_decoder_psi_section_add ( dvbpsi_decoder_t p_decoder,
dvbpsi_psi_section_t p_section 
)

Add a section to the dvbpsi_decoder_t::p_sections list.

Parameters:
p_decoder pointer to dvbpsi_decoder_t with decoder
p_section PSI section to add to dvbpsi_decoder_t::p_sections list
Returns:
true if it overwrites a earlier section, false otherwise
bool dvbpsi_decoder_psi_sections_completed ( dvbpsi_decoder_t p_decoder  ) 

Have all sections for this decoder been received?

Parameters:
p_decoder pointer to dvbpsi_decoder_t with decoder
Returns:
true when all PSI sections have been received, false otherwise
void dvbpsi_decoder_reset ( dvbpsi_decoder_t p_decoder,
const bool  b_force 
)

Resets a decoder internal state.

Parameters:
p_decoder pointer to dvbpsi_decoder_t with decoder
b_force If 'b_force' is true then dvbpsi_decoder_t::b_current_valid is set to false, invalidating the current section.
Returns:
nothing
void dvbpsi_delete ( dvbpsi_t p_dvbpsi  ) 

Deletes a dvbpsi_t handle created with dvbpsi_new.

Parameters:
p_dvbpsi pointer to dvbpsi_t malloced data
Returns:
nothing

Delets a dvbpsi_t handle by calling free(handle). Make sure to detach any decoder of encoder before deleting the dvbpsi handle.

dvbpsi_t * dvbpsi_new ( dvbpsi_message_cb  callback,
enum dvbpsi_msg_level  level 
)

Create a new dvbpsi_t handle to be used by PSI decoders or encoders.

Parameters:
callback message callback handler, if NULL then no errors, warnings or debug messages will be sent to the caller application
level enum dvbpsi_msg_level for filtering logging messages
Returns:
pointer to dvbpsi_t malloced data

Creates a handle to use with PSI decoder and encoder API functions. The handle must be freed with dvbpsi_delete().

bool dvbpsi_packet_push ( dvbpsi_t p_dvbpsi,
uint8_t *  p_data 
)

Injection of a TS packet into a PSI decoder.

Parameters:
p_dvbpsi handle to dvbpsi with attached decoder
p_data pointer to a 188 bytes playload of a TS packet
Returns:
true when packet has been handled, false on error.

Injection of a TS packet into a PSI decoder.


Generated on 10 Sep 2015 for libdvbpsi by  doxygen 1.6.1