Commit d5b28e05 authored by Jean-Paul Saman's avatar Jean-Paul Saman

fixup: 19a31474

parent 15d26b4c
...@@ -118,7 +118,7 @@ void dvbpsi_Demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section) ...@@ -118,7 +118,7 @@ void dvbpsi_Demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section)
{ {
/* Tell the application we found a new subtable, so that it may attach a /* Tell the application we found a new subtable, so that it may attach a
* subtable decoder */ * subtable decoder */
p_demux->pf_new_callback(p_demux->p_new_cb_data, (dvbpsi_decoder_t *)p_demux, p_demux->pf_new_callback(p_demux->p_new_cb_data, p_dvbpsi,
p_section->i_table_id, p_section->i_extension); p_section->i_table_id, p_section->i_extension);
/* Check if a new subtable decoder is available */ /* Check if a new subtable decoder is available */
......
...@@ -43,13 +43,13 @@ extern "C" { ...@@ -43,13 +43,13 @@ extern "C" {
*****************************************************************************/ *****************************************************************************/
/*! /*!
* \typedef void(* dvbpsi_demux_new_cb_t) (void * p_cb_data, * \typedef void(* dvbpsi_demux_new_cb_t) (void * p_cb_data,
dvbpsi_decoder_t *p_decoder, dvbpsi_t *p_dvbpsi,
uint8_t i_table_id, uint8_t i_table_id,
uint16_t i_extension); uint16_t i_extension);
* \brief Callback used in case of a new subtable detected. * \brief Callback used in case of a new subtable detected.
*/ */
typedef void (*dvbpsi_demux_new_cb_t) (void * p_cb_data, typedef void (*dvbpsi_demux_new_cb_t) (void * p_cb_data,
dvbpsi_decoder_t *p_decoder, dvbpsi_t *p_dvbpsi,
uint8_t i_table_id, uint8_t i_table_id,
uint16_t i_extension); uint16_t i_extension);
......
...@@ -144,7 +144,7 @@ uint32_t dvbpsi_crc32_table[256] = ...@@ -144,7 +144,7 @@ uint32_t dvbpsi_crc32_table[256] =
/***************************************************************************** /*****************************************************************************
* dvbpsi_NewHandle * dvbpsi_NewHandle
*****************************************************************************/ *****************************************************************************/
dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, int level) dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, enum dvbpsi_msg_level level)
{ {
dvbpsi_t *handle = calloc(1, sizeof(dvbpsi_t)); dvbpsi_t *handle = calloc(1, sizeof(dvbpsi_t));
if (handle != NULL) if (handle != NULL)
...@@ -492,7 +492,7 @@ void dvbpsi_error(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...) ...@@ -492,7 +492,7 @@ void dvbpsi_error(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...)
void dvbpsi_warning(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...) void dvbpsi_warning(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...)
{ {
if (DVBPSI_MSG_WARNING <= dvbpsi->i_msg_level) if (DVBPSI_MSG_WARN <= dvbpsi->i_msg_level)
{ {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
......
...@@ -61,6 +61,22 @@ typedef struct dvbpsi_s dvbpsi_t; ...@@ -61,6 +61,22 @@ typedef struct dvbpsi_s dvbpsi_t;
typedef void (* dvbpsi_message_cb)(dvbpsi_t *handle, typedef void (* dvbpsi_message_cb)(dvbpsi_t *handle,
const char* msg); const char* msg);
/*!
* \enum dvbpsi_msg_level
* \brief DVBPSI message level enum
* DVBPSI_MSG_NONE -1 : No messages
* DVBPSI_MSG_ERROR 0 : Error messages, only
* DVBPSI_MSG_WARNING 1 : Error and Warning messages
* DVBPSI_MSG_DEBUG 2 : Error, warning and debug messages
*/
enum dvbpsi_msg_level
{
DVBPSI_MSG_NONE = -1,
DVBPSI_MSG_ERROR = 0,
DVBPSI_MSG_WARN = 1,
DVBPSI_MSG_DEBUG = 2,
};
/***************************************************************************** /*****************************************************************************
* dvbpsi_t * dvbpsi_t
*****************************************************************************/ *****************************************************************************/
...@@ -82,9 +98,7 @@ struct dvbpsi_s ...@@ -82,9 +98,7 @@ struct dvbpsi_s
encoder */ encoder */
/* Messages callback */ /* Messages callback */
dvbpsi_message_cb pf_message; /*!< Log message callback */ dvbpsi_message_cb pf_message; /*!< Log message callback */
int i_msg_level; /*!< Log level -1, 0, 1 or 2 enum dvbpsi_msg_level i_msg_level; /*!< Log level */
(-1=none, 0=error, 1=warning,
2=debug) */
}; };
/***************************************************************************** /*****************************************************************************
...@@ -102,7 +116,7 @@ struct dvbpsi_s ...@@ -102,7 +116,7 @@ struct dvbpsi_s
* Creates a handle to use with PSI decoder and encoder API functions. The * Creates a handle to use with PSI decoder and encoder API functions. The
* handle must be freed with dvbpsi_DeleteHandle(). * handle must be freed with dvbpsi_DeleteHandle().
*/ */
dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, int level); dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, enum dvbpsi_msg_level level);
/***************************************************************************** /*****************************************************************************
* dvbpsi_DeleteHandle * dvbpsi_DeleteHandle
......
...@@ -38,10 +38,6 @@ extern uint32_t dvbpsi_crc32_table[]; ...@@ -38,10 +38,6 @@ extern uint32_t dvbpsi_crc32_table[];
* libdvbpsi messages have the following format: * libdvbpsi messages have the following format:
* "libdvbpsi [error | warning | debug] (<component>): <msg>" * "libdvbpsi [error | warning | debug] (<component>): <msg>"
*****************************************************************************/ *****************************************************************************/
#define DVBPSI_MSG_NONE -1 /* No messages */
#define DVBPSI_MSG_ERROR 0 /* Error messages, only */
#define DVBPSI_MSG_WARNING 1 /* Error and Warning messages */
#define DVBPSI_MSG_DEBUG 2 /* Error, warning and debug messages */
#ifdef HAVE_VARIADIC_MACROS #ifdef HAVE_VARIADIC_MACROS
void message(dvbpsi_handle dvbpsi, const int level, const char *fmt, ...); void message(dvbpsi_handle dvbpsi, const int level, const char *fmt, ...);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment