Commit 7e1ae788 authored by Jean-Paul Saman's avatar Jean-Paul Saman

dvbpsi_AttachXXX() functions now return a boolean iso of pointer to dvbpsi_t *handle.

- dvbpsi_AttachDemux()
- dvbpsi_AttachPAT()
- dvbpsi_AttachPMT()
- dvbpsi_AttachSDT()
- dvbpsi-AttachCAT()
- dvbpsi-AttachBAT()
- dvbpsi-AttachEIT()
- dvbpsi-AttachNIT()
- dvbpsi-AttachTOT()
- dvbpsi-AttachSIS()
parent fc83f896
......@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
......@@ -202,7 +203,8 @@ static void NewSubtableBAT(void * p_zero, dvbpsi_t *p_dvbpsi,
{
if(i_table_id == 0x4a)
{
dvbpsi_AttachBAT(p_dvbpsi, i_table_id, i_extension, DumpBAT, NULL);
if (!dvbpsi_AttachBAT(p_dvbpsi, i_table_id, i_extension, DumpBAT, NULL))
fprintf(stderr, "failed to attach BAT subdecoder\n");
}
}
......@@ -231,8 +233,7 @@ int main(int i_argc, char* pa_argv[])
p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
goto out;
dvbpsi_t *p_demux = dvbpsi_AttachDemux(p_dvbpsi, NewSubtableBAT, NULL);
if(p_demux == NULL)
if (!dvbpsi_AttachDemux(p_dvbpsi, NewSubtableBAT, NULL))
goto out;
b_ok = ReadPacket(i_fd, data);
......
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
......@@ -327,16 +328,15 @@ static void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat)
p_stream->pmt.i_number = p_program->i_number;
p_stream->pmt.pid_pmt = &p_stream->pid[p_program->i_pid];
p_stream->pmt.pid_pmt->i_pid = p_program->i_pid;
dvbpsi_t *p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
p_stream->pmt.handle = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_stream->pmt.handle == NULL)
{
fprintf(stderr, "could not allocate new dvbpsi_t handle\n");
break;
}
p_stream->pmt.handle = dvbpsi_AttachPMT(p_dvbpsi, p_program->i_number, DumpPMT, p_stream );
if (p_stream->pmt.handle == NULL)
if (!dvbpsi_AttachPMT(p_stream->pmt.handle, p_program->i_number, DumpPMT, p_stream ))
{
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_DeleteHandle(p_stream->pmt.handle);
fprintf(stderr, "could not attach PMT\n");
break;
}
......@@ -667,14 +667,12 @@ int main(int i_argc, char* pa_argv[])
report_Header( i_report );
#endif
dvbpsi_t *p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
goto dvbpsi_out;
p_stream->pat.handle = dvbpsi_AttachPAT(p_dvbpsi, DumpPAT, p_stream);
p_stream->pat.handle = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_stream->pat.handle == NULL)
{
goto dvbpsi_out;
}
if (!dvbpsi_AttachPAT(p_stream->pat.handle, DumpPAT, p_stream))
goto dvbpsi_out;
/* Enter infinite loop */
while( i_len > 0 )
{
......
......@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
......@@ -121,8 +122,7 @@ int main(int i_argc, char* pa_argv[])
if (p_dvbpsi == NULL)
goto out;
dvbpsi_t *p_tmp = dvbpsi_AttachPAT(p_dvbpsi, DumpPAT, NULL);
if (p_tmp == NULL)
if (!dvbpsi_AttachPAT(p_dvbpsi, DumpPAT, NULL))
goto out;
b_ok = ReadPacket(i_fd, data);
......
......@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
......@@ -268,8 +269,7 @@ int main(int i_argc, char* pa_argv[])
if (p_dvbpsi == NULL)
goto out;
dvbpsi_t *p_tmp = dvbpsi_AttachPMT(p_dvbpsi, i_program_number, DumpPMT, NULL);
if (p_tmp == NULL)
if (!dvbpsi_AttachPMT(p_dvbpsi, i_program_number, DumpPMT, NULL))
goto out;
b_ok = ReadPacket(i_fd, data);
......
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
......@@ -137,7 +138,8 @@ static void NewSubtable(void * p_zero, dvbpsi_t *p_dvbpsi,
{
if(i_table_id == 0x42)
{
dvbpsi_AttachSDT(p_dvbpsi, i_table_id, i_extension, DumpSDT, NULL);
if (!dvbpsi_AttachSDT(p_dvbpsi, i_table_id, i_extension, DumpSDT, NULL))
fprintf(stderr, "Failed to attach SDT subdecoder\n");
}
}
......@@ -162,8 +164,7 @@ int main(int i_argc, char* pa_argv[])
if (p_dvbpsi == NULL)
goto out;
dvbpsi_t *p_demux= dvbpsi_AttachDemux(p_dvbpsi, NewSubtable, NULL);
if (p_demux == NULL)
if (!dvbpsi_AttachDemux(p_dvbpsi, NewSubtable, NULL))
goto out;
b_ok = ReadPacket(i_fd, data);
......
......@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
......@@ -113,15 +114,13 @@ static void PATCallback( void *_unused, dvbpsi_pat_t *p_pat )
if( p_program->i_number != 0
&& (!i_program || i_program == p_program->i_number) )
{
dvbpsi_t *p_dvbpsi;
pi_pmt_pids[i_nb_programs] = p_program->i_pid;
p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi)
p_pmt_dvbpsi_fds[i_nb_programs] = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_pmt_dvbpsi_fds[i_nb_programs])
{
p_pmt_dvbpsi_fds[i_nb_programs] =
dvbpsi_AttachPMT(p_dvbpsi, p_program->i_number, PMTCallback,
NULL );
i_nb_programs++;
if (dvbpsi_AttachPMT(p_pmt_dvbpsi_fds[i_nb_programs],
p_program->i_number, PMTCallback, NULL))
i_nb_programs++;
}
}
}
......@@ -171,7 +170,6 @@ static void TSHandle( uint8_t *p_ts )
*****************************************************************************/
int main( int i_argc, char **pp_argv )
{
dvbpsi_t *p_dvbpsi;
uint8_t *p_buffer;
int result = EXIT_FAILURE;
......@@ -191,12 +189,11 @@ int main( int i_argc, char **pp_argv )
if ( i_argc == 3 )
i_program = strtol( pp_argv[2], NULL, 0 );
p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
p_pat_dvbpsi_fd = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
if (p_pat_dvbpsi_fd == NULL)
goto out;
p_pat_dvbpsi_fd = dvbpsi_AttachPAT(p_dvbpsi, PATCallback, NULL );
if (p_pat_dvbpsi_fd == NULL)
if (!dvbpsi_AttachPAT(p_pat_dvbpsi_fd, PATCallback, NULL ))
goto out;
p_buffer = malloc( TS_SIZE * READ_ONCE );
......@@ -238,10 +235,10 @@ int main( int i_argc, char **pp_argv )
result = EXIT_SUCCESS;
out:
if (p_dvbpsi)
if (p_pat_dvbpsi_fd)
{
dvbpsi_DetachPAT(p_dvbpsi);
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_DetachPAT(p_pat_dvbpsi_fd);
dvbpsi_DeleteHandle(p_pat_dvbpsi_fd);
}
close( i_fd );
......
......@@ -28,6 +28,7 @@
#include "config.h"
#include <stdio.h>
#include <stdbool.h>
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
......
......@@ -28,6 +28,7 @@
#include "config.h"
#include <stdio.h>
#include <stdbool.h>
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
......
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
......@@ -48,16 +49,16 @@
*****************************************************************************
* Creation of the demux structure
*****************************************************************************/
dvbpsi_t *dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data)
bool dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
assert(p_dvbpsi->p_private == NULL);
dvbpsi_demux_t *p_demux = (dvbpsi_demux_t*)malloc(sizeof(dvbpsi_demux_t));
if (p_demux == NULL)
return NULL;
return false;
/* PSI decoder configuration */
p_demux->pf_callback = &dvbpsi_Demux;
......@@ -74,7 +75,7 @@ dvbpsi_t *dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
p_demux->p_new_cb_data = p_new_cb_data;
p_dvbpsi->p_private = (void *)p_demux;
return p_dvbpsi;
return true;
}
/*****************************************************************************
......
......@@ -126,14 +126,14 @@ struct dvbpsi_demux_s
* dvbpsi_AttachDemux
*****************************************************************************/
/*!
* \fn dvbpsi_t *dvbpsi_AttachDemux(dvbpsi_t *p_dvbpsi, dvbpsi_demux_new_cb_t pf_new_cb, void * p_new_cb_data)
* \brief Creates a new demux structure.
* \fn bool dvbpsi_AttachDemux(dvbpsi_t *p_dvbpsi, dvbpsi_demux_new_cb_t pf_new_cb, void * p_new_cb_data)
* \brief Attaches a new demux structure on dvbpsi_t* handle.
* \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 attached demux structure.
* \return true on success, false on failure
*/
dvbpsi_t *dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
bool dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data);
......
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -39,6 +40,8 @@
#include <stdint.h>
#endif
#include <assert.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../psi.h"
......@@ -52,9 +55,12 @@
*****************************************************************************
* Initialize a BAT subtable decoder.
*****************************************************************************/
int dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
bool dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_bat_callback pf_callback, void* p_cb_data)
{
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_bat_decoder_t* p_bat_decoder;
......@@ -65,20 +71,18 @@ int dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
"Already a decoder for (table_id == 0x%02x,"
"extension == 0x%02x)",
i_table_id, i_extension);
return 1;
return false;
}
p_subdec = (dvbpsi_demux_subdec_t*)malloc(sizeof(dvbpsi_demux_subdec_t));
if (p_subdec == NULL)
{
return 1;
}
return false;
p_bat_decoder = (dvbpsi_bat_decoder_t*)malloc(sizeof(dvbpsi_bat_decoder_t));
if (p_bat_decoder == NULL)
{
free(p_subdec);
return 1;
return false;
}
/* subtable decoder configuration */
......@@ -101,7 +105,7 @@ int dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
for (unsigned int i = 0; i < 256; i++)
p_bat_decoder->ap_sections[i] = NULL;
return 0;
return true;
}
/*****************************************************************************
......@@ -111,6 +115,9 @@ int dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
*****************************************************************************/
void dvbpsi_DetachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
{
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_demux_subdec_t** pp_prev_subdec;
......
......@@ -115,18 +115,18 @@ typedef void (* dvbpsi_bat_callback)(void* p_cb_data, dvbpsi_bat_t* p_new_bat);
* dvbpsi_AttachBAT
*****************************************************************************/
/*!
* \fn void dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool 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.
* \brief Creation and initialization of a BAT decoder. It will be attached to p_dvbpsi.
* \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.
* \return true on success, false on failure
*/
int dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
bool dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_bat_callback pf_callback,
void* p_cb_data);
......
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -53,15 +54,16 @@
*****************************************************************************
* Initialize a CAT decoder and return a handle on it.
*****************************************************************************/
dvbpsi_t *dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
void* p_cb_data)
bool dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
void* p_cb_data)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private == NULL);
dvbpsi_cat_decoder_t* p_cat_decoder;
p_cat_decoder = (dvbpsi_cat_decoder_t*)calloc(1, sizeof(dvbpsi_cat_decoder_t));
if (p_cat_decoder == NULL)
return NULL;
return false;
/* PSI decoder configuration */
p_cat_decoder->pf_callback = &dvbpsi_GatherCATSections;
......@@ -81,7 +83,7 @@ dvbpsi_t *dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
for (unsigned int i = 0; i <= 255; i++)
p_cat_decoder->ap_sections[i] = NULL;
return p_dvbpsi;
return true;
}
/*****************************************************************************
......@@ -91,6 +93,9 @@ dvbpsi_t *dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
*****************************************************************************/
void dvbpsi_DetachCAT(dvbpsi_t *p_dvbpsi)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_cat_decoder_t* p_cat_decoder
= (dvbpsi_cat_decoder_t*)p_dvbpsi->p_private;
free(p_cat_decoder->p_building_cat);
......@@ -165,6 +170,9 @@ dvbpsi_descriptor_t* dvbpsi_CATAddDescriptor(dvbpsi_cat_t* p_cat,
void dvbpsi_GatherCATSections(dvbpsi_t *p_dvbpsi,
dvbpsi_psi_section_t* p_section)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_cat_decoder_t* p_cat_decoder
= (dvbpsi_cat_decoder_t*)p_dvbpsi->p_private;
......
......@@ -77,16 +77,16 @@ typedef void (* dvbpsi_cat_callback)(void* p_cb_data, dvbpsi_cat_t* p_new_cat);
* dvbpsi_AttachCAT
*****************************************************************************/
/*!
* \fn dvbpsi_t *dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi,
* \fn bool dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi,
dvbpsi_cat_callback pf_callback, void* p_cb_data)
* \brief Creation and initialization of a CAT decoder.
* \brief Creation and initialization of a CAT decoder. It will be attached to p_dvbpsi
* \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 dvbpsi_t holding the decoder for future calls.
* \return true on success, false on failure
*/
dvbpsi_t *dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
void* p_cb_data);
bool dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachCAT
......
......@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -38,6 +39,8 @@
#include <stdint.h>
#endif
#include <assert.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../psi.h"
......@@ -51,9 +54,12 @@
*****************************************************************************
* Initialize a EIT subtable decoder.
*****************************************************************************/
dvbpsi_t *dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
bool dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
dvbpsi_eit_callback pf_callback, void* p_cb_data)
{
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_eit_decoder_t* p_eit_decoder;
......@@ -64,18 +70,18 @@ dvbpsi_t *dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
"Already a decoder for (table_id == 0x%02x,"
"extension == 0x%02x)",
i_table_id, i_extension);
return NULL;
return false;
}
p_subdec = (dvbpsi_demux_subdec_t*)calloc(1, sizeof(dvbpsi_demux_subdec_t));
if (p_subdec == NULL)
return NULL;
return false;
p_eit_decoder = (dvbpsi_eit_decoder_t*)calloc(1, sizeof(dvbpsi_eit_decoder_t));
if (p_eit_decoder == NULL)
{
free(p_subdec);
return NULL;
return false;
}
/* subtable decoder configuration */
......@@ -97,7 +103,7 @@ dvbpsi_t *dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
for (unsigned int i = 0; i <= 255; i++)
p_eit_decoder->ap_sections[i] = NULL;
return p_dvbpsi;
return true;
}
/*****************************************************************************
......@@ -108,6 +114,9 @@ dvbpsi_t *dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
void dvbpsi_DetachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension)
{
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_demux_subdec_t** pp_prev_subdec;
......
......@@ -111,7 +111,7 @@ typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
* dvbpsi_AttachEIT
*****************************************************************************/
/*!
* \fn dvbpsi_t *dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool 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.
......@@ -120,11 +120,10 @@ typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
* \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 p_dvbpsi or NULL on error
* \return true on success, false on failure
*/
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);
bool 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
......
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -39,6 +40,8 @@
#include <stdint.h>
#endif
#include <assert.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../psi.h"
......@@ -52,10 +55,13 @@
*****************************************************************************
* Initialize a NIT subtable decoder.
*****************************************************************************/
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)
bool dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_nit_callback pf_callback,
void* p_cb_data)
{
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_nit_decoder_t* p_nit_decoder;
......@@ -66,18 +72,18 @@ int dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
"Already a decoder for (table_id == 0x%02x,"
"extension == 0x%02x)",
i_table_id, i_extension);
return 1;
return false;
}
p_subdec = (dvbpsi_demux_subdec_t*)calloc(1, sizeof(dvbpsi_demux_subdec_t));
if (p_subdec == NULL)
return 1;
return false;
p_nit_decoder = (dvbpsi_nit_decoder_t*)calloc(1, sizeof(dvbpsi_nit_decoder_t));
if (p_nit_decoder == NULL)
{
free(p_subdec);
return 1;
return false;
}
/* subtable decoder configuration */
......@@ -100,7 +106,7 @@ int dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
for (unsigned int i = 0; i <= 255; i++)
p_nit_decoder->ap_sections[i] = NULL;
return 0;
return true;
}
/*****************************************************************************
......
......@@ -106,18 +106,18 @@ typedef void (* dvbpsi_nit_callback)(void* p_cb_data, dvbpsi_nit_t* p_new_nit);
* dvbpsi_AttachNIT
*****************************************************************************/
/*!
* \fn int dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
* \fn bool 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.
* \brief Creation and initialization of a NIT decoder. It is attached to p_dvbpsi.
* \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.
* \return true on success, false on failure
*/
int dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
bool dvbpsi_AttachNIT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_nit_callback pf_callback,
void* p_cb_data);
......
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
......@@ -49,14 +50,15 @@
*****************************************************************************
* Initialize a PAT decoder and return a handle on it.
*****************************************************************************/
dvbpsi_t *dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
void* p_cb_data)
bool dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
void* p_cb_data)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private == NULL);
dvbpsi_pat_decoder_t* p_pat_decoder = (dvbpsi_pat_decoder_t*) calloc(1, sizeof(dvbpsi_pat_decoder_t));
if (p_pat_decoder == NULL)
return NULL;
return false;
/* PSI decoder configuration */
p_pat_decoder->pf_callback = &dvbpsi_GatherPATSections;
......@@ -79,7 +81,7 @@ dvbpsi_t *dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
p_pat_decoder->ap_sections[i] = NULL;
p_dvbpsi->p_private = (void *)p_pat_decoder;
return p_dvbpsi;
return true;
}
......@@ -90,6 +92,9 @@ dvbpsi_t *dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
*****************************************************************************/
void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_pat_decoder_t* p_pat_decoder = (dvbpsi_pat_decoder_t*)p_dvbpsi->p_private;
free(p_pat_decoder->p_building_pat);
......@@ -183,6 +188,7 @@ void dvbpsi_GatherPATSections(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_sectio
int b_append = 1;
int b_reinit = 0;
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_debug(p_dvbpsi, "PAT decoder",
......
......@@ -102,15 +102,15 @@ typedef void (* dvbpsi_pat_callback)(void* p_cb_data, dvbpsi_pat_t* p_new_pat);
* dvbpsi_AttachPAT
*****************************************************************************/
/*!
* \fn dvbpsi_t *dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback, void* p_cb_data)
* \brief Creation and initialization of a PAT decoder.
* \fn bool dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback, void* p_cb_data)
* \brief Creation and initialization of a PAT decoder. The decoder will be attached to 'p_dvbpsi' argument.
* \param p_dvbpsi handle to dvbpsi with attached decoder
* \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.
* \return true on success, false on failure
*/
dvbpsi_t *dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
void* p_cb_data);
bool dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachPAT
......
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -51,15 +52,16 @@
*****************************************************************************
* Initialize a PMT decoder and return a handle on it.
*****************************************************************************/
dvbpsi_t *dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data)
bool dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback, void* p_cb_data)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private == NULL);
dvbpsi_pmt_decoder_t* p_pmt_decoder;
p_pmt_decoder = (dvbpsi_pmt_decoder_t*)malloc(sizeof(dvbpsi_pmt_decoder_t));
if (p_pmt_decoder == NULL)
return NULL;
return false;
p_dvbpsi->p_private = (void *)p_pmt_decoder;
......@@ -83,7 +85,7 @@ dvbpsi_t *dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
for (unsigned int i = 0; i <= 255; i++)
p_pmt_decoder->ap_sections[i] = NULL;
return p_dvbpsi;
return true;
}
/*****************************************************************************
......@@ -93,6 +95,9 @@ dvbpsi_t *dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
*****************************************************************************/
void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_pmt_decoder_t* p_pmt_decoder
= (dvbpsi_pmt_decoder_t*)p_dvbpsi->p_private;
free(p_pmt_decoder->p_building_pmt);
......@@ -236,6 +241,9 @@ dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es,
*****************************************************************************/
void dvbpsi_GatherPMTSections(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t* p_section)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_pmt_decoder_t* p_pmt_decoder = (dvbpsi_pmt_decoder_t*)p_dvbpsi->p_private;
assert(p_pmt_decoder);
......
......@@ -106,21 +106,20 @@ typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
* dvbpsi_AttachPMT
*****************************************************************************/
/*!
* \fn dvbpsi_t *dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi,
uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data)
* \fn bool dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi,
uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data)
* \brief Creates and initialization of a PMT decoder and attaches it to dvbpsi_t
* handle
* \param p_dvbpsi 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.
* \return true on success, false on failure
*/
dvbpsi_t *dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data);
bool dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback, void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachPMT
......
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -37,6 +38,8 @@
#include <stdint.h>
#endif
#include <assert.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../psi.h"
......@@ -50,10 +53,12 @@
*****************************************************************************
* Initialize a SDT subtable decoder.
*****************************************************************************/
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)
bool dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
dvbpsi_sdt_callback pf_callback, void* p_cb_data)
{
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_sdt_decoder_t* p_sdt_decoder;
......@@ -64,18 +69,18 @@ dvbpsi_t *dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
"Already a decoder for (table_id == 0x%02x,"
"extension == 0x%02x)",
i_table_id, i_extension);
return NULL;
return false;
}
p_subdec = (dvbpsi_demux_subdec_t*)calloc(1, sizeof(dvbpsi_demux_subdec_t));
if(p_subdec == NULL)
return NULL;
return false;
p_sdt_decoder = (dvbpsi_sdt_decoder_t*)calloc(1, sizeof(dvbpsi_sdt_decoder_t));
if (p_sdt_decoder == NULL)
{
free(p_subdec);
return NULL;
return false;
}
/* subtable decoder configuration */
......@@ -98,7 +103,7 @@ dvbpsi_t *dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
for (unsigned int i = 0; i <= 255; i++)
p_sdt_decoder->ap_sections[i] = NULL;
return p_dvbpsi;
return true;
}
/*****************************************************************************
......@@ -108,6 +113,9 @@ dvbpsi_t *dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
*****************************************************************************/
void dvbpsi_DetachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension)
{
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_demux_subdec_t** pp_prev_subdec;
......
......@@ -110,20 +110,19 @@ typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
* dvbpsi_AttachSDT
*****************************************************************************/
/*!
* \fn int dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, 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.
* \brief Creation and initialization of a SDT decoder. It is attached to p_dvbpsi.
* \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 pointer to dvbpsi handle or NULL on error
* \return true on success, false on failure
*/
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);
bool 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
......
......@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -52,10 +53,12 @@
*****************************************************************************
* Initialize a SIS subtable decoder.
*****************************************************************************/
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)
bool dvbpsi_AttachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
dvbpsi_sis_callback pf_callback, void* p_cb_data)
{
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_sis_decoder_t* p_sis_decoder;
......@@ -68,20 +71,18 @@ int dvbpsi_AttachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
"Already a decoder for (table_id == 0x%02x,"
"extension == 0x%02x)",
i_table_id, i_extension);
return 1;
return false;
}
p_subdec = (dvbpsi_demux_subdec_t*)malloc(sizeof(dvbpsi_demux_subdec_t));
if (p_subdec == NULL)
{
return 1;
}
return false;
p_sis_decoder = (dvbpsi_sis_decoder_t*)malloc(sizeof(dvbpsi_sis_decoder_t));
if (p_sis_decoder == NULL)
{
free(p_subdec);
return 1;
return false;
}
/* subtable decoder configuration */
......@@ -98,7 +99,7 @@ int dvbpsi_AttachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
p_sis_decoder->pf_sis_callback = pf_callback;
p_sis_decoder->p_cb_data = p_cb_data;
return 0;
return true;
}
/*****************************************************************************
......@@ -109,6 +110,9 @@ int dvbpsi_AttachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
void dvbpsi_DetachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension)
{
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_demux_subdec_t** pp_prev_subdec;
......@@ -220,6 +224,9 @@ void dvbpsi_GatherSISSections(dvbpsi_t *p_dvbpsi,
void * p_private_decoder,
dvbpsi_psi_section_t * p_section)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_demux_t *p_demux = (dvbpsi_demux_t *) p_dvbpsi->p_private;
dvbpsi_sis_decoder_t * p_sis_decoder
= (dvbpsi_sis_decoder_t*)p_private_decoder;
......
......@@ -108,20 +108,19 @@ typedef void (* dvbpsi_sis_callback)(void* p_cb_data, dvbpsi_sis_t* p_new_sis);
* dvbpsi_AttachSIS
*****************************************************************************/
/*!
* \fn void dvbpsi_AttachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool dvbpsi_AttachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_sis_callback pf_callback,
void* p_cb_data)
* \brief Creation and initialization of a SIS decoder.
* \brief Creation and initialization of a SIS decoder. It is attached to p_dvbpsi.
* \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.
* \return true on success, false on failure
*/
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);
bool 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
......
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
......@@ -39,6 +40,8 @@
#include <stdint.h>
#endif
#include <assert.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../psi.h"
......@@ -52,9 +55,12 @@
*****************************************************************************
* Initialize a TDT/TOT subtable decoder.
*****************************************************************************/
int dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
bool dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
dvbpsi_tot_callback pf_callback, void* p_cb_data)
{
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_tot_decoder_t* p_tot_decoder;
......@@ -65,18 +71,18 @@ int dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extensio
"Already a decoder for (table_id == 0x%02x,"
"extension == 0x%02x)",
i_table_id, 0);
return 1;
return false;
}
p_subdec = (dvbpsi_demux_subdec_t*)calloc(1, sizeof(dvbpsi_demux_subdec_t));
if(p_subdec == NULL)
return 1;
return false;
p_tot_decoder = (dvbpsi_tot_decoder_t*)calloc(1, sizeof(dvbpsi_tot_decoder_t));
if (p_tot_decoder == NULL)
{
free(p_subdec);
return 1;
return false;
}
/* subtable decoder configuration */
......@@ -93,7 +99,7 @@ int dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extensio
p_tot_decoder->pf_tot_callback = pf_callback;
p_tot_decoder->p_cb_data = p_cb_data;
return 0;
return true;
}
/*****************************************************************************
......@@ -104,6 +110,9 @@ int dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extensio
void dvbpsi_DetachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension)
{
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_demux_subdec_t** pp_prev_subdec;
......@@ -186,6 +195,9 @@ void dvbpsi_GatherTOTSections(dvbpsi_t* p_dvbpsi,
void * p_private_decoder,
dvbpsi_psi_section_t* p_section)
{
assert(p_dvbpsi);
assert(p_dvbpsi->p_private);
dvbpsi_tot_decoder_t* p_tot_decoder
= (dvbpsi_tot_decoder_t*)p_private_decoder;
int b_append = 1;
......
......@@ -78,7 +78,7 @@ typedef void (* dvbpsi_tot_callback)(void* p_cb_data, dvbpsi_tot_t* p_new_tot);
* dvbpsi_AttachTOT
*****************************************************************************/
/*!
* \fn int dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
* \fn bool dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
dvbpsi_tot_callback pf_callback, void* p_cb_data)
* \brief Creation and initialization of a TDT/TOT decoder.
* \param p_dvbpsi dvbpsi handle pointing to Subtable demultiplexor to which the decoder is attached.
......@@ -86,11 +86,10 @@ typedef void (* dvbpsi_tot_callback)(void* p_cb_data, dvbpsi_tot_t* p_new_tot);
* \param i_extension Table ID extension, unused in the TDT/TOT
* \param pf_callback function to call back on new TDT/TOT.
* \param p_cb_data private data given in argument to the callback.
* \return 0 if everything went ok.
* \return true on success, false on failure
*/
int dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension,
dvbpsi_tot_callback pf_callback, void* p_cb_data);
bool dvbpsi_AttachTOT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
dvbpsi_tot_callback pf_callback, void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachTOT
......
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