Data Structures | Defines | Typedefs | Enumerations | Functions

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.0.0
#define DVBPSI_VERSION_INT   ((1<<16)+(0<<8)+0)
#define DVBPSI_DECODER_COMMON

Typedefs

typedef struct dvbpsi_s dvbpsi_t
 DVBPSI handle structure abstration.
typedef enum dvbpsi_msg_level dvbpsi_msg_level_t
typedef void(* dvbpsi_message_cb )(dvbpsi_t *handle, const dvbpsi_msg_level_t level, const char *msg)
 Callback type definition.
typedef struct dvbpsi_psi_section_s dvbpsi_psi_section_t
 dvbpsi_psi_section_t type definition.
typedef struct dvbpsi_decoder_s dvbpsi_decoder_t
 dvbpsi_decoder_t type definition.
typedef void(* dvbpsi_callback )(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section)
 Callback type definition.

Enumerations

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

DVBPSI message level enum.

More...

Functions

dvbpsi_tdvbpsi_NewHandle (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_DeleteHandle (dvbpsi_t *handle)
 Deletes a dvbpsi_t handle created with dvbpsi_NewHandle.
bool dvbpsi_PushPacket (dvbpsi_t *p_dvbpsi, uint8_t *p_data)
 Injection of a TS packet into a PSI decoder.
dvbpsi_decoder_tdvbpsi_NewDecoder (dvbpsi_callback callback, const int i_section_max_size, const bool b_discontinuity, const size_t psi_size)
void dvbpsi_DeleteDecoder (dvbpsi_decoder_t *p_decoder)
 Deletes decoder struct and frees its memory.
bool dvbpsi_HasDecoder (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> 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:
dvbpsi_callback  pf_callback;                   \
    int      i_section_max_size;    \
    uint8_t  i_continuity_counter;                      \
    bool     b_discontinuity;                           \
    dvbpsi_psi_section_t *p_current_section;               \
    int      i_need;                                          \
    bool     b_complete_header;

Flag for header completion

#define DVBPSI_VERSION   1.0.0

Human readible DVBPSI version

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

Machine readible DVBPSI version


Typedef Documentation

DVBPSI handle structure abstration.

dvbpsi_t type definition.


Enumeration Type Documentation

DVBPSI message level enum.

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_DeleteDecoder ( 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_DeleteHandle ( dvbpsi_t handle  ) 

Deletes a dvbpsi_t handle created with dvbpsi_NewHandle.

Parameters:
handle 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.

bool dvbpsi_HasDecoder ( 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.

dvbpsi_t * dvbpsi_NewHandle ( 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_DeleteHandle().

bool dvbpsi_PushPacket ( 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.