Commit 19a31474 authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/tables/*: Privatize dvbpsi_decoder_t in dvbpsi_t

All dvbpsi decoders now use dvbpsi_t as handle instead of
dvbpsi_decoder_t *. The pointer to dvbpsi_decoder_t is privatized
and accessible through (dvbpsi_t *)->p_private member. The user
must make sure to cast it to the correct dvbpsi_*_decoder_t type
before accessing structure members.

Dvbpsi decoder developers should use the define DVBPSI_DECODER_COMMON
at the start of a new dvbpsi_*_decoder_t.

WARNING: THIS COMMIT BREAKS THE EXISTING API IN A MAJOR WAY !!!

- most public APIs requires a pointer to existing dvbpsi_t
- new functions to obtain and delete a pointer to dvbpsi_t structure:
  dvbpsi_NewHandle() and dvbpsi_DeleteHandle()
- subtable descriptors fixes
- indentations
parent f6de3f79
......@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Johan Bilien <jobi@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -24,7 +25,6 @@
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
......@@ -36,6 +36,8 @@
#include <stdint.h>
#endif
#include <assert.h>
#include "dvbpsi.h"
#include "dvbpsi_private.h"
#include "psi.h"
......@@ -46,39 +48,33 @@
*****************************************************************************
* Creation of the demux structure
*****************************************************************************/
dvbpsi_handle dvbpsi_AttachDemux(dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data)
dvbpsi_t *dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data)
{
dvbpsi_handle h_dvbpsi = (dvbpsi_decoder_t*)malloc(sizeof(dvbpsi_decoder_t));
dvbpsi_demux_t * p_demux;
if(h_dvbpsi == NULL)
return NULL;
p_demux = (dvbpsi_demux_t*)malloc(sizeof(dvbpsi_demux_t));
if(p_demux == NULL)
{
free(h_dvbpsi);
return NULL;
}
/* PSI decoder configuration */
h_dvbpsi->pf_callback = &dvbpsi_Demux;
h_dvbpsi->p_private_decoder = p_demux;
h_dvbpsi->i_section_max_size = 4096;
/* PSI decoder initial state */
h_dvbpsi->i_continuity_counter = 31;
h_dvbpsi->b_discontinuity = 1;
h_dvbpsi->p_current_section = NULL;
/* Sutables demux configuration */
p_demux->p_decoder = h_dvbpsi;
p_demux->p_first_subdec = NULL;
p_demux->pf_new_callback = pf_new_cb;
p_demux->p_new_cb_data = p_new_cb_data;
return h_dvbpsi;
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_demux_t *p_demux = (dvbpsi_demux_t*)malloc(sizeof(dvbpsi_demux_t));
if (p_demux == NULL)
return NULL;
/* PSI decoder configuration */
p_demux->pf_callback = &dvbpsi_Demux;
p_demux->i_section_max_size = 4096;
/* PSI decoder initial state */
p_demux->i_continuity_counter = 31;
p_demux->b_discontinuity = 1;
p_demux->p_current_section = NULL;
/* Subtables demux configuration */
p_demux->p_first_subdec = NULL;
p_demux->pf_new_callback = pf_new_cb;
p_demux->p_new_cb_data = p_new_cb_data;
p_dvbpsi->p_private = (void *)p_demux;
return p_dvbpsi;
}
/*****************************************************************************
......@@ -90,18 +86,18 @@ dvbpsi_demux_subdec_t * dvbpsi_demuxGetSubDec(dvbpsi_demux_t * p_demux,
uint8_t i_table_id,
uint16_t i_extension)
{
uint32_t i_id = (uint32_t)i_table_id << 16 |(uint32_t)i_extension;
dvbpsi_demux_subdec_t * p_subdec = p_demux->p_first_subdec;
uint32_t i_id = (uint32_t)i_table_id << 16 |(uint32_t)i_extension;
dvbpsi_demux_subdec_t * p_subdec = p_demux->p_first_subdec;
while(p_subdec)
{
if(p_subdec->i_id == i_id)
break;
while (p_subdec)
{
if (p_subdec->i_id == i_id)
break;
p_subdec = p_subdec->p_next;
}
p_subdec = p_subdec->p_next;
}
return p_subdec;
return p_subdec;
}
/*****************************************************************************
......@@ -109,37 +105,35 @@ dvbpsi_demux_subdec_t * dvbpsi_demuxGetSubDec(dvbpsi_demux_t * p_demux,
*****************************************************************************
* Sends a PSI section to the right subtable decoder
*****************************************************************************/
void dvbpsi_Demux(dvbpsi_handle p_decoder, dvbpsi_psi_section_t * p_section)
void dvbpsi_Demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section)
{
dvbpsi_demux_t * p_demux;
dvbpsi_demux_subdec_t * p_subdec;
p_demux = (dvbpsi_demux_t *)p_decoder->p_private_decoder;
p_subdec = dvbpsi_demuxGetSubDec(p_demux, p_section->i_table_id,
p_section->i_extension);
if(p_subdec == NULL)
{
/* Tell the application we found a new subtable, so that it may attach a
* subtable decoder */
p_demux->pf_new_callback(p_demux->p_new_cb_data, p_decoder,
p_section->i_table_id,
p_section->i_extension);
/* Check if a new subtable decoder is available */
p_subdec = dvbpsi_demuxGetSubDec(p_demux, p_section->i_table_id,
p_section->i_extension);
}
if(p_subdec)
{
p_subdec->pf_callback(p_demux->p_decoder, p_subdec->p_cb_data, p_section);
}
else
{
dvbpsi_DeletePSISections(p_section);
}
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_demux_t * p_demux = (dvbpsi_demux_t *)p_dvbpsi->p_private;
dvbpsi_demux_subdec_t * p_subdec = dvbpsi_demuxGetSubDec(p_demux, p_section->i_table_id,
p_section->i_extension);
if (p_subdec == NULL)
{
/* Tell the application we found a new subtable, so that it may attach a
* subtable decoder */
p_demux->pf_new_callback(p_demux->p_new_cb_data, (dvbpsi_decoder_t *)p_demux,
p_section->i_table_id, p_section->i_extension);
/* Check if a new subtable decoder is available */
p_subdec = dvbpsi_demuxGetSubDec(p_demux, p_section->i_table_id,
p_section->i_extension);
}
if (p_subdec)
{
p_subdec->pf_callback(p_dvbpsi, p_subdec->p_cb_data, p_section);
}
else
{
dvbpsi_DeletePSISections(p_section);
}
}
/*****************************************************************************
......@@ -147,26 +141,28 @@ void dvbpsi_Demux(dvbpsi_handle p_decoder, dvbpsi_psi_section_t * p_section)
*****************************************************************************
* Destroys a demux structure
*****************************************************************************/
void dvbpsi_DetachDemux(dvbpsi_handle h_dvbpsi)
void dvbpsi_DetachDemux(dvbpsi_t *p_dvbpsi)
{
dvbpsi_demux_t* p_demux
= (dvbpsi_demux_t*)h_dvbpsi->p_private_decoder;
dvbpsi_demux_subdec_t* p_subdec
= p_demux->p_first_subdec;
dvbpsi_demux_subdec_t* p_subdec_temp;
while(p_subdec)
{
p_subdec_temp = p_subdec;
p_subdec = p_subdec->p_next;
if(p_subdec_temp->pf_detach)
p_subdec_temp->pf_detach(p_demux, (p_subdec_temp->i_id >> 16) & 0xFFFF,
p_subdec_temp->i_id & 0xFFFF);
else free(p_subdec_temp);
}
free(p_demux);
if(h_dvbpsi->p_current_section)
dvbpsi_DeletePSISections(h_dvbpsi->p_current_section);
free(h_dvbpsi);
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_demux_t *p_demux = (dvbpsi_demux_t *)p_dvbpsi->p_private;
dvbpsi_demux_subdec_t* p_subdec = p_demux->p_first_subdec;
while (p_subdec)
{
dvbpsi_demux_subdec_t* p_subdec_temp = p_subdec;
p_subdec = p_subdec->p_next;
if (p_subdec_temp->pf_detach)
p_subdec_temp->pf_detach(p_dvbpsi, (p_subdec_temp->i_id >> 16) & 0xFFFF,
p_subdec_temp->i_id & 0xFFFF);
else free(p_subdec_temp);
}
if (p_demux->p_current_section)
dvbpsi_DeletePSISections(p_demux->p_current_section);
p_dvbpsi->p_private = NULL;
free(p_demux);
}
......@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Johan Bilien <jobi@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -37,19 +38,18 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_demux_new_cb_t
*****************************************************************************/
/*!
* \typedef void(* dvbpsi_demux_new_cb_t) (void * p_cb_data,
dvbpsi_handle h_dvbpsi,
dvbpsi_decoder_t *p_decoder,
uint8_t i_table_id,
uint16_t i_extension);
* \brief Callback used in case of a new subtable detected.
*/
typedef void (*dvbpsi_demux_new_cb_t) (void * p_cb_data,
dvbpsi_handle h_dvbpsi,
dvbpsi_decoder_t *p_decoder,
uint8_t i_table_id,
uint16_t i_extension);
......@@ -58,15 +58,15 @@ typedef void (*dvbpsi_demux_new_cb_t) (void * p_cb_data,
*****************************************************************************/
/*!
* \typedef void (*dvbpsi_demux_subdec_cb_t)
(dvbpsi_decoder_t* p_psi_decoder,
void* p_private_decoder,
dvbpsi_psi_section_t* p_section);
(dvbpsi_t *p_dvbpsi,
void *p_private_decoder,
dvbpsi_psi_section_t *p_section);
* \brief Subtable specific decoder.
*/
typedef void (*dvbpsi_demux_subdec_cb_t)
(dvbpsi_decoder_t* p_psi_decoder,
void* p_private_decoder,
dvbpsi_psi_section_t* p_section);
(dvbpsi_t *p_dvbpsi,
void *p_private_decoder,
dvbpsi_psi_section_t *p_section);
/*****************************************************************************
* dvbpsi_demux_subdec_t
......@@ -90,12 +90,12 @@ typedef struct dvbpsi_demux_subdec_s
void * p_cb_data;
struct dvbpsi_demux_subdec_s * p_next;
void (*pf_detach)(struct dvbpsi_demux_s *, uint8_t, uint16_t);
void (*pf_detach)(dvbpsi_t *, uint8_t, uint16_t);
} dvbpsi_demux_subdec_t;
/*****************************************************************************
* dvbpsi_demux_t
* dvbpsi_demux_s
*****************************************************************************/
/*!
* \struct dvbpsi_demux_s
......@@ -108,41 +108,44 @@ typedef struct dvbpsi_demux_subdec_s
* \typedef struct dvbpsi_demux_s dvbpsi_demux_t
* \brief dvbpsi_demux_t type definition.
*/
typedef struct dvbpsi_demux_s
typedef struct dvbpsi_demux_s dvbpsi_demux_t;
struct dvbpsi_demux_s
{
dvbpsi_handle p_decoder; /*!< Parent PSI Decoder */
dvbpsi_demux_subdec_t * p_first_subdec; /*!< First subtable decoder */
/* New subtable callback */
dvbpsi_demux_new_cb_t pf_new_callback; /*!< New subtable callback */
void * p_new_cb_data; /*!< Data provided to the
previous callback */
DVBPSI_DECODER_COMMON
} dvbpsi_demux_t;
dvbpsi_demux_subdec_t * p_first_subdec; /*!< First subtable decoder */
/* New subtable callback */
dvbpsi_demux_new_cb_t pf_new_callback; /*!< New subtable callback */
void * p_new_cb_data; /*!< Data provided to the
previous callback */
};
/*****************************************************************************
* dvbpsi_AttachDemux
*****************************************************************************/
/*!
* \fn dvbpsi_handle_t dvbpsi_NewPSISection(dvbpsi_demux_new_cb_t pf_new_cb, void * p_new_cb_data)
* \fn dvbpsi_t *dvbpsi_NewPSISection(dvbpsi_t *p_dvbpsi, dvbpsi_demux_new_cb_t pf_new_cb, void * p_new_cb_data)
* \brief Creates a new demux structure.
* \param p_dvbpsi pointer to dvbpsi_t handle
* \param pf_new_cb A callcack called when a new type of subtable is found.
* \param p_new_cb_data Data given to the previous callback.
* \return a handle to the new demux structure.
* \return a handle to the new attached demux structure.
*/
dvbpsi_handle dvbpsi_AttachDemux(dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data);
dvbpsi_t *dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data);
/*****************************************************************************
* dvbpsi_DetachDemux
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachDemux(dvbpsi_handle h_dvbpsi)
* \fn void dvbpsi_DetachDemux(dvbpsi_decoder_t *p_decoder)
* \brief Destroys a demux structure.
* \param h_dvbpsi The handle of the demux to be destroyed.
*/
void dvbpsi_DetachDemux(dvbpsi_handle h_dvbpsi);
void dvbpsi_DetachDemux(dvbpsi_t *p_dvbpsi);
/*****************************************************************************
* dvbpsi_demuxGetSubDec
......@@ -163,14 +166,13 @@ dvbpsi_demux_subdec_t * dvbpsi_demuxGetSubDec(dvbpsi_demux_t * p_demux,
* dvbpsi_Demux
*****************************************************************************/
/*!
* \fn void dvbpsi_Demux(dvbpsi_handle h_dvbpsi,
* \fn void dvbpsi_Demux(dvbpsi_t *p_dvbpsi,
dvbpsi_psi_section_t * p_section)
* \brief Sends the PSI sections to the right subtable decoder according to their table ID and extension.
* \param h_dvbpsi PSI decoder handle.
* \param p_dvbpsi PSI decoder handle.
* \param p_section PSI section.
*/
void dvbpsi_Demux(dvbpsi_handle h_dvbpsi,
dvbpsi_psi_section_t * p_section);
void dvbpsi_Demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section);
#ifdef __cplusplus
};
......
This diff is collapsed.
......@@ -4,6 +4,7 @@
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -40,16 +41,82 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_handle
*****************************************************************************/
/*!
* \typedef struct dvbpsi_decoder_s * dvbpsi_handle
* \brief Decoder abstration.
* \typedef struct dvbpsi_s dvbpsi_t
* \brief DVBPSI handle structure abstration.
*/
typedef struct dvbpsi_decoder_s * dvbpsi_handle;
typedef struct dvbpsi_s dvbpsi_t;
/*****************************************************************************
* dvbpsi_message_cb
*****************************************************************************/
/*!
* \typedef void (* dvbpsi_message_cb)(dvbpsi_handle p_decoder,
* const char* msg)
* \brief Callback type definition.
*/
typedef void (* dvbpsi_message_cb)(dvbpsi_t *handle,
const char* msg);
/*****************************************************************************
* dvbpsi_t
*****************************************************************************/
/*!
* \struct dvbpsi_s
* \brief DVBPSI handle structure
*
* This structure provides a handle to libdvbpsi API and should be used instead
* of dvbpsi_decoder_t.
*/
/*!
* \typedef struct dvbpsi_s dvbpsi_t
* \brief dvbpsi_t type definition.
*/
struct dvbpsi_s
{
void *p_private; /*!< private pointer to
specific decoder or
encoder */
/* Messages callback */
dvbpsi_message_cb pf_message; /*!< Log message callback */
int i_msg_level; /*!< Log level -1, 0, 1 or 2
(-1=none, 0=error, 1=warning,
2=debug) */
};
/*****************************************************************************
* dvbpsi_NewHandle
*****************************************************************************/
/*!
* \fn dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb *callback)
* \brief Create a new dvbpsi_t handle to be used by PSI decoders or encoders
* \param callback message callback handler, if NULL then no errors, warnings
* or debug messages will be sent to the caller application
* \param level for filtering logging messages, possible values are:
* -1=none, 0=error, 1=warning, 2=debug.
* \return 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().
*/
dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, int level);
/*****************************************************************************
* dvbpsi_DeleteHandle
*****************************************************************************/
/*!
* \fn void dvbpsi_NewHandle(dvbpsi_t *handle)
* \brief Deletes a dvbpsi_t handle created with dvbpsi_NewHandle
* \param pointer to dvbpsi_t malloced data
* \return 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);
/*****************************************************************************
* dvbpsi_PushPacket
......@@ -63,8 +130,7 @@ typedef struct dvbpsi_decoder_s * dvbpsi_handle;
*
* Injection of a TS packet into a PSI decoder.
*/
void dvbpsi_PushPacket(dvbpsi_handle h_dvbpsi, uint8_t* p_data);
void dvbpsi_PushPacket(dvbpsi_t * h_dvbpsi, uint8_t* p_data);
/*****************************************************************************
* The following definitions are just here to allow external decoders but
......@@ -77,30 +143,23 @@ void dvbpsi_PushPacket(dvbpsi_handle h_dvbpsi, uint8_t* p_data);
*/
typedef struct dvbpsi_psi_section_s dvbpsi_psi_section_t;
/*!
* \typedef struct dvbpsi_decoder_s dvbpsi_decoder_t
* \brief dvbpsi_decoder_t type definition.
*/
typedef struct dvbpsi_decoder_s dvbpsi_decoder_t;
/*****************************************************************************
* dvbpsi_callback
*****************************************************************************/
/*!
* \typedef void (* dvbpsi_callback)(dvbpsi_handle p_decoder,
* \typedef void (* dvbpsi_callback)(dvbpsi_t *p_dvbpsi,
dvbpsi_psi_section_t* p_section)
* \brief Callback type definition.
*/
typedef void (* dvbpsi_callback)(dvbpsi_handle p_decoder,
typedef void (* dvbpsi_callback)(dvbpsi_t *p_dvbpsi,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_message_cb
*****************************************************************************/
/*!
* \typedef void (* dvbpsi_message_cb)(dvbpsi_handle p_decoder,
* const char* msg)
* \brief Callback type definition.
*/
typedef void (* dvbpsi_message_cb)(dvbpsi_handle p_decoder,
const char* msg);
/*****************************************************************************
* dvbpsi_decoder_t
*****************************************************************************/
......@@ -111,39 +170,47 @@ typedef void (* dvbpsi_message_cb)(dvbpsi_handle p_decoder,
* This structure shouldn't be used but if you want to write an external
* decoder.
*/
/*!
* \typedef struct dvbpsi_decoder_s dvbpsi_decoder_t
* \brief dvbpsi_decoder_t type definition.
*/
typedef struct dvbpsi_decoder_s
#define DVBPSI_DECODER_COMMON \
dvbpsi_callback pf_callback; /*!< PSI decoder's callback */ \
int i_section_max_size; /*!< Max size of a section for this decoder */ \
uint8_t i_continuity_counter; /*!< Continuity counter */ \
int b_discontinuity; /*!< Discontinuity flag */ \
dvbpsi_psi_section_t *p_current_section; /*!< Current section */ \
int i_need; /*!< Bytes needed */ \
int b_complete_header; /*!< Flag for header completion */
struct dvbpsi_decoder_s
{
dvbpsi_callback pf_callback; /*!< PSI decoder's
callback */
void * p_private_decoder; /*!< specific
decoder */
int i_section_max_size; /*!< Max size of a
section for this
decoder */
uint8_t i_continuity_counter; /*!< Continuity
counter */
int b_discontinuity; /*!< Discontinuity
flag */
dvbpsi_psi_section_t * p_current_section; /*!< Current section */
int i_need; /*!< Bytes needed */
int b_complete_header; /*!< Flag for header
completion */
DVBPSI_DECODER_COMMON
};
/* Messages callback */
dvbpsi_message_cb pf_message; /*!< Log message callback */
int i_msg_level; /*!< Log level -1, 0, 1 or 2
(-1=none, 0=error, 1=warning,
2=debug) */
} dvbpsi_decoder_t;
/*****************************************************************************
* dvbpsi_NewDecoder
*****************************************************************************/
/*!
* \fn dvbpsi_decoder_t *dvbpsi_NewDecoder(dvbpsi_t *handle, dvbpsi_callback *callback)
* \brief Create a new dvbpsi_decoder_t.
* \param callback dvbpsi_callback handler
* \return pointer to dvbpsi_decoder_t&
*
* Creates a dvbpsi_decoder_t pointer to struct dvbpsi_decoder_s. It should be
* delete with dvbpsi_DeleteDecoder() function.
*/
dvbpsi_decoder_t *dvbpsi_NewDecoder(dvbpsi_t *handle, dvbpsi_callback *callback);
/*****************************************************************************
* dvbpsi_DeletDecoder
*****************************************************************************/
/*!
* \fn void dvbpsi_DeleteDecoder(dvbpsi_t *handle);
* \brief Deletes attached decoder struct from dvbpsi_t handle and frees its memory
* \param pointer to dvbpsi_t malloced data
* \return 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_DeleteDecoder(dvbpsi_t *handle);
#ifdef __cplusplus
};
......
......@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -52,9 +53,9 @@ void message(dvbpsi_handle dvbpsi, const int level, const char *fmt, ...);
# define dvbpsi_debug(hnd, str, x...) \
message(hnd, DVBPSI_MSG_DEBUG, "libdvbpsi debug ("src"): " str, x)
#else
void dvbpsi_error(dvbpsi_handle dvbpsi, const char *src, const char *fmt, ...);
void dvbpsi_warning(dvbpsi_handle dvbpsi, const char *src, const char *fmt, ...);
void dvbpsi_debug(dvbpsi_handle dvbpsi, const char *src, const char *fmt, ...);
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_debug(dvbpsi_t *dvbpsi, const char *src, const char *fmt, ...);
#endif
#else
......
......@@ -114,18 +114,14 @@ int dvbpsi_ValidPSISection(dvbpsi_psi_section_t* p_section)
}
if(i_crc == 0)
{
return 1;
}
else
{
return 0;
}
}
else
{
/* No check to do if b_syntax_indicator is 0 */
return 1;
return 0;
}
}
......@@ -180,14 +176,15 @@ void dvbpsi_BuildPSISection(dvbpsi_psi_section_t* p_section)
p_section->p_payload_end[1] = (p_section->i_crc >> 16) & 0xff;
p_section->p_payload_end[2] = (p_section->i_crc >> 8) & 0xff;
p_section->p_payload_end[3] = p_section->i_crc & 0xff;
#if 0
if(!dvbpsi_ValidPSISection(p_section))
{
dvbpsi_error(h_dvbpsi,"misc PSI", "********************************************");
dvbpsi_error(h_dvbpsi,"misc PSI", "* Generated PSI section has a bad CRC_32. *");
dvbpsi_error(h_dvbpsi,"misc PSI", "* THIS IS A BUG, PLEASE REPORT TO THE LIST *");
dvbpsi_error(h_dvbpsi,"misc PSI", "* --- libdvbpsi-devel@videolan.org --- *");
dvbpsi_error(h_dvbpsi,"misc PSI", "********************************************");
dvbpsi_error(handle,"misc PSI", "********************************************");
dvbpsi_error(handle,"misc PSI", "* Generated PSI section has a bad CRC_32. *");
dvbpsi_error(handle,"misc PSI", "* THIS IS A BUG, PLEASE REPORT TO THE LIST *");
dvbpsi_error(handle,"misc PSI", "* --- libdvbpsi-devel@videolan.org --- *");
dvbpsi_error(handle,"misc PSI", "********************************************");
}
#endif
}
......
......@@ -130,7 +130,7 @@ void dvbpsi_DeletePSISections(dvbpsi_psi_section_t * p_section);
* \fn int dvbpsi_ValidPSISection(dvbpsi_psi_section_t* p_section)
* \brief Validity check of a PSI section.
* \param p_section pointer to the PSI section structure
* \return boolean value (0 if the section is not valid).
* \return boolean value (false if the section is not valid).
*
* Check the CRC_32 if the section has b_syntax_indicator set.
*/
......
This diff is collapsed.
......@@ -6,6 +6,7 @@
* Authors: Zhu zhenglu <zhuzlu@gmail.com>
* heavily based on nit.h which was written by
* Johann Hanne
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -110,43 +111,40 @@ typedef struct dvbpsi_bat_s
*/
typedef void (* dvbpsi_bat_callback)(void* p_cb_data, dvbpsi_bat_t* p_new_bat);
/*****************************************************************************
* dvbpsi_AttachBAT
*****************************************************************************/
/*!
* \fn void dvbpsi_AttachBAT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
* \fn void dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_bat_callback pf_callback,
void* p_cb_data)
* \brief Creation and initialization of a BAT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
* \param i_table_id Table ID, 0x4a.
* \param i_extension Table ID extension, here bouquet ID.
* \param pf_callback function to call back on new BAT.
* \param p_cb_data private data given in argument to the callback.
* \return 0 if everything went ok.
*/
int dvbpsi_AttachBAT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
int dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_bat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachBAT
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachBAT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
* \fn void dvbpsi_DetachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a BAT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
* \param i_table_id Table ID, 0x4a.
* \param i_extension Table ID extension, here bouquet ID.
* \return nothing.
*/
void dvbpsi_DetachBAT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
void dvbpsi_DetachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitBAT/dvbpsi_NewBAT
*****************************************************************************/
......@@ -181,7 +179,6 @@ do { \
dvbpsi_InitBAT(p_bat, i_bouquet_id, i_version, b_current_next); \
} while(0);
/*****************************************************************************
* dvbpsi_EmptyBAT/dvbpsi_DeleteBAT
*****************************************************************************/
......@@ -207,8 +204,8 @@ do { \
/*****************************************************************************
* dvbpsi_GenBATSections
*****************************************************************************
*!
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenBATSections(dvbpsi_bat_t* p_bat)
* \brief BAT generator
* \param p_bat BAT structure
......@@ -216,8 +213,7 @@ do { \
*
* Generate BAT sections based on the dvbpsi_bat_t structure.
*****************************************************************************/
dvbpsi_psi_section_t *dvbpsi_GenBATSections(dvbpsi_bat_t * p_bat);
dvbpsi_psi_section_t *dvbpsi_GenBATSections(dvbpsi_t *p_dvbpsi, dvbpsi_bat_t * p_bat);
#ifdef __cplusplus
};
......
......@@ -5,6 +5,7 @@
* $Id: bat_private.h 88 2004-02-24 14:31:18Z sam $
*
* Authors: Zhu zhenglu <zhuzlu@gmail.com>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -28,7 +29,6 @@
#ifndef _DVBPSI_BAT_PRIVATE_H_
#define _DVBPSI_BAT_PRIVATE_H_
/*****************************************************************************
* dvbpsi_bat_decoder_t
*****************************************************************************
......@@ -36,39 +36,37 @@
*****************************************************************************/
typedef struct dvbpsi_bat_decoder_s
{
dvbpsi_bat_callback pf_callback;
void * p_cb_data;
DVBPSI_DECODER_COMMON
dvbpsi_bat_t current_bat;
dvbpsi_bat_t * p_building_bat;
dvbpsi_bat_callback pf_bat_callback;
void * p_cb_data;
int b_current_valid;
dvbpsi_bat_t current_bat;
dvbpsi_bat_t * p_building_bat;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
int b_current_valid;
} dvbpsi_bat_decoder_t;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
} dvbpsi_bat_decoder_t;
/*****************************************************************************
* dvbpsi_GatherBATSections
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherBATSections(dvbpsi_decoder_t* p_psi_decoder,
void* p_private_decoder,
dvbpsi_psi_section_t* p_section);
void dvbpsi_GatherBATSections(dvbpsi_t* p_dvbpsi,
void* p_private_decoder, dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeBATSections
*****************************************************************************
* BAT decoder.
*****************************************************************************/
void dvbpsi_DecodeBATSections(dvbpsi_bat_t* p_bat,
void dvbpsi_DecodeBATSections(dvbpsi_t* p_dvbpsi,dvbpsi_bat_t* p_bat,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_BATAddTS
*****************************************************************************
......
This diff is collapsed.
......@@ -6,6 +6,7 @@
* Authors: Johann Hanne
* heavily based on pmt.h which was written by
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -39,7 +40,6 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_cat_t
*****************************************************************************/
......@@ -63,7 +63,6 @@ typedef struct dvbpsi_cat_s
} dvbpsi_cat_t;
/*****************************************************************************
* dvbpsi_cat_callback
*****************************************************************************/
......@@ -74,21 +73,20 @@ typedef struct dvbpsi_cat_s
*/
typedef void (* dvbpsi_cat_callback)(void* p_cb_data, dvbpsi_cat_t* p_new_cat);
/*****************************************************************************
* dvbpsi_AttachCAT
*****************************************************************************/
/*!
* \fn dvbpsi_handle dvbpsi_AttachCAT(dvbpsi_cat_callback pf_callback,
void* p_cb_data)
* \fn dvbpsi_t *dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi,
dvbpsi_cat_callback pf_callback, void* p_cb_data)
* \brief Creation and initialization of a CAT decoder.
* \param p_dvbpsi is a pointer to dvbpsi_t which holds a pointer to the decoder
* \param pf_callback function to call back on new CAT
* \param p_cb_data private data given in argument to the callback
* \return a pointer to the decoder for future calls.
* \return a pointer to dvbpsi_t holding the decoder for future calls.
*/
dvbpsi_handle dvbpsi_AttachCAT(dvbpsi_cat_callback pf_callback,
void* p_cb_data);
dvbpsi_t *dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachCAT
......@@ -96,13 +94,12 @@ dvbpsi_handle dvbpsi_AttachCAT(dvbpsi_cat_callback pf_callback,
/*!
* \fn void dvbpsi_DetachCAT(dvbpsi_handle h_dvbpsi)
* \brief Destroy a CAT decoder.
* \param h_dvbpsi handle to the decoder
* \param p_dvbpsi handle holds the decoder pointer
* \return nothing.
*
* The handle isn't valid any more.
*/
void dvbpsi_DetachCAT(dvbpsi_handle h_dvbpsi);
void dvbpsi_DetachCAT(dvbpsi_t *p_dvbpsi);
/*****************************************************************************
* dvbpsi_InitCAT/dvbpsi_NewCAT
......@@ -136,7 +133,6 @@ do { \
dvbpsi_InitCAT(p_cat, i_version, b_current_next); \
} while(0);
/*****************************************************************************
* dvbpsi_EmptyCAT/dvbpsi_DeleteCAT
*****************************************************************************/
......@@ -160,7 +156,6 @@ do { \
free(p_cat); \
} while(0);
/*****************************************************************************
* dvbpsi_CATAddDescriptor
*****************************************************************************/
......@@ -180,20 +175,19 @@ dvbpsi_descriptor_t* dvbpsi_CATAddDescriptor(dvbpsi_cat_t* p_cat,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_GenCATSections
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenCATSections(dvbpsi_cat_t* p_cat)
* \brief CAT generator
* \param p_dvbpsi is a pointer to dvbpsi_t
* \param p_cat CAT structure
* \return a pointer to the list of generated PSI sections.
*
* Generate CAT sections based on the dvbpsi_cat_t structure.
*/
dvbpsi_psi_section_t* dvbpsi_GenCATSections(dvbpsi_cat_t* p_cat);
dvbpsi_psi_section_t* dvbpsi_GenCATSections(dvbpsi_t *p_dvbpsi, dvbpsi_cat_t* p_cat);
#ifdef __cplusplus
};
......
......@@ -7,6 +7,7 @@
* Authors: Johann Hanne
* heavily based on pmt_private.h which was written by
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -36,28 +37,27 @@
*****************************************************************************/
typedef struct dvbpsi_cat_decoder_s
{
dvbpsi_cat_callback pf_callback;
void * p_cb_data;
DVBPSI_DECODER_COMMON
dvbpsi_cat_t current_cat;
dvbpsi_cat_t * p_building_cat;
dvbpsi_cat_callback pf_cat_callback;
void * p_cb_data;
int b_current_valid;
dvbpsi_cat_t current_cat;
dvbpsi_cat_t * p_building_cat;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
int b_current_valid;
} dvbpsi_cat_decoder_t;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
} dvbpsi_cat_decoder_t;
/*****************************************************************************
* dvbpsi_GatherCATSections
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherCATSections(dvbpsi_decoder_t* p_decoder,
dvbpsi_psi_section_t* p_section);
void dvbpsi_GatherCATSections(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeCATSections
......@@ -67,7 +67,6 @@ void dvbpsi_GatherCATSections(dvbpsi_decoder_t* p_decoder,
void dvbpsi_DecodeCATSections(dvbpsi_cat_t* p_cat,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of cat_private.h"
#endif
......
This diff is collapsed.
......@@ -4,6 +4,7 @@
* $Id: eit.h 88 2004-02-24 14:31:18Z sam $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -37,7 +38,6 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_eit_event_t
*****************************************************************************/
......@@ -70,7 +70,6 @@ typedef struct dvbpsi_eit_event_s
} dvbpsi_eit_event_t;
/*****************************************************************************
* dvbpsi_eit_t
*****************************************************************************/
......@@ -99,7 +98,6 @@ typedef struct dvbpsi_eit_s
} dvbpsi_eit_t;
/*****************************************************************************
* dvbpsi_eit_callback
*****************************************************************************/
......@@ -110,27 +108,25 @@ typedef struct dvbpsi_eit_s
*/
typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
/*****************************************************************************
* dvbpsi_AttachEIT
*****************************************************************************/
/*!
* \fn void dvbpsi_AttachEIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
* \fn dvbpsi_t *dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_eit_callback pf_callback,
void* p_cb_data)
* \brief Creation and initialization of a EIT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi pointer to Subtable demultiplexor to which the EIT decoder is attached.
* \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
* \param i_extension Table ID extension, here service ID.
* \param pf_callback function to call back on new EIT.
* \param p_cb_data private data given in argument to the callback.
* \return 0 if everything went ok.
* \return p_dvbpsi or NULL on error
*/
int dvbpsi_AttachEIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
dvbpsi_t *dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_eit_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachEIT
*****************************************************************************/
......@@ -138,15 +134,15 @@ int dvbpsi_AttachEIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
* \fn void dvbpsi_DetachEIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a EIT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi dvbpsi handle pointing to Subtable demultiplexor to which the
eit decoder is attached.
* \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
* \param i_extension Table ID extension, here service ID.
* \return nothing.
*/
void dvbpsi_DetachEIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
void dvbpsi_DetachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitEIT/dvbpsi_NewEIT
*****************************************************************************/
......@@ -188,7 +184,6 @@ do { \
dvbpsi_InitEIT(p_eit, i_service_id, i_version, b_current_next, i_ts_id, i_network_id, i_segment_last_section_number, i_last_table_id); \
} while(0);
/*****************************************************************************
* dvbpsi_EmptyEIT/dvbpsi_DeleteEIT
*****************************************************************************/
......@@ -212,7 +207,6 @@ do { \
free(p_eit); \
} while(0);
/*****************************************************************************
* dvbpsi_EITAddEvent
*****************************************************************************/
......
......@@ -5,6 +5,7 @@
* $Id: eit_private.h 88 2004-02-24 14:31:18Z sam $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -27,7 +28,6 @@
#ifndef _DVBPSI_EIT_PRIVATE_H_
#define _DVBPSI_EIT_PRIVATE_H_
/*****************************************************************************
* dvbpsi_eit_decoder_t
*****************************************************************************
......@@ -35,31 +35,31 @@
*****************************************************************************/
typedef struct dvbpsi_eit_decoder_s
{
dvbpsi_eit_callback pf_callback;
void * p_cb_data;
DVBPSI_DECODER_COMMON
dvbpsi_eit_t current_eit;
dvbpsi_eit_t * p_building_eit;
dvbpsi_eit_callback pf_eit_callback;
void * p_cb_data;
int b_current_valid;
dvbpsi_eit_t current_eit;
dvbpsi_eit_t * p_building_eit;
uint8_t i_last_section_number;
uint8_t i_first_received_section_number;
dvbpsi_psi_section_t * ap_sections [256];
int b_current_valid;
} dvbpsi_eit_decoder_t;
uint8_t i_last_section_number;
uint8_t i_first_received_section_number;
dvbpsi_psi_section_t * ap_sections [256];
} dvbpsi_eit_decoder_t;
/*****************************************************************************
* dvbpsi_GatherEITSections
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherEITSections(dvbpsi_decoder_t* p_psi_decoder,
void* p_private_decoder,
void dvbpsi_GatherEITSections(dvbpsi_t* p_dvbpsi,
void* p_private_decoder,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeEITSection
*****************************************************************************
......@@ -68,7 +68,6 @@ void dvbpsi_GatherEITSections(dvbpsi_decoder_t* p_psi_decoder,
void dvbpsi_DecodeEITSections(dvbpsi_eit_t* p_eit,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of eit_private.h"
#endif
......
This diff is collapsed.
......@@ -6,6 +6,7 @@
* Authors: Johann Hanne
* heavily based on pmt.c which was written by
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -39,7 +40,6 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_nit_ts_t
*****************************************************************************/
......@@ -66,7 +66,6 @@ typedef struct dvbpsi_nit_ts_s
} dvbpsi_nit_ts_t;
/*****************************************************************************
* dvbpsi_nit_t
*****************************************************************************/
......@@ -93,7 +92,6 @@ typedef struct dvbpsi_nit_s
} dvbpsi_nit_t;
/*****************************************************************************
* dvbpsi_nit_callback
*****************************************************************************/
......@@ -104,27 +102,25 @@ typedef struct dvbpsi_nit_s
*/
typedef void (* dvbpsi_nit_callback)(void* p_cb_data, dvbpsi_nit_t* p_new_nit);
/*****************************************************************************
* dvbpsi_AttachNIT
*****************************************************************************/
/*!
* \fn void dvbpsi_AttachNIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
* \fn int dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_nit_callback pf_callback,
void* p_cb_data)
* \brief Creation and initialization of a NIT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
* \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
* \param i_extension Table ID extension, here service ID.
* \param pf_callback function to call back on new NIT.
* \param p_cb_data private data given in argument to the callback.
* \return 0 if everything went ok.
*/
int dvbpsi_AttachNIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
int dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_nit_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachNIT
*****************************************************************************/
......@@ -132,15 +128,14 @@ int dvbpsi_AttachNIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
* \fn void dvbpsi_DetachNIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a NIT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
* \param i_table_id Table ID, 0x4E, 0x4F, or 0x50-0x6F.
* \param i_extension Table ID extension, here service ID.
* \return nothing.
*/
void dvbpsi_DetachNIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
void dvbpsi_DetachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitNIT/dvbpsi_NewNIT
*****************************************************************************/
......@@ -176,7 +171,6 @@ do { \
dvbpsi_InitNIT(p_nit, i_network_id, i_version, b_current_next); \
} while(0);
/*****************************************************************************
* dvbpsi_EmptyNIT/dvbpsi_DeleteNIT
*****************************************************************************/
......@@ -200,7 +194,6 @@ do { \
free(p_nit); \
} while(0);
/*****************************************************************************
* dvbpsi_NITAddDescriptor
*****************************************************************************/
......@@ -220,7 +213,6 @@ dvbpsi_descriptor_t* dvbpsi_NITAddDescriptor(dvbpsi_nit_t* p_nit,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_NITAddTS
*****************************************************************************/
......@@ -236,7 +228,6 @@ dvbpsi_descriptor_t* dvbpsi_NITAddDescriptor(dvbpsi_nit_t* p_nit,
dvbpsi_nit_ts_t* dvbpsi_NITAddTS(dvbpsi_nit_t* p_nit,
uint16_t i_ts_id, uint16_t i_orig_network_id);
/*****************************************************************************
* dvbpsi_NITTSAddDescriptor
*****************************************************************************/
......@@ -256,7 +247,6 @@ dvbpsi_descriptor_t* dvbpsi_NITTSAddDescriptor(dvbpsi_nit_ts_t* p_ts,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_GenNITSections
*****************************************************************************/
......@@ -264,16 +254,16 @@ dvbpsi_descriptor_t* dvbpsi_NITTSAddDescriptor(dvbpsi_nit_ts_t* p_ts,
* \fn dvbpsi_psi_section_t* dvbpsi_GenNITSections(dvbpsi_nit_t* p_nit,
uint8_t i_table_id)
* \brief NIT generator
* \parma p_dvbpsi dvbpsi handle
* \param p_nit NIT structure
* \param i_table_id table id, 0x40 = actual network / 0x41 = other network
* \return a pointer to the list of generated PSI sections.
*
* Generate NIT sections based on the dvbpsi_nit_t structure.
*/
dvbpsi_psi_section_t* dvbpsi_GenNITSections(dvbpsi_nit_t* p_nit,
dvbpsi_psi_section_t* dvbpsi_GenNITSections(dvbpsi_t* p_dvbpsi, dvbpsi_nit_t* p_nit,
uint8_t i_table_id);
#ifdef __cplusplus
};
#endif
......
......@@ -7,6 +7,7 @@
* Authors: Johann Hanne
* heavily based on pmt.c which was written by
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -36,41 +37,40 @@
*****************************************************************************/
typedef struct dvbpsi_nit_decoder_s
{
uint16_t i_network_id;
DVBPSI_DECODER_COMMON
dvbpsi_nit_callback pf_callback;
void * p_cb_data;
uint16_t i_network_id;
dvbpsi_nit_t current_nit;
dvbpsi_nit_t * p_building_nit;
dvbpsi_nit_callback pf_nit_callback;
void * p_cb_data;
int b_current_valid;
dvbpsi_nit_t current_nit;
dvbpsi_nit_t * p_building_nit;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
int b_current_valid;
} dvbpsi_nit_decoder_t;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
} dvbpsi_nit_decoder_t;
/*****************************************************************************
* dvbpsi_GatherNITSections
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherNITSections(dvbpsi_decoder_t* p_psi_decoder,
void dvbpsi_GatherNITSections(dvbpsi_t* p_dvbpsi,
void* p_private_decoder,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeNITSections
*****************************************************************************
* NIT decoder.
*****************************************************************************/
void dvbpsi_DecodeNITSections(dvbpsi_nit_t* p_nit,
void dvbpsi_DecodeNITSections(dvbpsi_t* p_dvbpsi, dvbpsi_nit_t* p_nit,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of nit_private.h"
#endif
......
This diff is collapsed.
......@@ -103,29 +103,29 @@ typedef void (* dvbpsi_pat_callback)(void* p_cb_data, dvbpsi_pat_t* p_new_pat);
* dvbpsi_AttachPAT
*****************************************************************************/
/*!
* \fn dvbpsi_handle dvbpsi_AttachPAT(dvbpsi_pat_callback pf_callback,
void* p_cb_data)
* \fn dvbpsi_t *dvbpsi_AttachPAT(dvbpsi_pat_callback pf_callback, void* p_cb_data)
* \brief Creation and initialization of a PAT decoder.
* \param p_dvbpsi pointer to dvbpsi_t handle
* \param pf_callback function to call back on new PAT
* \param p_cb_data private data given in argument to the callback
* \return a pointer to the decoder for future calls.
*/
dvbpsi_handle dvbpsi_AttachPAT(dvbpsi_pat_callback pf_callback,
void* p_cb_data);
dvbpsi_t *dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachPAT
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachPAT(dvbpsi_handle h_dvbpsi)
* \fn void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi)
* \brief Destroy a PAT decoder.
* \param h_dvbpsi handle to the decoder
* \param p_dvbpsi pointer to dvbpsi_t handle
* \return nothing.
*
* The handle isn't valid any more.
*/
void dvbpsi_DetachPAT(dvbpsi_handle h_dvbpsi);
void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi);
/*****************************************************************************
......@@ -208,6 +208,7 @@ dvbpsi_pat_program_t* dvbpsi_PATAddProgram(dvbpsi_pat_t* p_pat,
* \fn dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_pat_t* p_pat,
int i_max_pps);
* \brief PAT generator.
* \param p_dvbpsi is a pointer to dvbpsi_t
* \param p_pat pointer to the PAT structure
* \param i_max_pps limitation of the number of program in each section
* (max: 253).
......@@ -215,9 +216,8 @@ dvbpsi_pat_program_t* dvbpsi_PATAddProgram(dvbpsi_pat_t* p_pat,
*
* Generate PAT sections based on the dvbpsi_pat_t structure.
*/
dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_pat_t* p_pat,
int i_max_pps);
dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_t *p_dvbpsi,
dvbpsi_pat_t* p_pat, int i_max_pps);
#ifdef __cplusplus
};
......
......@@ -35,16 +35,18 @@
*****************************************************************************/
typedef struct dvbpsi_pat_decoder_s
{
dvbpsi_pat_callback pf_callback;
void * p_cb_data;
DVBPSI_DECODER_COMMON
dvbpsi_pat_t current_pat;
dvbpsi_pat_t * p_building_pat;
dvbpsi_pat_callback pf_pat_callback;
void * p_cb_data;
int b_current_valid;
dvbpsi_pat_t current_pat;
dvbpsi_pat_t * p_building_pat;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
int b_current_valid;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
} dvbpsi_pat_decoder_t;
......@@ -54,9 +56,7 @@ typedef struct dvbpsi_pat_decoder_s
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherPATSections(dvbpsi_decoder_t* p_decoder,
dvbpsi_psi_section_t* p_section);
void dvbpsi_GatherPATSections(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodePATSection
......@@ -66,7 +66,6 @@ void dvbpsi_GatherPATSections(dvbpsi_decoder_t* p_decoder,
void dvbpsi_DecodePATSections(dvbpsi_pat_t* p_pat,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of pat_private.h"
#endif
......
This diff is collapsed.
......@@ -4,6 +4,7 @@
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -37,7 +38,6 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_pmt_es_t
*****************************************************************************/
......@@ -64,7 +64,6 @@ typedef struct dvbpsi_pmt_es_s
} dvbpsi_pmt_es_t;
/*****************************************************************************
* dvbpsi_pmt_t
*****************************************************************************/
......@@ -93,7 +92,6 @@ typedef struct dvbpsi_pmt_s
} dvbpsi_pmt_t;
/*****************************************************************************
* dvbpsi_pmt_callback
*****************************************************************************/
......@@ -104,38 +102,37 @@ typedef struct dvbpsi_pmt_s
*/
typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
/*****************************************************************************
* dvbpsi_AttachPMT
*****************************************************************************/
/*!
* \fn dvbpsi_handle dvbpsi_AttachPMT(uint16_t i_program_number,
* \fn dvbpsi_t *dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi,
uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data)
* \brief Creation and initialization of a PMT decoder.
* \brief Creates and initialization of a PMT decoder and attaches it to dvbpsi_t
* handle
* \param i_program_number program number
* \param pf_callback function to call back on new PMT
* \param p_cb_data private data given in argument to the callback
* \return a pointer to the decoder for future calls.
*/
dvbpsi_handle dvbpsi_AttachPMT(uint16_t i_program_number,
dvbpsi_t *dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachPMT
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachPMT(dvbpsi_handle h_dvbpsi)
* \fn void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi)
* \brief Destroy a PMT decoder.
* \param h_dvbpsi handle to the decoder
* \param p_dvbpsi handle
* \return nothing.
*
* The handle isn't valid any more.
*/
void dvbpsi_DetachPMT(dvbpsi_handle h_dvbpsi);
void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi);
/*****************************************************************************
* dvbpsi_InitPMT/dvbpsi_NewPMT
......@@ -175,7 +172,6 @@ do { \
i_pcr_pid); \
} while(0);
/*****************************************************************************
* dvbpsi_EmptyPMT/dvbpsi_DeletePMT
*****************************************************************************/
......@@ -199,7 +195,6 @@ do { \
free(p_pmt); \
} while(0);
/*****************************************************************************
* dvbpsi_PMTAddDescriptor
*****************************************************************************/
......@@ -219,7 +214,6 @@ dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_PMTAddES
*****************************************************************************/
......@@ -235,7 +229,6 @@ dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt,
dvbpsi_pmt_es_t* dvbpsi_PMTAddES(dvbpsi_pmt_t* p_pmt,
uint8_t i_type, uint16_t i_pid);
/*****************************************************************************
* dvbpsi_PMTESAddDescriptor
*****************************************************************************/
......@@ -255,20 +248,20 @@ dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_GenPMTSections
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_pmt_t* p_pmt)
* \fn dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_t *p_dvbpsi,
dvbpsi_pmt_t* p_pmt)
* \brief PMT generator
* \param p_dvbpsi is a pointer to dvbpsi_t
* \param p_pmt PMT structure
* \return a pointer to the list of generated PSI sections.
*
* Generate PMT sections based on the dvbpsi_pmt_t structure.
*/
dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_pmt_t* p_pmt);
dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_t *p_dvbpsi, dvbpsi_pmt_t* p_pmt);
#ifdef __cplusplus
};
......@@ -277,4 +270,3 @@ dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_pmt_t* p_pmt);
#else
#error "Multiple inclusions of pmt.h"
#endif
......@@ -5,6 +5,7 @@
* $Id: pmt_private.h,v 1.1 2002/01/22 20:30:16 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -34,31 +35,31 @@
*****************************************************************************/
typedef struct dvbpsi_pmt_decoder_s
{
uint16_t i_program_number;
DVBPSI_DECODER_COMMON
dvbpsi_pmt_callback pf_callback;
void * p_cb_data;
uint16_t i_program_number;
dvbpsi_pmt_t current_pmt;
dvbpsi_pmt_t * p_building_pmt;
dvbpsi_pmt_callback pf_pmt_callback;
void * p_cb_data;
int b_current_valid;
dvbpsi_pmt_t current_pmt;
dvbpsi_pmt_t * p_building_pmt;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
int b_current_valid;
} dvbpsi_pmt_decoder_t;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
} dvbpsi_pmt_decoder_t;
/*****************************************************************************
* dvbpsi_GatherPMTSections
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherPMTSections(dvbpsi_decoder_t* p_decoder,
void dvbpsi_GatherPMTSections(dvbpsi_t *p_dvbpsi,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodePMTSections
*****************************************************************************
......@@ -67,7 +68,6 @@ void dvbpsi_GatherPMTSections(dvbpsi_decoder_t* p_decoder,
void dvbpsi_DecodePMTSections(dvbpsi_pmt_t* p_pmt,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of pmt_private.h"
#endif
......
This diff is collapsed.
......@@ -4,6 +4,7 @@
* $Id$
*
* Authors: Johan Bilien <jobi@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -37,7 +38,6 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_sdt_service_t
*****************************************************************************/
......@@ -65,13 +65,11 @@ typedef struct dvbpsi_sdt_service_s
dvbpsi_descriptor_t * p_first_descriptor; /*!< First of the following
DVB descriptors */
struct dvbpsi_sdt_service_s * p_next; /*!< next element of
the list */
} dvbpsi_sdt_service_t;
/*****************************************************************************
* dvbpsi_sdt_t
*****************************************************************************/
......@@ -98,7 +96,6 @@ typedef struct dvbpsi_sdt_s
} dvbpsi_sdt_t;
/*****************************************************************************
* dvbpsi_sdt_callback
*****************************************************************************/
......@@ -109,42 +106,38 @@ typedef struct dvbpsi_sdt_s
*/
typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
/*****************************************************************************
* dvbpsi_AttachSDT
*****************************************************************************/
/*!
* \fn void dvbpsi_AttachSDT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
* \fn int dvbpsi_AttachSDT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_sdt_callback pf_callback,
void* p_cb_data)
* \brief Creation and initialization of a SDT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi pointer to dvbpsi to hold decoder/demuxer structure
* \param i_table_id Table ID, 0x42 or 0x46.
* \param i_extension Table ID extension, here TS ID.
* \param pf_callback function to call back on new SDT.
* \param p_cb_data private data given in argument to the callback.
* \return 0 if everything went ok.
* \return pointer to dvbpsi handle or NULL on error
*/
int dvbpsi_AttachSDT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
dvbpsi_t *dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_sdt_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachSDT
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachSDT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension)
* \fn void dvbpsi_DetachSDT(dvbpsi_demux_t *p_demux, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a SDT decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi pointer holding decoder/demuxer structure
* \param i_table_id Table ID, 0x42 or 0x46.
* \param i_extension Table ID extension, here TS ID.
* \return nothing.
*/
void dvbpsi_DetachSDT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension);
void dvbpsi_DetachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitSDT/dvbpsi_NewSDT
......@@ -180,7 +173,6 @@ do { \
dvbpsi_InitSDT(p_sdt, i_ts_id, i_version, b_current_next, i_network_id); \
} while(0);
/*****************************************************************************
* dvbpsi_EmptySDT/dvbpsi_DeleteSDT
*****************************************************************************/
......@@ -204,7 +196,6 @@ do { \
free(p_sdt); \
} while(0);
/*****************************************************************************
* dvbpsi_SDTAddService
*****************************************************************************/
......@@ -228,7 +219,6 @@ dvbpsi_sdt_service_t *dvbpsi_SDTAddService(dvbpsi_sdt_t* p_sdt,
uint16_t i_service_id, int b_eit_schedule, int b_eit_present,
uint8_t i_running_status,int b_free_ca);
/*****************************************************************************
* dvbpsi_SDTServiceAddDescriptor
*****************************************************************************/
......@@ -249,13 +239,22 @@ dvbpsi_descriptor_t *dvbpsi_SDTServiceAddDescriptor(
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
/*****************************************************************************
* dvbpsi_GenSDTSections
*****************************************************************************
* Generate SDT sections based on the dvbpsi_sdt_t structure.
*****************************************************************************/
dvbpsi_psi_section_t *dvbpsi_GenSDTSections(dvbpsi_sdt_t * p_sdt);
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenSDTSections(dvbpsi_t *p_dvbpsi,
dvbpsi_sdt_t * p_sdt)
* \brief SDT generator
* \param p_dvbpsi is a pointer to dvbpsi_t
* \param p_sdt SDT structure
* \return a pointer to the list of generated PSI sections.
*
* Generate PMT sections based on the dvbpsi_pmt_t structure.
*/
dvbpsi_psi_section_t *dvbpsi_GenSDTSections(dvbpsi_t *p_dvbpsi, dvbpsi_sdt_t * p_sdt);
#ifdef __cplusplus
};
......
......@@ -5,6 +5,7 @@
* $Id: sdt_private.h,v 1.1 2002/12/11 13:04:57 jobi Exp $
*
* Authors: Johan Bilien <jobi@via.ecp.fr>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -27,7 +28,6 @@
#ifndef _DVBPSI_SDT_PRIVATE_H_
#define _DVBPSI_SDT_PRIVATE_H_
/*****************************************************************************
* dvbpsi_sdt_decoder_t
*****************************************************************************
......@@ -35,30 +35,30 @@
*****************************************************************************/
typedef struct dvbpsi_sdt_decoder_s
{
dvbpsi_sdt_callback pf_callback;
void * p_cb_data;
DVBPSI_DECODER_COMMON
dvbpsi_sdt_t current_sdt;
dvbpsi_sdt_t * p_building_sdt;
dvbpsi_sdt_callback pf_sdt_callback;
void * p_cb_data;
int b_current_valid;
dvbpsi_sdt_t current_sdt;
dvbpsi_sdt_t * p_building_sdt;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
int b_current_valid;
} dvbpsi_sdt_decoder_t;
uint8_t i_last_section_number;
dvbpsi_psi_section_t * ap_sections [256];
} dvbpsi_sdt_decoder_t;
/*****************************************************************************
* dvbpsi_GatherSDTSections
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherSDTSections(dvbpsi_decoder_t* p_psi_decoder,
void* p_private_decoder,
void dvbpsi_GatherSDTSections(dvbpsi_t *p_dvbpsi,
void* p_private_decoder,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeSDTSection
*****************************************************************************
......@@ -67,7 +67,6 @@ void dvbpsi_GatherSDTSections(dvbpsi_decoder_t* p_psi_decoder,
void dvbpsi_DecodeSDTSections(dvbpsi_sdt_t* p_sdt,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of sdt_private.h"
#endif
......
This diff is collapsed.
......@@ -90,7 +90,6 @@ typedef struct dvbpsi_sis_s
DVB descriptors */
/* FIXME: alignment stuffing */
uint32_t i_ecrc; /*!< CRC 32 of decrypted splice_info_section */
} dvbpsi_sis_t;
......@@ -105,7 +104,6 @@ typedef struct dvbpsi_sis_s
*/
typedef void (* dvbpsi_sis_callback)(void* p_cb_data, dvbpsi_sis_t* p_new_sis);
/*****************************************************************************
* dvbpsi_AttachSIS
*****************************************************************************/
......@@ -114,18 +112,17 @@ typedef void (* dvbpsi_sis_callback)(void* p_cb_data, dvbpsi_sis_t* p_new_sis);
uint16_t i_extension, dvbpsi_sis_callback pf_callback,
void* p_cb_data)
* \brief Creation and initialization of a SIS decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi pointer to dvbpsi to hold decoder/demuxer structure
* \param i_table_id Table ID, 0xFC.
* \param i_extension Table ID extension, here TS ID.
* \param pf_callback function to call back on new SIS.
* \param p_cb_data private data given in argument to the callback.
* \return 0 if everything went ok.
*/
int dvbpsi_AttachSIS(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
int dvbpsi_AttachSIS(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_sis_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachSIS
*****************************************************************************/
......@@ -133,15 +130,14 @@ int dvbpsi_AttachSIS(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
* \fn void dvbpsi_DetachSIS(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a SIS decoder.
* \param p_demux Subtable demultiplexor to which the decoder is attached.
* \param p_dvbpsi pointer to dvbpsi to hold decoder/demuxer structure
* \param i_table_id Table ID, 0xFC.
* \param i_extension Table ID extension, here TS ID.
* \return nothing.
*/
void dvbpsi_DetachSIS(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
void dvbpsi_DetachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitSIS/dvbpsi_NewSIS
*****************************************************************************/
......@@ -206,16 +202,16 @@ do { \
* \param p_data descriptor's data
* \return a pointer to the added descriptor.
*/
dvbpsi_descriptor_t *dvbpsi_SISAddDescriptor( dvbpsi_sis_t *p_sis,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
dvbpsi_descriptor_t *dvbpsi_SISAddDescriptor(dvbpsi_sis_t *p_sis,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
/*****************************************************************************
* dvbpsi_GenSISSections
*****************************************************************************
* Generate SIS sections based on the dvbpsi_sis_t structure.
*****************************************************************************/
dvbpsi_psi_section_t *dvbpsi_GenSISSections(dvbpsi_sis_t * p_sis);
dvbpsi_psi_section_t *dvbpsi_GenSISSections(dvbpsi_t *p_dvbpsi, dvbpsi_sis_t * p_sis);
#ifdef __cplusplus
};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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