Commit 51cc5d44 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Massive renaming of functions in preparation of release.

The function arguments and its order have changed during cleaning up.
This breaks the old API and a rename of functions was needed to properly
mark the older API as deprecated.
parent 0c2c5155
......@@ -4,23 +4,23 @@
needed some cleanup. The following issue are addressed in this version:</p>
<ul>
<li>explicit library handle allocation with <em>dvbpsi_NewHandle()</em> (delete with <em>dvbpsi_DeleteHandle()</em>)</li>
<li>explicit library handle allocation with <em>dvbpsi_new()</em> (delete with <em>dvbpsi_delete()</em>)</li>
<li>consistent API for table and descriptor decoder/encoders</li>
<li>message callback function for easier intergrating libdvbpsi logging in applications</li>
</ul>
<p>The biggest change is the addition off an explicit dvbpsi_t pointer to
ALL table decoder and encoder API's. This dvbpsi_t pointer is a dvbpsi handle
which must be allocated using <em>dvbpsi_NewHandle()</em> and takes a callback function
for logging. The handle must be deleted with <em>dvbpsi_DeleteHandle()</em> if it is no
which must be allocated using <em>dvbpsi_new()</em> and takes a callback function
for logging. The handle must be deleted with <em>dvbpsi_delete()</em> if it is no
longer needed.
</p>
<code>dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, enum dvbpsi_msg_level level);</code>
<code>dvbpsi_t *dvbpsi_new(dvbpsi_message_cb callback, enum dvbpsi_msg_level level);</code>
<p>The dvbpsi_t pointer must be released by calling <em>dvbpsi_DeleteHandle()</em></p>
<p>The dvbpsi_t pointer must be released by calling <em>dvbpsi_delete()</em></p>
<code>void dvbpsi_DeleteHandle(dvbpsi_t *handle);</code>
<code>void dvbpsi_delete(dvbpsi_t *handle);</code>
<h2>Example</h2>
......@@ -41,12 +41,12 @@ and especially to the file examples/dvbinfo/libdvbpsi.c from the dvbinfo applica
<p>The same scheme is used for other PSI tables too, this translate to the following code sequence:</p>
<code>
&nbsp; dvbpsi_t *handle = dvbpsi_NewHandle(&dvbpsi_message, DVBPSI_MSG_DEBUG); <br />
&nbsp; dvbpsi_t *handle = dvbpsi_new(&dvbpsi_message, DVBPSI_MSG_DEBUG); <br />
&nbsp; if (handle == NULL) <br />
&nbsp;&nbsp; goto error; <br />
&nbsp; if (!dvbpsi_AttachPAT(handle, handle_PAT, data)) <br />
&nbsp; if (!dvbpsi_pat_attach(handle, handle_PAT, data)) <br />
&nbsp; { <br />
&nbsp; &nbsp; dvbpsi_DeleteHandle(handle); <br />
&nbsp; &nbsp; dvbpsi_delete(handle); <br />
&nbsp; &nbsp; handle = NULL; <br />
&nbsp; &nbsp; goto error; <br />
&nbsp; } <br />
......@@ -54,10 +54,10 @@ and especially to the file examples/dvbinfo/libdvbpsi.c from the dvbinfo applica
&nbsp; return 0; <br />
&nbsp; <br />
error: <br />
&nbsp; if (dvbpsi_HasDecoder(handle)) <br />
&nbsp; &nbsp; dvbpsi_DetachPAT(andle); <br />
&nbsp; if (dvbpsi_decoder_present(handle)) <br />
&nbsp; &nbsp; dvbpsi_pat_detach(handle); <br />
&nbsp; if (handle) <br />
&nbsp; &nbsp; dvbpsi_DeleteHandle(handle); <br />
&nbsp; &nbsp; dvbpsi_delete(handle); <br />
&nbsp; return -1; <br />
</code>
......
/*! \page usage API usage
<p>Each application requires a handle to the dvbpsi library. The function
dvbpsi_NewHandle(&message_cb, DVBPSI_MSG_DEBUG) will return a handle. All
dvbpsi_new(&message_cb, DVBPSI_MSG_DEBUG) will return a handle. All
error, warning or debug messages will trigger the <em>message_cb</em> function.
Unless DVBPSI_MSG_NONE is passed to dvbpsi_NewHandle(). For each <em>
dvbpsi_AttachXXX()</em> function a unique dvbpsi handle must be used.</p>
Unless DVBPSI_MSG_NONE is passed to dvbpsi_new(). For each <em>
dvbpsi_XXX_attach()</em> function a unique dvbpsi handle must be used.</p>
<p>A dvbpsi handle must be passed to an <em>dvbpsi_AttachXXX()</em> function
which attaches a decoder to the (dvbpsi_t*)->p_private pointer. The
<em>dvbpsi_AttachXXX()</em> function where XXX is the name of the table
(ex: dvbpsi_AttachPAT()). The function returns the dvbpsi handle with the
<p>A dvbpsi handle must be passed to an <em>dvbpsi_XXX_attach()</em> function
which attaches a decoder to the (dvbpsi_t*)->p_decoder pointer. The
<em>dvbpsi_XXX_attach()</em> function where XXX is the name of the table
(ex: dvbpsi_pat_attach()). The function returns the dvbpsi handle with the
new decoder attached decoder.</p>
<p>Then the application has to send the TS packets needed by the decoder
by calling the dvbpsi_PushPacket() function. If a new table is complete
by calling the dvbpsi_packet_push() function. If a new table is complete
then the decoder calls the callback specified by the application when it
called <em>dvbpsi_AttachXXX()</em>.</p>
called <em>dvbpsi_XXX_attach()</em>.</p>
<p>When the application don't need the decoder anymore it just has to
call the <em>dvbpsi_DetachXXX()</em> function (ex:
dvbpsi_DetachPAT()). The dvbpsi handle must be released by calling
dvbpsi_DeleteHandle(). At the time of calling the decoder must already
call the <em>dvbpsi_XXX_detach()</em> function (ex:
dvbpsi_pat_detach()). The dvbpsi handle must be released by calling
dvbpsi_delete(). At the time of calling the decoder must already
have been detached.</p>
<p>Look at the header files for specific table, see the list below:</p>
......
......@@ -191,7 +191,7 @@ static void DumpBAT(void* p_zero, dvbpsi_bat_t* p_bat)
DumpBAT_verbose(p_zero,p_bat);
printf("\n");
}
dvbpsi_DeleteBAT(p_bat);
dvbpsi_bat_delete(p_bat);
}
......@@ -203,7 +203,7 @@ static void NewSubtableBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
{
if(i_table_id == 0x4a)
{
if (!dvbpsi_AttachBAT(p_dvbpsi, i_table_id, i_extension, DumpBAT, NULL))
if (!dvbpsi_bat_attach(p_dvbpsi, i_table_id, i_extension, DumpBAT, NULL))
fprintf(stderr, "failed to attach BAT subdecoder\n");
}
}
......@@ -238,7 +238,7 @@ int main(int i_argc, char* pa_argv[])
if (i_fd < 0)
return 1;
p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_dvbpsi = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
goto out;
if (!dvbpsi_AttachDemux(p_dvbpsi, NewSubtableBAT, NULL))
......@@ -250,7 +250,7 @@ int main(int i_argc, char* pa_argv[])
{
uint16_t i_pid = ((uint16_t)(data[1] & 0x1f) << 8) + data[2];
if(i_pid == 0x11)
dvbpsi_PushPacket(p_dvbpsi, data);
dvbpsi_packet_push(p_dvbpsi, data);
b_ok = ReadPacket(i_fd, data);
}
......@@ -258,7 +258,7 @@ out:
if (p_dvbpsi)
{
dvbpsi_DetachDemux(p_dvbpsi);
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_delete(p_dvbpsi);
}
close(i_fd);
return 0;
......
......@@ -317,8 +317,8 @@ static void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat)
if (p_stream->pmt.handle)
{
fprintf(stderr, "freeing old PMT\n");
dvbpsi_DetachPMT(p_stream->pmt.handle);
dvbpsi_DeleteHandle(p_stream->pmt.handle);
dvbpsi_pmt_detach(p_stream->pmt.handle);
dvbpsi_delete(p_stream->pmt.handle);
p_stream->pmt.handle = NULL;
}
......@@ -334,23 +334,23 @@ static void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat)
{
if (p_stream->pmt.handle)
{
dvbpsi_DetachPMT(p_stream->pmt.handle);
dvbpsi_DeleteHandle(p_stream->pmt.handle);
dvbpsi_pmt_detach(p_stream->pmt.handle);
dvbpsi_delete(p_stream->pmt.handle);
p_stream->pmt.handle = NULL;
}
p_stream->i_pmt++;
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;
p_stream->pmt.handle = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_stream->pmt.handle = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_stream->pmt.handle == NULL)
{
fprintf(stderr, "could not allocate new dvbpsi_t handle\n");
break;
}
if (!dvbpsi_AttachPMT(p_stream->pmt.handle, p_program->i_number, DumpPMT, p_stream ))
if (!dvbpsi_pmt_attach(p_stream->pmt.handle, p_program->i_number, DumpPMT, p_stream ))
{
dvbpsi_DeleteHandle(p_stream->pmt.handle);
dvbpsi_delete(p_stream->pmt.handle);
fprintf(stderr, "could not attach PMT\n");
break;
}
......@@ -359,7 +359,7 @@ static void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat)
p_program = p_program->p_next;
}
fprintf( stderr, " active : %d\n", p_pat->b_current_next);
dvbpsi_DeletePAT(p_pat);
dvbpsi_pat_delete(p_pat);
}
/*****************************************************************************
......@@ -515,7 +515,7 @@ static void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt)
DumpDescriptors(" | ]", p_es->p_first_descriptor);
p_es = p_es->p_next;
}
dvbpsi_DeletePMT(p_pmt);
dvbpsi_pmt_delete(p_pmt);
}
/*****************************************************************************
......@@ -681,10 +681,10 @@ int main(int i_argc, char* pa_argv[])
report_Header( i_report );
#endif
p_stream->pat.handle = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_stream->pat.handle = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_stream->pat.handle == NULL)
goto dvbpsi_out;
if (!dvbpsi_AttachPAT(p_stream->pat.handle, DumpPAT, p_stream))
if (!dvbpsi_pat_attach(p_stream->pat.handle, DumpPAT, p_stream))
goto dvbpsi_out;
/* Enter infinite loop */
......@@ -723,9 +723,9 @@ int main(int i_argc, char* pa_argv[])
continue;
if( i_pid == 0x0 )
dvbpsi_PushPacket(p_stream->pat.handle, p_tmp);
dvbpsi_packet_push(p_stream->pat.handle, p_tmp);
else if( p_stream->pmt.pid_pmt && i_pid == p_stream->pmt.pid_pmt->i_pid )
dvbpsi_PushPacket(p_stream->pmt.handle, p_tmp);
dvbpsi_packet_push(p_stream->pmt.handle, p_tmp);
/* Remember PID */
if( !p_stream->pid[i_pid].b_seen )
......@@ -818,13 +818,13 @@ int main(int i_argc, char* pa_argv[])
}
if( p_stream->pmt.handle )
{
dvbpsi_DetachPMT( p_stream->pmt.handle );
dvbpsi_DeleteHandle( p_stream->pmt.handle );
dvbpsi_pmt_detach( p_stream->pmt.handle );
dvbpsi_delete( p_stream->pmt.handle );
}
if( p_stream->pat.handle )
{
dvbpsi_DetachPAT( p_stream->pat.handle );
dvbpsi_DeleteHandle( p_stream->pat.handle );
dvbpsi_pat_detach( p_stream->pat.handle );
dvbpsi_delete( p_stream->pat.handle );
}
/* clean up */
......@@ -851,8 +851,8 @@ out_of_memory:
dvbpsi_out:
if( p_stream->pat.handle )
{
dvbpsi_DetachPAT( p_stream->pat.handle );
dvbpsi_DeleteHandle( p_stream->pat.handle );
dvbpsi_pat_detach( p_stream->pat.handle );
dvbpsi_delete( p_stream->pat.handle );
}
error:
......
......@@ -93,7 +93,7 @@ static void DumpPAT(void* p_zero, dvbpsi_pat_t* p_pat)
p_program = p_program->p_next;
}
printf( " active : %d\n", p_pat->b_current_next);
dvbpsi_DeletePAT(p_pat);
dvbpsi_pat_delete(p_pat);
}
static void message(dvbpsi_t *handle, const dvbpsi_msg_level_t level, const char* msg)
......@@ -126,11 +126,11 @@ int main(int i_argc, char* pa_argv[])
if (i_fd < 0)
return 1;
p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_dvbpsi = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
goto out;
if (!dvbpsi_AttachPAT(p_dvbpsi, DumpPAT, NULL))
if (!dvbpsi_pat_attach(p_dvbpsi, DumpPAT, NULL))
goto out;
b_ok = ReadPacket(i_fd, data);
......@@ -139,15 +139,15 @@ int main(int i_argc, char* pa_argv[])
{
uint16_t i_pid = ((uint16_t)(data[1] & 0x1f) << 8) + data[2];
if(i_pid == 0x0)
dvbpsi_PushPacket(p_dvbpsi, data);
dvbpsi_packet_push(p_dvbpsi, data);
b_ok = ReadPacket(i_fd, data);
}
out:
if (p_dvbpsi)
{
dvbpsi_DetachPAT(p_dvbpsi);
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_pat_detach(p_dvbpsi);
dvbpsi_delete(p_dvbpsi);
}
close(i_fd);
......
......@@ -236,7 +236,7 @@ static void DumpPMT(void* p_zero, dvbpsi_pmt_t* p_pmt)
DumpDescriptors(" | ]", p_es->p_first_descriptor);
p_es = p_es->p_next;
}
dvbpsi_DeletePMT(p_pmt);
dvbpsi_pmt_delete(p_pmt);
}
static void message(dvbpsi_t *handle, const dvbpsi_msg_level_t level, const char* msg)
......@@ -273,11 +273,11 @@ int main(int i_argc, char* pa_argv[])
i_program_number = atoi(pa_argv[2]);
i_pmt_pid = atoi(pa_argv[3]);
p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_dvbpsi = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
goto out;
if (!dvbpsi_AttachPMT(p_dvbpsi, i_program_number, DumpPMT, NULL))
if (!dvbpsi_pmt_attach(p_dvbpsi, i_program_number, DumpPMT, NULL))
goto out;
b_ok = ReadPacket(i_fd, data);
......@@ -286,15 +286,15 @@ int main(int i_argc, char* pa_argv[])
{
uint16_t i_pid = ((uint16_t)(data[1] & 0x1f) << 8) + data[2];
if(i_pid == i_pmt_pid)
dvbpsi_PushPacket(p_dvbpsi, data);
dvbpsi_packet_push(p_dvbpsi, data);
b_ok = ReadPacket(i_fd, data);
}
out:
if (p_dvbpsi)
{
dvbpsi_DetachPMT(p_dvbpsi);
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_pmt_detach(p_dvbpsi);
dvbpsi_delete(p_dvbpsi);
}
close(i_fd);
......
......@@ -119,7 +119,7 @@ static void DumpSDT(void* p_zero, dvbpsi_sdt_t* p_sdt)
DumpDescriptors(" | ]", p_service->p_first_descriptor);
p_service = p_service->p_next;
}
dvbpsi_DeleteSDT(p_sdt);
dvbpsi_sdt_delete(p_sdt);
}
/*****************************************************************************
......@@ -146,7 +146,7 @@ static void NewSubtable(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_exten
{
if(i_table_id == 0x42)
{
if (!dvbpsi_AttachSDT(p_dvbpsi, i_table_id, i_extension, DumpSDT, NULL))
if (!dvbpsi_sdt_attach(p_dvbpsi, i_table_id, i_extension, DumpSDT, NULL))
fprintf(stderr, "Failed to attach SDT subdecoder\n");
}
}
......@@ -168,7 +168,7 @@ int main(int i_argc, char* pa_argv[])
if (i_fd < 0)
return 1;
p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_dvbpsi = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
goto out;
......@@ -181,7 +181,7 @@ int main(int i_argc, char* pa_argv[])
{
uint16_t i_pid = ((uint16_t)(data[1] & 0x1f) << 8) + data[2];
if(i_pid == 0x11)
dvbpsi_PushPacket(p_dvbpsi, data);
dvbpsi_packet_push(p_dvbpsi, data);
b_ok = ReadPacket(i_fd, data);
}
......@@ -189,7 +189,7 @@ out:
if (p_dvbpsi)
{
dvbpsi_DetachDemux(p_dvbpsi);
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_delete(p_dvbpsi);
}
close(i_fd);
return 0;
......
This diff is collapsed.
......@@ -93,7 +93,7 @@ static void PMTCallback( void *_unused, dvbpsi_pmt_t *p_pmt )
{
if ( p_pmt->i_program_number != i_program )
{
dvbpsi_DeletePMT( p_pmt );
dvbpsi_pmt_delete( p_pmt );
return;
}
......@@ -112,7 +112,7 @@ static void PATCallback( void *_unused, dvbpsi_pat_t *p_pat )
if (i_nb_programs >= MAX_PROGRAMS)
{
fprintf(stderr, "Too many PMT programs\n");
dvbpsi_DeletePAT( p_pat );
dvbpsi_pat_delete( p_pat );
return;
}
......@@ -123,17 +123,17 @@ static void PATCallback( void *_unused, dvbpsi_pat_t *p_pat )
&& (!i_program || i_program == p_program->i_number) )
{
pi_pmt_pids[i_nb_programs] = p_program->i_pid;
p_pmt_dvbpsi_fds[i_nb_programs] = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_pmt_dvbpsi_fds[i_nb_programs] = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_pmt_dvbpsi_fds[i_nb_programs])
{
if (dvbpsi_AttachPMT(p_pmt_dvbpsi_fds[i_nb_programs],
if (dvbpsi_pmt_attach(p_pmt_dvbpsi_fds[i_nb_programs],
p_program->i_number, PMTCallback, NULL))
i_nb_programs++;
}
}
}
dvbpsi_DeletePAT( p_pat );
dvbpsi_pat_delete( p_pat );
}
/*****************************************************************************
......@@ -163,13 +163,13 @@ static void TSHandle( uint8_t *p_ts )
if ( i_pid == 0 && !i_nb_programs )
{
dvbpsi_PushPacket( p_pat_dvbpsi_fd, p_ts );
dvbpsi_packet_push( p_pat_dvbpsi_fd, p_ts );
}
for ( i = 0; i < i_nb_programs; i++ )
{
if ( pi_pmt_pids[i] == i_pid )
dvbpsi_PushPacket( p_pmt_dvbpsi_fds[i], p_ts );
dvbpsi_packet_push( p_pmt_dvbpsi_fds[i], p_ts );
}
}
......@@ -197,11 +197,11 @@ int main( int i_argc, char **pp_argv )
if ( i_argc == 3 )
i_program = strtol( pp_argv[2], NULL, 0 );
p_pat_dvbpsi_fd = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
p_pat_dvbpsi_fd = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_pat_dvbpsi_fd == NULL)
goto out;
if (!dvbpsi_AttachPAT(p_pat_dvbpsi_fd, PATCallback, NULL ))
if (!dvbpsi_pat_attach(p_pat_dvbpsi_fd, PATCallback, NULL ))
goto out;
p_buffer = malloc( TS_SIZE * READ_ONCE );
......@@ -236,8 +236,8 @@ int main( int i_argc, char **pp_argv )
{
if (p_pmt_dvbpsi_fds[i])
{
dvbpsi_DetachPMT(p_pmt_dvbpsi_fds[i]);
dvbpsi_DeleteHandle(p_pmt_dvbpsi_fds[i]);
dvbpsi_pmt_detach(p_pmt_dvbpsi_fds[i]);
dvbpsi_delete(p_pmt_dvbpsi_fds[i]);
}
p_pmt_dvbpsi_fds[i] = NULL;
}
......@@ -246,8 +246,8 @@ int main( int i_argc, char **pp_argv )
out:
if (p_pat_dvbpsi_fd)
{
dvbpsi_DetachPAT(p_pat_dvbpsi_fd);
dvbpsi_DeleteHandle(p_pat_dvbpsi_fd);
dvbpsi_pat_detach(p_pat_dvbpsi_fd);
dvbpsi_delete(p_pat_dvbpsi_fd);
}
close( i_fd );
......
......@@ -120,36 +120,36 @@ int main(int i_argc, char* pa_argv[])
dvbpsi_psi_section_t* p_section5, * p_section6;
int i;
dvbpsi_t *p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
dvbpsi_t *p_dvbpsi = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
return 1;
/* PAT generation */
dvbpsi_InitPAT(&pat, 1, 0, 0);
dvbpsi_PATAddProgram(&pat, 0, 0x12);
dvbpsi_PATAddProgram(&pat, 1, 0x42);
dvbpsi_PATAddProgram(&pat, 2, 0x21);
dvbpsi_PATAddProgram(&pat, 3, 0x24);
dvbpsi_pat_init(&pat, 1, 0, 0);
dvbpsi_pat_program_add(&pat, 0, 0x12);
dvbpsi_pat_program_add(&pat, 1, 0x42);
dvbpsi_pat_program_add(&pat, 2, 0x21);
dvbpsi_pat_program_add(&pat, 3, 0x24);
for(i = 4; i < 43; i++)
dvbpsi_PATAddProgram(&pat, i, i);
dvbpsi_pat_program_add(&pat, i, i);
p_section1 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 4);
p_section1 = dvbpsi_pat_sections_generate(p_dvbpsi, &pat, 4);
pat.b_current_next = 1;
p_section2 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 8);
p_section2 = dvbpsi_pat_sections_generate(p_dvbpsi, &pat, 8);
pat.i_version = 1;
pat.b_current_next = 0;
p_section3 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 16);
p_section3 = dvbpsi_pat_sections_generate(p_dvbpsi, &pat, 16);
pat.b_current_next = 1;
p_section4 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 300);
p_section4 = dvbpsi_pat_sections_generate(p_dvbpsi, &pat, 300);
pat.i_version = 2;
pat.b_current_next = 0;
p_section5 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 16);
p_section5 = dvbpsi_pat_sections_generate(p_dvbpsi, &pat, 16);
pat.b_current_next = 1;
p_section6 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 16);
p_section6 = dvbpsi_pat_sections_generate(p_dvbpsi, &pat, 16);
/* TS packets generation */
packet[0] = 0x47;
......@@ -170,9 +170,9 @@ int main(int i_argc, char* pa_argv[])
dvbpsi_DeletePSISections(p_section5);
dvbpsi_DeletePSISections(p_section6);
dvbpsi_EmptyPAT(&pat);
dvbpsi_pat_empty(&pat);
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_delete(p_dvbpsi);
return 0;
}
......@@ -124,39 +124,39 @@ int main(int i_argc, char* pa_argv[])
dvbpsi_psi_section_t* p_section3, * p_section4;
dvbpsi_psi_section_t* p_section5, * p_section6;
dvbpsi_t *p_dvbpsi = dvbpsi_NewHandle(&message, DVBPSI_MSG_DEBUG);
dvbpsi_t *p_dvbpsi = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_dvbpsi == NULL)
return 1;
/* PMT generation */
dvbpsi_InitPMT(&pmt, 12, 0, 0, 42);
dvbpsi_PMTAddDescriptor(&pmt, 12, 26, data);
dvbpsi_PMTAddDescriptor(&pmt, 42, 12, data + 12);
dvbpsi_PMTAddDescriptor(&pmt, 2, 1, data + 4);
dvbpsi_PMTAddDescriptor(&pmt, 0, 4, data + 7);
p_es = dvbpsi_PMTAddES(&pmt, 12, 42);
dvbpsi_PMTESAddDescriptor(p_es, 12, 26, data);
dvbpsi_PMTESAddDescriptor(p_es, 42, 12, data + 12);
dvbpsi_PMTESAddDescriptor(p_es, 2, 1, data + 4);
dvbpsi_PMTESAddDescriptor(p_es, 0, 4, data + 7);
p_section1 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
dvbpsi_pmt_init(&pmt, 12, 0, 0, 42);
dvbpsi_pmt_descriptor_add(&pmt, 12, 26, data);
dvbpsi_pmt_descriptor_add(&pmt, 42, 12, data + 12);
dvbpsi_pmt_descriptor_add(&pmt, 2, 1, data + 4);
dvbpsi_pmt_descriptor_add(&pmt, 0, 4, data + 7);
p_es = dvbpsi_pmt_es_add(&pmt, 12, 42);
dvbpsi_pmt_es_descriptor_add(p_es, 12, 26, data);
dvbpsi_pmt_es_descriptor_add(p_es, 42, 12, data + 12);
dvbpsi_pmt_es_descriptor_add(p_es, 2, 1, data + 4);
dvbpsi_pmt_es_descriptor_add(p_es, 0, 4, data + 7);
p_section1 = dvbpsi_pmt_sections_generate(p_dvbpsi, &pmt);
pmt.b_current_next = 1;
p_section2 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
p_section2 = dvbpsi_pmt_sections_generate(p_dvbpsi, &pmt);
pmt.i_version = 1;
pmt.b_current_next = 0;
p_section3 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
p_section3 = dvbpsi_pmt_sections_generate(p_dvbpsi, &pmt);
pmt.b_current_next = 1;
p_section4 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
p_section4 = dvbpsi_pmt_sections_generate(p_dvbpsi, &pmt);
pmt.i_version = 2;
pmt.b_current_next = 0;
p_section5 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
p_section5 = dvbpsi_pmt_sections_generate(p_dvbpsi, &pmt);
pmt.b_current_next = 1;
p_section6 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
p_section6 = dvbpsi_pmt_sections_generate(p_dvbpsi, &pmt);
/* TS packets generation */
packet[0] = 0x47;
......@@ -179,8 +179,8 @@ int main(int i_argc, char* pa_argv[])
dvbpsi_DeletePSISections(p_section5);
dvbpsi_DeletePSISections(p_section6);
dvbpsi_EmptyPMT(&pmt);
dvbpsi_DeleteHandle(p_dvbpsi);
dvbpsi_pmt_empty(&pmt);
dvbpsi_delete(p_dvbpsi);
return 0;
}
......@@ -57,8 +57,8 @@ bool dvbpsi_AttachDemux(dvbpsi_t * p_dvbpsi,
assert(p_dvbpsi->p_decoder == NULL);
dvbpsi_demux_t *p_demux;
p_demux = (dvbpsi_demux_t*) dvbpsi_NewDecoder(&dvbpsi_Demux, 4096, true,
sizeof(dvbpsi_demux_t));
p_demux = (dvbpsi_demux_t*) dvbpsi_decoder_new(&dvbpsi_Demux, 4096, true,
sizeof(dvbpsi_demux_t));
if (p_demux == NULL)
return false;
......@@ -149,7 +149,7 @@ void dvbpsi_DetachDemux(dvbpsi_t *p_dvbpsi)
else free(p_subdec_temp);
}
dvbpsi_DeleteDecoder(p_dvbpsi->p_decoder);
dvbpsi_decoder_delete(p_dvbpsi->p_decoder);
p_dvbpsi->p_decoder = NULL;
}
......@@ -194,7 +194,7 @@ void dvbpsi_DeleteDemuxSubDecoder(dvbpsi_demux_subdec_t *p_subdec)
if (!p_subdec)
return;
/* FIXME: find a saner way to release private decoder resources */
dvbpsi_DeleteDecoder(p_subdec->p_decoder);
dvbpsi_decoder_delete(p_subdec->p_decoder);
free(p_subdec);
p_subdec = NULL;
}
......
......@@ -241,6 +241,23 @@ void dvbpsi_AttachDemuxSubDecoder(dvbpsi_demux_t *p_demux, dvbpsi_demux_subdec_t
*/
void dvbpsi_DetachDemuxSubDecoder(dvbpsi_demux_t *p_demux, dvbpsi_demux_subdec_t *p_subdec);
/*****************************************************************************
* deprecated API's
*****************************************************************************/
#if 0
__attribute__((deprecated))
dvbpsi_handle dvbpsi_AttachDemux(dvbpsi_demux_new_cb_t pf_new_cb,
void * p_new_cb_data);
__attribute__((deprecated))
void dvbpsi_DetachDemux(dvbpsi_handle h_dvbpsi);
__attribute__((deprecated))
dvbpsi_demux_subdec_t * dvbpsi_demuxGetSubDec(dvbpsi_demux_t * p_demux,
uint8_t i_table_id,
uint16_t i_extension);
__attribute__((deprecated))
void dvbpsi_Demux(dvbpsi_handle h_dvbpsi, dvbpsi_psi_section_t * p_section);
#endif
#ifdef __cplusplus
};
#endif
......@@ -248,4 +265,3 @@ void dvbpsi_DetachDemuxSubDecoder(dvbpsi_demux_t *p_demux, dvbpsi_demux_subdec_t
#else
#error "Multiple inclusions of demux.h"
#endif
/*****************************************************************************
* deprecated.h
* Copyright (C) 2012 VideoLAN
* $Id$
*
* Authors: 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
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _DVBPSI_DEPRECATED_H_
#define _DVBPSI_DEPRECATED_H_
/*!
* \file <deprecated.h>
* \author Jean-Paul Saman <jpsaman@videolan.org>
* \brief Deprecated Application interface for all DVB/PSI decoders.
*
* The application interface for DVBPSI version < 1.0.0 has changed.
* The affected functions are mentioned in this headerfile. Developers
* are urged to use the current application interface instead. It offers
* the same functionality and a bit more.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* dvbpsi_private.h */
/* descriptor.h */
/* psi.h */
/* demux.h */
/*****************************************************************************
* Decoders
*****************************************************************************/
/*****************************************************************************
* Descriptors
*****************************************************************************/
#ifdef __cplusplus
};
#endif
#else
#error "Multiple inclusions of deprecated.h"
#endif
/*****************************************************************************
* dvbpsi.c: conversion from TS packets to PSI sections
*----------------------------------------------------------------------------
* Copyright (C) 2001-2011 VideoLAN
* Copyright (C) 2001-2012 VideoLAN
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -142,35 +142,36 @@ uint32_t dvbpsi_crc32_table[256] =
};
/*****************************************************************************
* dvbpsi_NewHandle
* dvbpsi_new
*****************************************************************************/
dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, enum dvbpsi_msg_level level)
dvbpsi_t *dvbpsi_new(dvbpsi_message_cb callback, enum dvbpsi_msg_level level)
{
dvbpsi_t *p_dvbpsi = calloc(1, sizeof(dvbpsi_t));
if (p_dvbpsi != NULL)
{
p_dvbpsi->p_decoder = NULL;
p_dvbpsi->pf_message = callback;
p_dvbpsi->i_msg_level = level;
}
if (p_dvbpsi == NULL)
return NULL;
p_dvbpsi->p_decoder = NULL;
p_dvbpsi->pf_message = callback;
p_dvbpsi->i_msg_level = level;
return p_dvbpsi;
}
/*****************************************************************************
* dvbpsi_DeleteHandle
* dvbpsi_delete
*****************************************************************************/
void dvbpsi_DeleteHandle(dvbpsi_t *p_dvbpsi)
void dvbpsi_delete(dvbpsi_t *p_dvbpsi)
{
assert(p_dvbpsi->p_decoder == NULL);
p_dvbpsi->pf_message = NULL;
if (p_dvbpsi)
p_dvbpsi->pf_message = NULL;
free(p_dvbpsi);
}
/*****************************************************************************
* dvbpsi_NewDecoder
* dvbpsi_decoder_new
*****************************************************************************/
#define DVBPSI_INVALID_CC (0xFF)
dvbpsi_decoder_t *dvbpsi_NewDecoder(dvbpsi_callback_gather_t pf_gather,
dvbpsi_decoder_t *dvbpsi_decoder_new(dvbpsi_callback_gather_t pf_gather,
const int i_section_max_size, const bool b_discontinuity, const size_t psi_size)
{
assert(psi_size >= sizeof(dvbpsi_decoder_t));
......@@ -197,9 +198,9 @@ dvbpsi_decoder_t *dvbpsi_NewDecoder(dvbpsi_callback_gather_t pf_gather,
}
/*****************************************************************************
* dvbpsi_ReinitDecoder
* dvbpsi_decoder_reset
*****************************************************************************/
void dvbpsi_ReInitDecoder(dvbpsi_decoder_t* p_decoder, const bool b_force)
void dvbpsi_decoder_reset(dvbpsi_decoder_t* p_decoder, const bool b_force)
{
assert(p_decoder);
......@@ -219,9 +220,9 @@ void dvbpsi_ReInitDecoder(dvbpsi_decoder_t* p_decoder, const bool b_force)
}
/*****************************************************************************
* dvbpsi_SectionsCompleteDecoder
* dvbpsi_decoder_sections_completed
*****************************************************************************/
bool dvbpsi_SectionsCompleteDecoder(dvbpsi_decoder_t* p_decoder)
bool dvbpsi_decoder_sections_completed(dvbpsi_decoder_t* p_decoder)
{
assert(p_decoder);
assert(p_decoder->i_last_section_number <= 255);
......@@ -241,9 +242,9 @@ bool dvbpsi_SectionsCompleteDecoder(dvbpsi_decoder_t* p_decoder)
}
/*****************************************************************************
* dvbpsi_ChainSectionsDecoder
* dvbpsi_decoder_sections_chain
*****************************************************************************/
void dvbpsi_ChainSectionsDecoder(dvbpsi_decoder_t *p_decoder)
void dvbpsi_decoder_sections_chain(dvbpsi_decoder_t *p_decoder)
{
assert(p_decoder);
assert(p_decoder->i_last_section_number <= 255);
......@@ -257,9 +258,9 @@ void dvbpsi_ChainSectionsDecoder(dvbpsi_decoder_t *p_decoder)
}
/*****************************************************************************
* dvbpsi_AddSectionDecoder
* dvbpsi_decoder_section_add
*****************************************************************************/
bool dvbpsi_AddSectionDecoder(dvbpsi_decoder_t *p_decoder, dvbpsi_psi_section_t *p_section)
bool dvbpsi_decoder_section_add(dvbpsi_decoder_t *p_decoder, dvbpsi_psi_section_t *p_section)
{
assert(p_decoder);
assert(p_section);
......@@ -277,9 +278,9 @@ bool dvbpsi_AddSectionDecoder(dvbpsi_decoder_t *p_decoder, dvbpsi_psi_section_t
}
/*****************************************************************************
* dvbpsi_DeleteDecoder
* dvbpsi_decoder_delete
*****************************************************************************/
void dvbpsi_DeleteDecoder(dvbpsi_decoder_t *p_decoder)
void dvbpsi_decoder_delete(dvbpsi_decoder_t *p_decoder)
{
assert(p_decoder);
......@@ -295,9 +296,9 @@ void dvbpsi_DeleteDecoder(dvbpsi_decoder_t *p_decoder)
}
/*****************************************************************************
* dvbpsi_HasDecoder
* dvbpsi_decoder_present
*****************************************************************************/
bool dvbpsi_HasDecoder(dvbpsi_t *p_dvbpsi)
bool dvbpsi_decoder_present(dvbpsi_t *p_dvbpsi)
{
if (p_dvbpsi && p_dvbpsi->p_decoder)
return true;
......@@ -306,11 +307,11 @@ bool dvbpsi_HasDecoder(dvbpsi_t *p_dvbpsi)
}
/*****************************************************************************
* dvbpsi_PushPacket
* dvbpsi_packet_push
*****************************************************************************
* Injection of a TS packet into a PSI decoder.
*****************************************************************************/
bool dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
{
uint8_t i_expected_counter; /* Expected continuity counter */
dvbpsi_psi_section_t* p_section; /* Current section */
......@@ -431,7 +432,7 @@ bool dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
p_decoder->b_complete_header = true;
/* Compute p_section->i_length and update p_decoder->i_need */
p_decoder->i_need = p_section->i_length
= ((uint16_t)(p_section->p_data[1] & 0xf)) << 8
= ((uint16_t)(p_section->p_data[1] & 0xf)) << 8
| p_section->p_data[2];
/* Check that the section isn't too long */
if (p_decoder->i_need > p_decoder->i_section_max_size - 3)
......@@ -476,7 +477,7 @@ bool dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
p_section->i_table_id = p_section->p_data[0];
if (p_section->b_syntax_indicator)
{
p_section->i_extension = (p_section->p_data[3] << 8)
p_section->i_extension = (p_section->p_data[3] << 8)
| p_section->p_data[4];
p_section->i_version = (p_section->p_data[5] & 0x3e) >> 1;
p_section->b_current_next = p_section->p_data[5] & 0x1;
......@@ -565,7 +566,7 @@ bool dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
#define DVBPSI_MSG_FORMAT "libdvbpsi (%s): %s"
#ifdef HAVE_VARIADIC_MACROS
void message(dvbpsi_t *dvbpsi, const dvbpsi_msg_level_t level, const char *fmt, ...)
void dvbpsi_message(dvbpsi_t *dvbpsi, const dvbpsi_msg_level_t level, const char *fmt, ...)
{
if ((dvbpsi->i_msg_level > DVBPSI_MSG_NONE) &&
(level <= dvbpsi->i_msg_level))
......
This diff is collapsed.
/*****************************************************************************
* dvbpsi_private.h: main private header
*----------------------------------------------------------------------------
* Copyright (C) 2001-2010 VideoLAN
* Copyright (C) 2001-2012 VideoLAN
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -42,7 +42,7 @@ extern uint32_t dvbpsi_crc32_table[];
*****************************************************************************/
#ifdef HAVE_VARIADIC_MACROS
void message(dvbpsi_t *dvbpsi, const int level, const char *fmt, ...);
void dvbpsi_message(dvbpsi_t *dvbpsi, const int level, const char *fmt, ...);
# define dvbpsi_error(hnd, src, str, x...) \
message(hnd, DVBPSI_MSG_ERROR, "libdvbpsi error ("src"): " str, ##x)
......
......@@ -97,7 +97,7 @@ bool dvbpsi_atsc_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
}
dvbpsi_atsc_eit_decoder_t* p_eit_decoder;
p_eit_decoder = (dvbpsi_atsc_eit_decoder_t*) dvbpsi_NewDecoder(NULL,
p_eit_decoder = (dvbpsi_atsc_eit_decoder_t*) dvbpsi_decoder_new(NULL,
0, true, sizeof(dvbpsi_atsc_eit_decoder_t));
if (p_eit_decoder == NULL)
return false;
......@@ -107,7 +107,7 @@ bool dvbpsi_atsc_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
dvbpsi_atsc_GatherEITSections, DVBPSI_DECODER(p_eit_decoder));
if (p_subdec == NULL)
{
dvbpsi_DeleteDecoder(DVBPSI_DECODER(p_eit_decoder));
dvbpsi_decoder_delete(DVBPSI_DECODER(p_eit_decoder));
return false;
}
......@@ -290,7 +290,7 @@ static void dvbpsi_ReInitEIT(dvbpsi_atsc_eit_decoder_t *p_decoder, const bool b_
{
assert(p_decoder);
dvbpsi_ReInitDecoder(DVBPSI_DECODER(p_decoder), b_force);
dvbpsi_decoder_reset(DVBPSI_DECODER(p_decoder), b_force);
/* Force redecoding */
if (b_force)
......@@ -359,7 +359,7 @@ static bool dvbpsi_AddSectionEIT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_eit_decoder_t *
}
/* Fill the section array */
if (dvbpsi_AddSectionDecoder(DVBPSI_DECODER(p_decoder), p_section))
if (dvbpsi_decoder_section_add(DVBPSI_DECODER(p_decoder), p_section))
dvbpsi_debug(p_dvbpsi, "ATSC EIT decoder", "overwrite section number %d",
p_section->i_number);
......@@ -458,7 +458,7 @@ static void dvbpsi_atsc_GatherEITSections(dvbpsi_t * p_dvbpsi,
}
/* Check if we have all the sections */
if (dvbpsi_SectionsCompleteDecoder(DVBPSI_DECODER(p_eit_decoder)))
if (dvbpsi_decoder_sections_completed(DVBPSI_DECODER(p_eit_decoder)))
{
assert(p_eit_decoder->pf_eit_callback);
......@@ -466,7 +466,7 @@ static void dvbpsi_atsc_GatherEITSections(dvbpsi_t * p_dvbpsi,
p_eit_decoder->current_eit = *p_eit_decoder->p_building_eit;
p_eit_decoder->b_current_valid = true;
/* Chain the sections */
dvbpsi_ChainSectionsDecoder(DVBPSI_DECODER(p_eit_decoder));
dvbpsi_decoder_sections_chain(DVBPSI_DECODER(p_eit_decoder));
/* Decode the sections */
dvbpsi_atsc_DecodeEITSections(p_eit_decoder->p_building_eit,
p_eit_decoder->ap_sections[0]);
......
......@@ -109,7 +109,7 @@ bool dvbpsi_atsc_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_atsc_eit_callback pf_callback, void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachEIT
* dvbpsi_eit_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_atsc_DetachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
......
......@@ -100,7 +100,7 @@ bool dvbpsi_atsc_AttachETT(dvbpsi_t * p_dvbpsi, uint8_t i_table_id, uint16_t i_e
}
dvbpsi_atsc_ett_decoder_t* p_ett_decoder;
p_ett_decoder = (dvbpsi_atsc_ett_decoder_t*) dvbpsi_NewDecoder(NULL,
p_ett_decoder = (dvbpsi_atsc_ett_decoder_t*) dvbpsi_decoder_new(NULL,
0, true, sizeof(dvbpsi_atsc_ett_decoder_t));
if (p_ett_decoder == NULL)
return false;
......@@ -111,7 +111,7 @@ bool dvbpsi_atsc_AttachETT(dvbpsi_t * p_dvbpsi, uint8_t i_table_id, uint16_t i_e
dvbpsi_atsc_GatherETTSections, DVBPSI_DECODER(p_ett_decoder));
if (p_subdec == NULL)
{
dvbpsi_DeleteDecoder(DVBPSI_DECODER(p_ett_decoder));
dvbpsi_decoder_delete(DVBPSI_DECODER(p_ett_decoder));
return false;
}
......@@ -228,7 +228,7 @@ static void dvbpsi_ReInitETT(dvbpsi_atsc_ett_decoder_t *p_decoder, const bool b_
{
assert(p_decoder);
dvbpsi_ReInitDecoder(DVBPSI_DECODER(p_decoder), b_force);
dvbpsi_decoder_reset(DVBPSI_DECODER(p_decoder), b_force);
/* Force redecoding */
if (b_force)
......@@ -303,7 +303,7 @@ static bool dvbpsi_AddSectionETT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_ett_decoder_t *
}
/* Fill the section array */
if (dvbpsi_AddSectionDecoder(DVBPSI_DECODER(p_decoder), p_section))
if (dvbpsi_decoder_section_add(DVBPSI_DECODER(p_decoder), p_section))
dvbpsi_debug(p_dvbpsi, "ATSC ETT decoder", "overwrite section number %d",
p_section->i_number);
......@@ -380,7 +380,7 @@ static void dvbpsi_atsc_GatherETTSections(dvbpsi_t* p_dvbpsi,
}
/* Check if we have all the sections */
if (dvbpsi_SectionsCompleteDecoder(DVBPSI_DECODER(p_ett_decoder)))
if (dvbpsi_decoder_sections_completed(DVBPSI_DECODER(p_ett_decoder)))
{
assert(p_ett_decoder->pf_ett_callback);
......@@ -388,7 +388,7 @@ static void dvbpsi_atsc_GatherETTSections(dvbpsi_t* p_dvbpsi,
p_ett_decoder->current_ett = *p_ett_decoder->p_building_ett;
p_ett_decoder->b_current_valid = true;
/* Chain the sections */
dvbpsi_ChainSectionsDecoder(DVBPSI_DECODER(p_ett_decoder));
dvbpsi_decoder_sections_chain(DVBPSI_DECODER(p_ett_decoder));
/* Decode the sections */
dvbpsi_atsc_DecodeETTSections(p_ett_decoder->p_building_ett,
p_ett_decoder->ap_sections[0]);
......
......@@ -101,7 +101,7 @@ bool dvbpsi_atsc_AttachMGT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
}
dvbpsi_atsc_mgt_decoder_t* p_mgt_decoder;
p_mgt_decoder = (dvbpsi_atsc_mgt_decoder_t*) dvbpsi_NewDecoder(NULL,
p_mgt_decoder = (dvbpsi_atsc_mgt_decoder_t*) dvbpsi_decoder_new(NULL,
0, true, sizeof(dvbpsi_atsc_mgt_decoder_t));
if(p_mgt_decoder == NULL)
return false;
......@@ -111,7 +111,7 @@ bool dvbpsi_atsc_AttachMGT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
dvbpsi_atsc_GatherMGTSections, DVBPSI_DECODER(p_mgt_decoder));
if (p_subdec == NULL)
{
dvbpsi_DeleteDecoder(DVBPSI_DECODER(p_mgt_decoder));
dvbpsi_decoder_delete(DVBPSI_DECODER(p_mgt_decoder));
return false;
}
......@@ -320,7 +320,7 @@ static void dvbpsi_ReInitMGT(dvbpsi_atsc_mgt_decoder_t *p_decoder, const bool b_
{
assert(p_decoder);
dvbpsi_ReInitDecoder(DVBPSI_DECODER(p_decoder), b_force);
dvbpsi_decoder_reset(DVBPSI_DECODER(p_decoder), b_force);
/* Force redecoding */
if (b_force)
......@@ -389,7 +389,7 @@ static bool dvbpsi_AddSectionMGT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_mgt_decoder_t *
}
/* Fill the section array */
if (dvbpsi_AddSectionDecoder(DVBPSI_DECODER(p_decoder), p_section))
if (dvbpsi_decoder_section_add(DVBPSI_DECODER(p_decoder), p_section))
dvbpsi_debug(p_dvbpsi, "ATSC MGT decoder", "overwrite section number %d",
p_section->i_number);
return true;
......@@ -487,7 +487,7 @@ static void dvbpsi_atsc_GatherMGTSections(dvbpsi_t * p_dvbpsi,
}
/* Check if we have all the sections */
if (dvbpsi_SectionsCompleteDecoder(DVBPSI_DECODER(p_mgt_decoder)))
if (dvbpsi_decoder_sections_completed(DVBPSI_DECODER(p_mgt_decoder)))
{
assert(p_mgt_decoder->pf_mgt_callback);
......@@ -495,7 +495,7 @@ static void dvbpsi_atsc_GatherMGTSections(dvbpsi_t * p_dvbpsi,
p_mgt_decoder->current_mgt = *p_mgt_decoder->p_building_mgt;
p_mgt_decoder->b_current_valid = true;
/* Chain the sections */
dvbpsi_ChainSectionsDecoder(DVBPSI_DECODER(p_mgt_decoder));
dvbpsi_decoder_sections_chain(DVBPSI_DECODER(p_mgt_decoder));
/* Decode the sections */
dvbpsi_atsc_DecodeMGTSections(p_mgt_decoder->p_building_mgt,
p_mgt_decoder->ap_sections[0]);
......
......@@ -86,7 +86,7 @@ bool dvbpsi_atsc_AttachSTT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
}
dvbpsi_atsc_stt_decoder_t* p_stt_decoder;
p_stt_decoder = (dvbpsi_atsc_stt_decoder_t*) dvbpsi_NewDecoder(NULL,
p_stt_decoder = (dvbpsi_atsc_stt_decoder_t*) dvbpsi_decoder_new(NULL,
0, true, sizeof(dvbpsi_atsc_stt_decoder_t));
if (p_stt_decoder == NULL)
return false;
......@@ -97,7 +97,7 @@ bool dvbpsi_atsc_AttachSTT(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
dvbpsi_atsc_GatherSTTSections, DVBPSI_DECODER(p_stt_decoder));
if (p_subdec == NULL)
{
dvbpsi_DeleteDecoder(DVBPSI_DECODER(p_stt_decoder));
dvbpsi_decoder_delete(DVBPSI_DECODER(p_stt_decoder));
return false;
}
......@@ -229,7 +229,7 @@ static void dvbpsi_ReInitSTT(dvbpsi_atsc_stt_decoder_t *p_decoder, const bool b_
{
assert(p_decoder);
dvbpsi_ReInitDecoder(DVBPSI_DECODER(p_decoder), b_force);
dvbpsi_decoder_reset(DVBPSI_DECODER(p_decoder), b_force);
/* Force redecoding */
if (b_force)
......@@ -288,7 +288,7 @@ static bool dvbpsi_AddSectionSTT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_stt_decoder_t *
}
/* Fill the section array */
if (dvbpsi_AddSectionDecoder(DVBPSI_DECODER(p_decoder), p_section))
if (dvbpsi_decoder_section_add(DVBPSI_DECODER(p_decoder), p_section))
dvbpsi_debug(p_dvbpsi, "ATSC STT decoder", "overwrite section number %d",
p_section->i_number);
......@@ -387,7 +387,7 @@ static void dvbpsi_atsc_GatherSTTSections(dvbpsi_t *p_dvbpsi,
}
/* Check if we have all the sections */
if (dvbpsi_SectionsCompleteDecoder(DVBPSI_DECODER(p_stt_decoder)))
if (dvbpsi_decoder_sections_completed(DVBPSI_DECODER(p_stt_decoder)))
{
assert(p_stt_decoder->pf_stt_callback);
......@@ -396,7 +396,7 @@ static void dvbpsi_atsc_GatherSTTSections(dvbpsi_t *p_dvbpsi,
p_stt_decoder->b_current_valid = true;
/* Chain the sections */
dvbpsi_ChainSectionsDecoder(DVBPSI_DECODER(p_stt_decoder));
dvbpsi_decoder_sections_chain(DVBPSI_DECODER(p_stt_decoder));
/* Decode the sections */
dvbpsi_atsc_DecodeSTTSections(p_stt_decoder->p_building_stt,
p_stt_decoder->ap_sections[0]);
......
......@@ -110,7 +110,7 @@ bool dvbpsi_atsc_AttachVCT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
}
dvbpsi_atsc_vct_decoder_t* p_vct_decoder;
p_vct_decoder = (dvbpsi_atsc_vct_decoder_t*) dvbpsi_NewDecoder(NULL,
p_vct_decoder = (dvbpsi_atsc_vct_decoder_t*) dvbpsi_decoder_new(NULL,
0, true, sizeof(dvbpsi_atsc_vct_decoder_t));
if (p_vct_decoder == NULL)
return false;
......@@ -121,7 +121,7 @@ bool dvbpsi_atsc_AttachVCT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_ex
dvbpsi_atsc_GatherVCTSections, DVBPSI_DECODER(p_vct_decoder));
if (p_subdec == NULL)
{
dvbpsi_DeleteDecoder(DVBPSI_DECODER(p_vct_decoder));
dvbpsi_decoder_delete(DVBPSI_DECODER(p_vct_decoder));
return false;
}
......@@ -359,7 +359,7 @@ static void dvbpsi_ReInitVCT(dvbpsi_atsc_vct_decoder_t *p_decoder, const bool b_
{
assert(p_decoder);
dvbpsi_ReInitDecoder(DVBPSI_DECODER(p_decoder), b_force);
dvbpsi_decoder_reset(DVBPSI_DECODER(p_decoder), b_force);
/* Force redecoding */
if (b_force)
......@@ -427,7 +427,7 @@ static bool dvbpsi_AddSectionVCT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_vct_decoder_t *
}
/* Fill the section array */
if (dvbpsi_AddSectionDecoder(DVBPSI_DECODER(p_vct_decoder), p_section))
if (dvbpsi_decoder_section_add(DVBPSI_DECODER(p_vct_decoder), p_section))
dvbpsi_debug(p_dvbpsi, "ATSC VCT decoder", "overwrite section number %d",
p_section->i_number);
......@@ -524,7 +524,7 @@ static void dvbpsi_atsc_GatherVCTSections(dvbpsi_t *p_dvbpsi,
}
/* Check if we have all the sections */
if (dvbpsi_SectionsCompleteDecoder(DVBPSI_DECODER(p_vct_decoder)))
if (dvbpsi_decoder_sections_completed(DVBPSI_DECODER(p_vct_decoder)))
{
assert(p_vct_decoder->pf_vct_callback);
......@@ -533,7 +533,7 @@ static void dvbpsi_atsc_GatherVCTSections(dvbpsi_t *p_dvbpsi,
p_vct_decoder->b_current_valid = true;
/* Chain the sections */
dvbpsi_ChainSectionsDecoder(DVBPSI_DECODER(p_vct_decoder));
dvbpsi_decoder_sections_chain(DVBPSI_DECODER(p_vct_decoder));
/* Decode the sections */
dvbpsi_atsc_DecodeVCTSections(p_vct_decoder->p_building_vct,
p_vct_decoder->ap_sections[0]);
......
This diff is collapsed.
......@@ -112,10 +112,10 @@ typedef struct dvbpsi_bat_s
typedef void (* dvbpsi_bat_callback)(void* p_cb_data, dvbpsi_bat_t* p_new_bat);
/*****************************************************************************
* dvbpsi_AttachBAT
* dvbpsi_bat_attach
*****************************************************************************/
/*!
* \fn bool dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool dvbpsi_bat_attach(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. It will be attached to p_dvbpsi.
......@@ -126,15 +126,15 @@ typedef void (* dvbpsi_bat_callback)(void* p_cb_data, dvbpsi_bat_t* p_new_bat);
* \param p_cb_data private data given in argument to the callback.
* \return true on success, false on failure
*/
bool dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
bool dvbpsi_bat_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_bat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachBAT
* dvbpsi_bat_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn void dvbpsi_bat_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a BAT decoder.
* \param p_dvbpsi dvbpsi handle to Subtable demultiplexor to which the decoder is attached.
......@@ -142,14 +142,14 @@ bool dvbpsi_AttachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \param i_extension Table ID extension, here bouquet ID.
* \return nothing.
*/
void dvbpsi_DetachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
void dvbpsi_bat_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitBAT/dvbpsi_NewBAT
* dvbpsi_bat_init/dvbpsi_bat_new
*****************************************************************************/
/*!
* \fn void dvbpsi_InitBAT(dvbpsi_bat_t *p_bat, uint16_t i_bouquet_id, uint8_t i_version,
* \fn void dvbpsi_bat_init(dvbpsi_bat_t *p_bat, uint16_t i_bouquet_id, uint8_t i_version,
bool b_current_next)
* \brief Initialize a user-allocated dvbpsi_bat_t structure.
* \param p_bat pointer to the BAT structure
......@@ -158,11 +158,11 @@ void dvbpsi_DetachBAT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \param b_current_next current next indicator
* \return nothing.
*/
void dvbpsi_InitBAT(dvbpsi_bat_t *p_bat, uint16_t i_bouquet_id, uint8_t i_version,
void dvbpsi_bat_init(dvbpsi_bat_t *p_bat, uint16_t i_bouquet_id, uint8_t i_version,
bool b_current_next);
/*!
* \fn dvbpsi_bat_t *dvbpsi_NewBAT(uint16_t i_bouquet_id, uint8_t i_version,
* \fn dvbpsi_bat_t *dvbpsi_bat_new(uint16_t i_bouquet_id, uint8_t i_version,
* bool b_current_next)
* \brief Allocate and initialize a new dvbpsi_bat_t structure.
* \param i_bouquet_id bouquet ID
......@@ -170,19 +170,19 @@ void dvbpsi_InitBAT(dvbpsi_bat_t *p_bat, uint16_t i_bouquet_id, uint8_t i_versio
* \param b_current_next current next indicator
* \return p_bat pointer to the BAT structure
*/
dvbpsi_bat_t *dvbpsi_NewBAT(uint16_t i_bouquet_id, uint8_t i_version,
bool b_current_next);
dvbpsi_bat_t *dvbpsi_bat_new(uint16_t i_bouquet_id, uint8_t i_version,
bool b_current_next);
/*****************************************************************************
* dvbpsi_EmptyBAT/dvbpsi_DeleteBAT
* dvbpsi_bat_empty/dvbpsi_bat_delete
*****************************************************************************/
/*!
* \fn void dvbpsi_EmptyBAT(dvbpsi_bat_t* p_bat)
* \fn void dvbpsi_bat_empty(dvbpsi_bat_t* p_bat)
* \brief Clean a dvbpsi_bat_t structure.
* \param p_bat pointer to the BAT structure
* \return nothing.
*/
void dvbpsi_EmptyBAT(dvbpsi_bat_t *p_bat);
void dvbpsi_bat_empty(dvbpsi_bat_t *p_bat);
/*!
* \fn dvbpsi_DeleteBAT(dvbpsi_bat_t *p_bat)
......@@ -190,13 +190,13 @@ void dvbpsi_EmptyBAT(dvbpsi_bat_t *p_bat);
* \param p_bat pointer to the BAT structure
* \return nothing.
*/
void dvbpsi_DeleteBAT(dvbpsi_bat_t *p_bat);
void dvbpsi_bat_delete(dvbpsi_bat_t *p_bat);
/*****************************************************************************
* dvbpsi_GenBATSections
* dvbpsi_bat_sections_generate
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenBATSections(dvbpsi_t *p_dvbpsi, dvbpsi_bat_t* p_bat)
* \fn dvbpsi_psi_section_t* dvbpsi_bat_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_bat_t* p_bat)
* \brief BAT generator
* \param p_dvbpsi handle to dvbpsi with attached decoder
* \param p_bat BAT structure
......@@ -204,7 +204,25 @@ void dvbpsi_DeleteBAT(dvbpsi_bat_t *p_bat);
*
* Generate BAT sections based on the dvbpsi_bat_t structure.
*****************************************************************************/
dvbpsi_psi_section_t *dvbpsi_GenBATSections(dvbpsi_t *p_dvbpsi, dvbpsi_bat_t * p_bat);
dvbpsi_psi_section_t *dvbpsi_bat_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_bat_t * p_bat);
/*****************************************************************************
* deprecated API's
*****************************************************************************/
__attribute__((deprecated))
int dvbpsi_AttachBAT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_bat_callback pf_callback,
void* p_cb_data);
__attribute__((deprecated))
void dvbpsi_DetachBAT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension);
__attribute__((deprecated))
void dvbpsi_InitBAT(dvbpsi_bat_t *p_bat, uint16_t i_bouquet_id, uint8_t i_version,
int b_current_next);
__attribute__((deprecated))
void dvbpsi_EmptyBAT(dvbpsi_bat_t *p_bat);
__attribute__((deprecated))
dvbpsi_psi_section_t *dvbpsi_GenBATSections(dvbpsi_bat_t *p_bat);
#ifdef __cplusplus
};
......
......@@ -47,50 +47,70 @@ typedef struct dvbpsi_bat_decoder_s
} dvbpsi_bat_decoder_t;
/*****************************************************************************
* dvbpsi_GatherBATSections
* dvbpsi_bat_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherBATSections(dvbpsi_t* p_dvbpsi, dvbpsi_decoder_t* p_decoder,
void dvbpsi_bat_sections_gather(dvbpsi_t* p_dvbpsi, dvbpsi_decoder_t* p_decoder,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeBATSections
* dvbpsi_bat_sections_decode
*****************************************************************************
* BAT decoder.
*****************************************************************************/
void dvbpsi_DecodeBATSections(dvbpsi_bat_t* p_bat,
void dvbpsi_bat_sections_decode(dvbpsi_bat_t* p_bat,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_BATAddTS
* dvbpsi_bat_ts_add
*****************************************************************************
* Add a TS description at the end of the BAT.
*****************************************************************************/
dvbpsi_bat_ts_t *dvbpsi_BATAddTS(dvbpsi_bat_t* p_bat,
dvbpsi_bat_ts_t *dvbpsi_bat_ts_add(dvbpsi_bat_t* p_bat,
uint16_t i_ts_id, uint16_t i_orig_network_id);
/*****************************************************************************
* dvbpsi_BATBouquetAddDescriptor
* dvbpsi_bat_bouquet_descriptor_add
*****************************************************************************
* Add a descriptor in the BAT Bouquet descriptors (the first loop description),
* which is in the first loop of BAT.
*****************************************************************************/
dvbpsi_descriptor_t *dvbpsi_BATBouquetAddDescriptor(
dvbpsi_bat_t *p_bat,
dvbpsi_descriptor_t *dvbpsi_bat_bouquet_descriptor_add(dvbpsi_bat_t *p_bat,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
/*****************************************************************************
* dvbpsi_BATTSAddDescriptor
* dvbpsi_bat_ts_descriptor_add
*****************************************************************************
* Add a descriptor in the BAT TS descriptors, which is in the second loop of BAT.
*****************************************************************************/
dvbpsi_descriptor_t *dvbpsi_bat_ts_descriptor_add(dvbpsi_bat_ts_t *p_ts,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_GatherBATSections(dvbpsi_t* p_dvbpsi, dvbpsi_decoder_t* p_decoder,
dvbpsi_psi_section_t* p_section);
__attribute__((deprecated))
void dvbpsi_DecodeBATSections(dvbpsi_bat_t* p_bat,
dvbpsi_psi_section_t* p_section);
__attribute__((deprecated))
dvbpsi_bat_ts_t *dvbpsi_BATAddTS(dvbpsi_bat_t* p_bat,
uint16_t i_ts_id, uint16_t i_orig_network_id);
__attribute__((deprecated))
dvbpsi_descriptor_t *dvbpsi_BATBouquetAddDescriptor(
dvbpsi_bat_t *p_bat,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
__attribute__((deprecated))
dvbpsi_descriptor_t *dvbpsi_BATTSAddDescriptor(
dvbpsi_bat_ts_t *p_ts,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
#else
#error "Multiple inclusions of bat_private.h"
#endif
This diff is collapsed.
......@@ -74,10 +74,10 @@ typedef struct dvbpsi_cat_s
typedef void (* dvbpsi_cat_callback)(void* p_cb_data, dvbpsi_cat_t* p_new_cat);
/*****************************************************************************
* dvbpsi_AttachCAT
* dvbpsi_cat_attach
*****************************************************************************/
/*!
* \fn bool dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi,
* \fn bool dvbpsi_cat_attach(dvbpsi_t *p_dvbpsi,
dvbpsi_cat_callback pf_callback, void* p_cb_data)
* \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
......@@ -85,14 +85,14 @@ typedef void (* dvbpsi_cat_callback)(void* p_cb_data, dvbpsi_cat_t* p_new_cat);
* \param p_cb_data private data given in argument to the callback
* \return true on success, false on failure
*/
bool dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
bool dvbpsi_cat_attach(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachCAT
* dvbpsi_cat_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachCAT(dvbpsi_t *p_dvbpsi)
* \fn void dvbpsi_cat_detach(dvbpsi_t *p_dvbpsi)
* \brief Destroy a CAT decoder.
* \param p_dvbpsi handle to dvbpsi with attached decoder
* \param p_dvbpsi handle holds the decoder pointer
......@@ -100,13 +100,13 @@ bool dvbpsi_AttachCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
*
* The handle isn't valid any more.
*/
void dvbpsi_DetachCAT(dvbpsi_t *p_dvbpsi);
void dvbpsi_cat_detach(dvbpsi_t *p_dvbpsi);
/*****************************************************************************
* dvbpsi_InitCAT/dvbpsi_NewCAT
* dvbpsi_cat_init/dvbpsi_cat_new
*****************************************************************************/
/*!
* \fn void dvbpsi_InitCAT(dvbpsi_cat_t* p_cat,
* \fn void dvbpsi_cat_init(dvbpsi_cat_t* p_cat,
uint8_t i_version, bool b_current_next)
* \brief Initialize a user-allocated dvbpsi_cat_t structure.
* \param p_cat pointer to the CAT structure
......@@ -114,46 +114,46 @@ void dvbpsi_DetachCAT(dvbpsi_t *p_dvbpsi);
* \param b_current_next current next indicator
* \return nothing.
*/
void dvbpsi_InitCAT(dvbpsi_cat_t* p_cat,
void dvbpsi_cat_init(dvbpsi_cat_t* p_cat,
uint8_t i_version, bool b_current_next);
/*!
* \fn dvbpsi_cat_t *dvbpsi_NewCAT(uint8_t i_version,
* \fn dvbpsi_cat_t *dvbpsi_cat_new(uint8_t i_version,
* bool b_current_next)
* \brief Allocate and initialize a new dvbpsi_cat_t structure.
* \param i_version CAT version
* \param b_current_next current next indicator
* \return p_cat pointer to the CAT structure
*/
dvbpsi_cat_t *dvbpsi_NewCAT(uint8_t i_version, bool b_current_next);
dvbpsi_cat_t *dvbpsi_cat_new(uint8_t i_version, bool b_current_next);
/*****************************************************************************
* dvbpsi_EmptyCAT/dvbpsi_DeleteCAT
* dvbpsi_cat_empty/dvbpsi_cat_delete
*****************************************************************************/
/*!
* \fn void dvbpsi_EmptyCAT(dvbpsi_cat_t* p_cat)
* \fn void dvbpsi_cat_empty(dvbpsi_cat_t* p_cat)
* \brief Clean a dvbpsi_cat_t structure.
* \param p_cat pointer to the CAT structure
* \return nothing.
*/
void dvbpsi_EmptyCAT(dvbpsi_cat_t* p_cat);
void dvbpsi_cat_empty(dvbpsi_cat_t* p_cat);
/*!
* \fn void dvbpsi_DeleteCAT(dvbpsi_cat_t *p_cat)
* \fn void dvbpsi_cat_delete(dvbpsi_cat_t *p_cat)
* \brief Clean and free a dvbpsi_cat_t structure.
* \param p_cat pointer to the CAT structure
* \return nothing.
*/
void dvbpsi_DeleteCAT(dvbpsi_cat_t *p_cat);
void dvbpsi_cat_delete(dvbpsi_cat_t *p_cat);
/*****************************************************************************
* dvbpsi_CATAddDescriptor
* dvbpsi_cat_descriptor_add
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t* dvbpsi_CATAddDescriptor(dvbpsi_cat_t* p_cat,
uint8_t i_tag,
uint8_t i_length,
uint8_t* p_data)
* \fn dvbpsi_descriptor_t* dvbpsi_cat_descriptor_add(dvbpsi_cat_t* p_cat,
uint8_t i_tag,
uint8_t i_length,
uint8_t* p_data)
* \brief Add a descriptor in the CAT.
* \param p_cat pointer to the CAT structure
* \param i_tag descriptor's tag
......@@ -161,15 +161,15 @@ void dvbpsi_DeleteCAT(dvbpsi_cat_t *p_cat);
* \param p_data descriptor's data
* \return a pointer to the added descriptor.
*/
dvbpsi_descriptor_t* dvbpsi_CATAddDescriptor(dvbpsi_cat_t* p_cat,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
dvbpsi_descriptor_t* dvbpsi_cat_descriptor_add(dvbpsi_cat_t* p_cat,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_GenCATSections
* dvbpsi_cat_sections_generate
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenCATSections(dvbpsi_t *p_dvbpsi, dvbpsi_cat_t* p_cat)
* \fn dvbpsi_psi_section_t* dvbpsi_cat_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_cat_t* p_cat)
* \brief CAT generator
* \param p_dvbpsi handle to dvbpsi with attached decoder
* \param p_cat CAT structure
......@@ -177,7 +177,28 @@ dvbpsi_descriptor_t* dvbpsi_CATAddDescriptor(dvbpsi_cat_t* p_cat,
*
* Generate CAT sections based on the dvbpsi_cat_t structure.
*/
dvbpsi_psi_section_t* dvbpsi_GenCATSections(dvbpsi_t *p_dvbpsi, dvbpsi_cat_t* p_cat);
dvbpsi_psi_section_t* dvbpsi_cat_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_cat_t* p_cat);
/*****************************************************************************
* deprecated API's
*****************************************************************************/
__attribute__((deprecated))
dvbpsi_handle dvbpsi_AttachCAT(dvbpsi_cat_callback pf_callback,
void* p_cb_data);
__attribute__((deprecated))
void dvbpsi_DetachCAT(dvbpsi_handle h_dvbpsi);
__attribute__((deprecated))
void dvbpsi_InitCAT(dvbpsi_cat_t* p_cat,
uint8_t i_version, int b_current_next);
__attribute__((deprecated))
void dvbpsi_EmptyCAT(dvbpsi_cat_t* p_cat);
__attribute__((deprecated))
dvbpsi_descriptor_t* dvbpsi_CATAddDescriptor(dvbpsi_cat_t* p_cat,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
__attribute__((deprecated))
dvbpsi_psi_section_t* dvbpsi_GenCATSections(dvbpsi_cat_t* p_cat);
#ifdef __cplusplus
};
......
......@@ -48,17 +48,26 @@ typedef struct dvbpsi_cat_decoder_s
} dvbpsi_cat_decoder_t;
/*****************************************************************************
* dvbpsi_GatherCATSections
* dvbpsi_cat_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherCATSections(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
void dvbpsi_cat_sections_gather(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeCATSections
* dvbpsi_cat_sections_decode
*****************************************************************************
* CAT decoder.
*****************************************************************************/
void dvbpsi_cat_sections_decode(dvbpsi_cat_t* p_cat,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_GatherCATSections(dvbpsi_handle* p_dvbpsi, dvbpsi_psi_section_t* p_section);
__attribute__((deprecated))
void dvbpsi_DecodeCATSections(dvbpsi_cat_t* p_cat,
dvbpsi_psi_section_t* p_section);
......
This diff is collapsed.
......@@ -111,7 +111,7 @@ typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
* dvbpsi_AttachEIT
*****************************************************************************/
/*!
* \fn bool dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool dvbpsi_eit_attach(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.
......@@ -122,14 +122,14 @@ typedef void (* dvbpsi_eit_callback)(void* p_cb_data, dvbpsi_eit_t* p_new_eit);
* \param p_cb_data private data given in argument to the callback.
* \return true on success, false on failure
*/
bool dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
bool dvbpsi_eit_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_eit_callback pf_callback, void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachEIT
* dvbpsi_eit_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn void dvbpsi_eit_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a EIT decoder.
* \param p_dvbpsi dvbpsi handle pointing to Subtable demultiplexor to which the
......@@ -138,13 +138,13 @@ bool dvbpsi_AttachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \param i_extension Table ID extension, here service ID.
* \return nothing.
*/
void dvbpsi_DetachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
void dvbpsi_eit_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitEIT/dvbpsi_NewEIT
* dvbpsi_eit_init/dvbpsi_eit_new
*****************************************************************************/
/*!
* \fn void dvbpsi_InitEIT(dvbpsi_eit_t* p_eit, uint16_t i_service_id,
* \fn void dvbpsi_eit_init(dvbpsi_eit_t* p_eit, uint16_t i_service_id,
uint8_t i_version, bool b_current_next, uint16_t i_ts_id,
uint16_t i_network_id, uint8_t i_segment_last_section_number,
uint8_t i_last_table_id)
......@@ -159,13 +159,13 @@ void dvbpsi_DetachEIT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extensi
* \param i_last_table_id i_last_table_id
* \return nothing.
*/
void dvbpsi_InitEIT(dvbpsi_eit_t* p_eit, uint16_t i_service_id, uint8_t i_version,
void dvbpsi_eit_init(dvbpsi_eit_t* p_eit, uint16_t i_service_id, uint8_t i_version,
bool b_current_next, uint16_t i_ts_id, uint16_t i_network_id,
uint8_t i_segment_last_section_number,
uint8_t i_last_table_id);
/*!
* \fn dvbpsi_eit_t* dvbpsi_NewEIT(uint16_t i_service_id,
* \fn dvbpsi_eit_t* dvbpsi_eit_new(uint16_t i_service_id,
uint8_t i_version, bool b_current_next, uint16_t i_ts_id,
uint16_t i_network_id, uint8_t i_segment_last_section_number,
uint8_t i_last_table_id)
......@@ -179,35 +179,35 @@ void dvbpsi_InitEIT(dvbpsi_eit_t* p_eit, uint16_t i_service_id, uint8_t i_versio
* \param i_last_table_id i_last_table_id
* \return p_eit pointer to the EIT structure
*/
dvbpsi_eit_t* dvbpsi_NewEIT(uint16_t i_service_id,
dvbpsi_eit_t* dvbpsi_eit_new(uint16_t i_service_id,
uint8_t i_version, bool b_current_next, uint16_t i_ts_id,
uint16_t i_network_id, uint8_t i_segment_last_section_number,
uint8_t i_last_table_id);
/*****************************************************************************
* dvbpsi_EmptyEIT/dvbpsi_DeleteEIT
* dvbpsi_eit_empty/dvbpsi_eit_delete
*****************************************************************************/
/*!
* \fn void dvbpsi_EmptyEIT(dvbpsi_eit_t* p_eit)
* \fn void dvbpsi_eit_empty(dvbpsi_eit_t* p_eit)
* \brief Clean a dvbpsi_eit_t structure.
* \param p_eit pointer to the EIT structure
* \return nothing.
*/
void dvbpsi_EmptyEIT(dvbpsi_eit_t* p_eit);
void dvbpsi_eit_empty(dvbpsi_eit_t* p_eit);
/*!
* \fn void dvbpsi_DeleteEIT(dvbpsi_eit_t *p_eit)
* \fn void dvbpsi_eit_delete(dvbpsi_eit_t *p_eit)
* \brief Clean and free a dvbpsi_eit_t structure.
* \param p_eit pointer to the EIT structure
* \return nothing.
*/
void dvbpsi_DeleteEIT(dvbpsi_eit_t* p_eit);
void dvbpsi_eit_delete(dvbpsi_eit_t* p_eit);
/*****************************************************************************
* dvbpsi_EITAddEvent
* dvbpsi_eit_event_add
*****************************************************************************/
/*!
* \fn dvbpsi_eit_event_t* dvbpsi_EITAddEvent(dvbpsi_eit_t* p_eit,
* \fn dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit,
uint16_t i_event_id,
uint64_t i_start_time,
uint32_t i_duration,
......@@ -222,15 +222,15 @@ void dvbpsi_DeleteEIT(dvbpsi_eit_t* p_eit);
* \param b_free_ca Free CA flag
* \return a pointer to the added service description.
*/
dvbpsi_eit_event_t* dvbpsi_EITAddEvent(dvbpsi_eit_t* p_eit,
dvbpsi_eit_event_t* dvbpsi_eit_event_add(dvbpsi_eit_t* p_eit,
uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
uint8_t i_running_status, bool b_free_ca);
/*****************************************************************************
* dvbpsi_EITEventAddDescriptor
* dvbpsi_eit_event_descriptor_add
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor(
* \fn dvbpsi_descriptor_t* dvbpsi_eit_event_descriptor_add(
dvbpsi_eit_event_t* p_event,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data)
......@@ -241,18 +241,18 @@ dvbpsi_eit_event_t* dvbpsi_EITAddEvent(dvbpsi_eit_t* p_eit,
* \param p_data descriptor's data
* \return a pointer to the added descriptor.
*/
dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor(
dvbpsi_descriptor_t* dvbpsi_eit_event_descriptor_add(
dvbpsi_eit_event_t* p_event,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_GenEITSections
* dvbpsi_eit_sections_generate
*****************************************************************************
* Generate EIT sections based on the dvbpsi_eit_t structure.
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t *dvbpsi_GenEITSections(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
* \fn dvbpsi_psi_section_t *dvbpsi_eit_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
* uint8_t i_table_id);
* \brief Generate a EIT section based on the information provided in p_eit.
* \param p_dvbpsi pointer to Subtable demultiplexor to which the EIT decoder is attached.
......@@ -260,9 +260,34 @@ dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor(
* \param i_table_id the EIT table id to use
* \return a pointer to a new PSI section
*/
dvbpsi_psi_section_t *dvbpsi_GenEITSections(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
dvbpsi_psi_section_t *dvbpsi_eit_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_eit_t *p_eit,
uint8_t i_table_id);
/*****************************************************************************
* deprecated API's
*****************************************************************************/
__attribute__((deprecated))
int dvbpsi_AttachEIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_eit_callback pf_callback,
void* p_cb_data);
__attribute__((deprecated))
void dvbpsi_DetachEIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension);
__attribute__((deprecated))
void dvbpsi_InitEIT(dvbpsi_eit_t* p_eit, uint16_t i_service_id, uint8_t i_version,
int b_current_next, uint16_t i_ts_id, uint16_t i_network_id,
uint8_t i_segment_last_section_number,
uint8_t i_last_table_id);
__attribute__((deprecated)) void dvbpsi_EmptyEIT(dvbpsi_eit_t* p_eit);
__attribute__((deprecated))
dvbpsi_descriptor_t* dvbpsi_EITEventAddDescriptor(dvbpsi_eit_event_t* p_event,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
__attribute__((deprecated))
dvbpsi_eit_event_t* dvbpsi_EITAddEvent(dvbpsi_eit_t* p_eit,
uint16_t i_event_id, uint64_t i_start_time, uint32_t i_duration,
uint8_t i_running_status, int b_free_ca);
#ifdef __cplusplus
};
#endif
......
......@@ -48,19 +48,30 @@ typedef struct dvbpsi_eit_decoder_s
} dvbpsi_eit_decoder_t;
/*****************************************************************************
* dvbpsi_GatherEITSections
* dvbpsi_eit_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherEITSections(dvbpsi_t *p_dvbpsi,
void dvbpsi_eit_sections_gather(dvbpsi_t *p_dvbpsi,
dvbpsi_decoder_t *p_private_decoder,
dvbpsi_psi_section_t *p_section);
/*****************************************************************************
* dvbpsi_DecodeEITSection
* dvbpsi_eit_sections_decode
*****************************************************************************
* EIT decoder.
*****************************************************************************/
void dvbpsi_eit_sections_decode(dvbpsi_eit_t* p_eit,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_GatherEITSections(dvbpsi_handle *p_dvbpsi,
dvbpsi_decoder_t *p_private_decoder,
dvbpsi_psi_section_t *p_section);
__attribute__((deprecated))
void dvbpsi_DecodeEITSections(dvbpsi_eit_t* p_eit,
dvbpsi_psi_section_t* p_section);
......
This diff is collapsed.
This diff is collapsed.
......@@ -50,22 +50,31 @@ typedef struct dvbpsi_nit_decoder_s
} dvbpsi_nit_decoder_t;
/*****************************************************************************
* dvbpsi_GatherNITSections
* dvbpsi_nit_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherNITSections(dvbpsi_t* p_dvbpsi,
void dvbpsi_nit_sections_gather(dvbpsi_t* p_dvbpsi,
dvbpsi_decoder_t* p_private_decoder,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeNITSections
* dvbpsi_nit_sections_decode
*****************************************************************************
* NIT decoder.
*****************************************************************************/
void dvbpsi_nit_sections_decode(dvbpsi_nit_t* p_nit,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_GatherNITSections(dvbpsi_handle* p_dvbpsi,
dvbpsi_decoder_t* p_private_decoder,
dvbpsi_psi_section_t* p_section);
void dvbpsi_DecodeNITSections(dvbpsi_nit_t* p_nit,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of nit_private.h"
#endif
......
This diff is collapsed.
......@@ -37,7 +37,6 @@
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_pat_program_t
*****************************************************************************/
......@@ -99,37 +98,37 @@ typedef struct dvbpsi_pat_s
typedef void (* dvbpsi_pat_callback)(void* p_cb_data, dvbpsi_pat_t* p_new_pat);
/*****************************************************************************
* dvbpsi_AttachPAT
* dvbpsi_pat_attach
*****************************************************************************/
/*!
* \fn bool dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback, void* p_cb_data)
* \fn bool dvbpsi_pat_attach(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 true on success, false on failure
*/
bool dvbpsi_AttachPAT(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
void* p_cb_data);
bool dvbpsi_pat_attach(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachPAT
* dvbpsi_pat_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi)
* \fn void dvbpsi_pat_detach(dvbpsi_t *p_dvbpsi)
* \brief Destroy a PAT decoder.
* \param p_dvbpsi pointer to dvbpsi_t handle
* \return nothing.
*
* The handle isn't valid any more.
*/
void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi);
void dvbpsi_pat_detach(dvbpsi_t *p_dvbpsi);
/*****************************************************************************
* dvbpsi_InitPAT/dvbpsi_NewPAT
* dvbpsi_pat_init/dvbpsi_pat_new
*****************************************************************************/
/*!
* \fn void dvbpsi_InitPAT(dvbpsi_pat_t* p_pat, uint16_t i_ts_id,
* \fn void dvbpsi_pat_init(dvbpsi_pat_t* p_pat, uint16_t i_ts_id,
uint8_t i_version, bool b_current_next)
* \brief Initialize a user-allocated dvbpsi_pat_t structure.
* \param p_pat pointer to the PAT structure
......@@ -138,11 +137,11 @@ void dvbpsi_DetachPAT(dvbpsi_t *p_dvbpsi);
* \param b_current_next current next indicator
* \return nothing.
*/
void dvbpsi_InitPAT(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version,
void dvbpsi_pat_init(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version,
bool b_current_next);
/*!
* \fn dvbpsi_pat_t *dvbpsi_NewPAT(uint16_t i_ts_id, uint8_t i_version,
* \fn dvbpsi_pat_t *dvbpsi_pat_new(uint16_t i_ts_id, uint8_t i_version,
* bool b_current_next);
* \brief Allocate and initialize a new dvbpsi_pat_t structure.
* \param i_ts_id transport stream ID
......@@ -150,48 +149,48 @@ void dvbpsi_InitPAT(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version,
* \param b_current_next current next indicator
* \return p_pat pointer to the PAT structure
*/
dvbpsi_pat_t *dvbpsi_NewPAT(uint16_t i_ts_id, uint8_t i_version, bool b_current_next);
dvbpsi_pat_t *dvbpsi_pat_new(uint16_t i_ts_id, uint8_t i_version, bool b_current_next);
/*****************************************************************************
* dvbpsi_EmptyPAT/dvbpsi_DeletePAT
* dvbpsi_pat_empty/dvbpsi_pat_delete
*****************************************************************************/
/*!
* \fn void dvbpsi_EmptyPAT(dvbpsi_pat_t* p_pat)
* \fn void dvbpsi_pat_empty(dvbpsi_pat_t* p_pat)
* \brief Clean a dvbpsi_pat_t structure.
* \param p_pat pointer to the PAT structure
* \return nothing.
*/
void dvbpsi_EmptyPAT(dvbpsi_pat_t* p_pat);
void dvbpsi_pat_empty(dvbpsi_pat_t* p_pat);
/*!
* \fn void dvbpsi_DeletePAT(dvbpsi_pat_t *p_pat)
* \fn void dvbpsi_pat_delete(dvbpsi_pat_t *p_pat)
* \brief Clean and free a dvbpsi_pat_t structure.
* \param p_pat pointer to the PAT structure
* \return nothing.
*/
void dvbpsi_DeletePAT(dvbpsi_pat_t *p_pat);
void dvbpsi_pat_delete(dvbpsi_pat_t *p_pat);
/*****************************************************************************
* dvbpsi_PATAddProgram
* dvbpsi_pat_program_add
*****************************************************************************/
/*!
* \fn dvbpsi_pat_program_t* dvbpsi_PATAddProgram(dvbpsi_pat_t* p_pat,
uint16_t i_number,
uint16_t i_pid)
* \fn dvbpsi_pat_program_t* dvbpsi_pat_program_add(dvbpsi_pat_t* p_pat,
uint16_t i_number,
uint16_t i_pid)
* \brief Add a program at the end of the PAT.
* \param p_pat pointer to the PAT structure
* \param i_number program number
* \param i_pid PID of the NIT/PMT
* \return a pointer to the added program.
*/
dvbpsi_pat_program_t* dvbpsi_PATAddProgram(dvbpsi_pat_t* p_pat,
dvbpsi_pat_program_t* dvbpsi_pat_program_add(dvbpsi_pat_t* p_pat,
uint16_t i_number, uint16_t i_pid);
/*****************************************************************************
* dvbpsi_GenPATSections
* dvbpsi_pat_sections_generate
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_t *p_dvbpsi, dvbpsi_pat_t* p_pat,
* \fn dvbpsi_psi_section_t* dvbpsi_pat_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_pat_t* p_pat,
int i_max_pps);
* \brief PAT generator.
* \param p_dvbpsi handle to dvbpsi with attached decoder
......@@ -202,9 +201,26 @@ 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_t *p_dvbpsi,
dvbpsi_psi_section_t* dvbpsi_pat_sections_generate(dvbpsi_t *p_dvbpsi,
dvbpsi_pat_t* p_pat, int i_max_pps);
/*****************************************************************************
* deprecated API's
*****************************************************************************/
__attribute__((deprecated))
dvbpsi_handle dvbpsi_AttachPAT(dvbpsi_pat_callback pf_callback,
void* p_cb_data);
__attribute__((deprecated)) void dvbpsi_DetachPAT(dvbpsi_handle h_dvbpsi);
__attribute__((deprecated))
void dvbpsi_InitPAT(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version,
int b_current_next);
__attribute__((deprecated)) void dvbpsi_EmptyPAT(dvbpsi_pat_t* p_pat);
__attribute__((deprecated))
dvbpsi_pat_program_t* dvbpsi_PATAddProgram(dvbpsi_pat_t* p_pat,
uint16_t i_number, uint16_t i_pid);
__attribute__((deprecated))
dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_pat_t* p_pat, int i_max_pps);
#ifdef __cplusplus
};
#endif
......@@ -212,4 +228,3 @@ dvbpsi_psi_section_t* dvbpsi_GenPATSections(dvbpsi_t *p_dvbpsi,
#else
#error "Multiple inclusions of pat.h"
#endif
......@@ -45,21 +45,29 @@ typedef struct dvbpsi_pat_decoder_s
} dvbpsi_pat_decoder_t;
/*****************************************************************************
* dvbpsi_GatherPATSections
* dvbpsi_pat_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherPATSections(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
void dvbpsi_pat_sections_gather(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodePATSection
*****************************************************************************
* PAT decoder.
*****************************************************************************/
void dvbpsi_DecodePATSections(dvbpsi_pat_t* p_pat,
dvbpsi_psi_section_t* p_section);
void dvbpsi_pat_sections_decode(dvbpsi_pat_t* p_pat,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_DecodePATSection(dvbpsi_pat_t* p_pat,
dvbpsi_psi_section_t* p_section);
__attribute__((deprecated))
void dvbpsi_GatherPATSections(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of pat_private.h"
......
This diff is collapsed.
......@@ -103,10 +103,10 @@ typedef struct dvbpsi_pmt_s
typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
/*****************************************************************************
* dvbpsi_AttachPMT
* dvbpsi_pmt_attach
*****************************************************************************/
/*!
* \fn bool dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi,
* \fn bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi,
uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data)
......@@ -118,27 +118,27 @@ typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
* \param p_cb_data private data given in argument to the callback
* \return true on success, false on failure
*/
bool dvbpsi_AttachPMT(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback, void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachPMT
* dvbpsi_pmt_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi)
* \fn void dvbpsi_pmt_detach(dvbpsi_t *p_dvbpsi)
* \brief Destroy a PMT decoder.
* \param p_dvbpsi handle
* \return nothing.
*
* The handle isn't valid any more.
*/
void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi);
void dvbpsi_pmt_detach(dvbpsi_t *p_dvbpsi);
/*****************************************************************************
* dvbpsi_InitPMT/dvbpsi_NewPMT
* dvbpsi_pmt_init/dvbpsi_pmt_new
*****************************************************************************/
/*!
* \fn void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
* \fn void dvbpsi_pmt_init(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
uint8_t i_version, bool b_current_next,
uint16_t i_pcr_pid)
* \brief Initialize a user-allocated dvbpsi_pmt_t structure.
......@@ -149,11 +149,11 @@ void dvbpsi_DetachPMT(dvbpsi_t *p_dvbpsi);
* \param i_pcr_pid PCR_PID
* \return nothing.
*/
void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
void dvbpsi_pmt_init(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
uint8_t i_version, bool b_current_next, uint16_t i_pcr_pid);
/*!
* \fn dvbpsi_pmt_t* dvbpsi_NewPMT(uint16_t i_program_number,
* \fn dvbpsi_pmt_t* dvbpsi_pmt_new(uint16_t i_program_number,
uint8_t i_version, bool b_current_next,
uint16_t i_pcr_pid)
* \brief Allocate and initialize a new dvbpsi_pmt_t structure.
......@@ -163,19 +163,19 @@ void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
* \param i_pcr_pid PCR_PID
* \return p_pmt pointer to the PMT structure
*/
dvbpsi_pmt_t* dvbpsi_NewPMT(uint16_t i_program_number, uint8_t i_version,
dvbpsi_pmt_t* dvbpsi_pmt_new(uint16_t i_program_number, uint8_t i_version,
bool b_current_next, uint16_t i_pcr_pid);
/*****************************************************************************
* dvbpsi_EmptyPMT/dvbpsi_DeletePMT
* dvbpsi_pmt_empty/dvbpsi_pmt_delete
*****************************************************************************/
/*!
* \fn void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt)
* \fn void dvbpsi_pmt_empty(dvbpsi_pmt_t* p_pmt)
* \brief Clean a dvbpsi_pmt_t structure.
* \param p_pmt pointer to the PMT structure
* \return nothing.
*/
void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt);
void dvbpsi_pmt_empty(dvbpsi_pmt_t* p_pmt);
/*!
* \fn void dvbpsi_DeletePMT(dvbpsi_pmt_t* p_pmt)
......@@ -183,13 +183,13 @@ void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt);
* \param p_pmt pointer to the PMT structure
* \return nothing.
*/
void dvbpsi_DeletePMT(dvbpsi_pmt_t* p_pmt);
void dvbpsi_pmt_delete(dvbpsi_pmt_t* p_pmt);
/*****************************************************************************
* dvbpsi_PMTAddDescriptor
* dvbpsi_pmt_descriptor_add
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt,
* \fn dvbpsi_descriptor_t* dvbpsi_pmt_descriptor_add(dvbpsi_pmt_t* p_pmt,
uint8_t i_tag,
uint8_t i_length,
uint8_t* p_data)
......@@ -200,15 +200,15 @@ void dvbpsi_DeletePMT(dvbpsi_pmt_t* p_pmt);
* \param p_data descriptor's data
* \return a pointer to the added descriptor.
*/
dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt,
dvbpsi_descriptor_t* dvbpsi_pmt_descriptor_add(dvbpsi_pmt_t* p_pmt,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_PMTAddES
* dvbpsi_pmt_es_add
*****************************************************************************/
/*!
* \fn dvbpsi_pmt_es_t* dvbpsi_PMTAddES(dvbpsi_pmt_t* p_pmt,
* \fn dvbpsi_pmt_es_t* dvbpsi_pmt_es_add(dvbpsi_pmt_t* p_pmt,
uint8_t i_type, uint16_t i_pid)
* \brief Add an ES in the PMT.
* \param p_pmt pointer to the PMT structure
......@@ -216,14 +216,14 @@ dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt,
* \param i_pid PID of the ES
* \return a pointer to the added ES.
*/
dvbpsi_pmt_es_t* dvbpsi_PMTAddES(dvbpsi_pmt_t* p_pmt,
dvbpsi_pmt_es_t* dvbpsi_pmt_es_add(dvbpsi_pmt_t* p_pmt,
uint8_t i_type, uint16_t i_pid);
/*****************************************************************************
* dvbpsi_PMTESAddDescriptor
* dvbpsi_pmt_es_descriptor_add
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es,
* \fn dvbpsi_descriptor_t* dvbpsi_pmt_es_descriptor_add(dvbpsi_pmt_es_t* p_es,
uint8_t i_tag,
uint8_t i_length,
uint8_t* p_data)
......@@ -234,15 +234,15 @@ dvbpsi_pmt_es_t* dvbpsi_PMTAddES(dvbpsi_pmt_t* p_pmt,
* \param p_data descriptor's data
* \return a pointer to the added descriptor.
*/
dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es,
dvbpsi_descriptor_t* dvbpsi_pmt_es_descriptor_add(dvbpsi_pmt_es_t* p_es,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
/*****************************************************************************
* dvbpsi_GenPMTSections
* dvbpsi_pmt_sections_generate
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_t *p_dvbpsi,
* \fn dvbpsi_psi_section_t* dvbpsi_pmt_sections_generate(dvbpsi_t *p_dvbpsi,
dvbpsi_pmt_t* p_pmt)
* \brief PMT generator
* \param p_dvbpsi handle to dvbpsi with attached decoder
......@@ -251,7 +251,33 @@ dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es,
*
* Generate PMT sections based on the dvbpsi_pmt_t structure.
*/
dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_t *p_dvbpsi, dvbpsi_pmt_t* p_pmt);
dvbpsi_psi_section_t* dvbpsi_pmt_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_pmt_t* p_pmt);
/*****************************************************************************
* deprecated API's
*****************************************************************************/
__attribute__((deprecated))
dvbpsi_handle dvbpsi_AttachPMT(uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback,
void* p_cb_data);
__attribute__((deprecated)) void dvbpsi_DetachPMT(dvbpsi_handle h_dvbpsi);
__attribute__((deprecated))
void dvbpsi_InitPMT(dvbpsi_pmt_t* p_pmt, uint16_t i_program_number,
uint8_t i_version, int b_current_next, uint16_t i_pcr_pid);
__attribute__((deprecated)) void dvbpsi_EmptyPMT(dvbpsi_pmt_t* p_pmt);
__attribute__((deprecated))
dvbpsi_descriptor_t* dvbpsi_PMTAddDescriptor(dvbpsi_pmt_t* p_pmt,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
__attribute__((deprecated))
dvbpsi_pmt_es_t* dvbpsi_PMTAddES(dvbpsi_pmt_t* p_pmt,
uint8_t i_type, uint16_t i_pid);
__attribute__((deprecated))
dvbpsi_descriptor_t* dvbpsi_PMTESAddDescriptor(dvbpsi_pmt_es_t* p_es,
uint8_t i_tag, uint8_t i_length,
uint8_t* p_data);
__attribute__((deprecated))
dvbpsi_psi_section_t* dvbpsi_GenPMTSections(dvbpsi_pmt_t* p_pmt);
#ifdef __cplusplus
};
......
......@@ -48,18 +48,28 @@ typedef struct dvbpsi_pmt_decoder_s
} dvbpsi_pmt_decoder_t;
/*****************************************************************************
* dvbpsi_GatherPMTSections
* dvbpsi_pmt_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherPMTSections(dvbpsi_t *p_dvbpsi,
void dvbpsi_pmt_sections_gather(dvbpsi_t *p_dvbpsi,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodePMTSections
* dvbpsi_pmt_sections_decode
*****************************************************************************
* PMT decoder.
*****************************************************************************/
void dvbpsi_pmt_sections_decode(dvbpsi_pmt_t* p_pmt,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_GatherPMTSections(dvbpsi_handle *handle,
dvbpsi_psi_section_t* p_section);
__attribute__((deprecated))
void dvbpsi_DecodePMTSections(dvbpsi_pmt_t* p_pmt,
dvbpsi_psi_section_t* p_section);
......
This diff is collapsed.
......@@ -107,10 +107,10 @@ typedef struct dvbpsi_sdt_s
typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
/*****************************************************************************
* dvbpsi_AttachSDT
* dvbpsi_sdt_attach
*****************************************************************************/
/*!
* \fn bool dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn bool dvbpsi_sdt_attach(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. It is attached to p_dvbpsi.
......@@ -121,14 +121,14 @@ typedef void (* dvbpsi_sdt_callback)(void* p_cb_data, dvbpsi_sdt_t* p_new_sdt);
* \param p_cb_data private data given in argument to the callback.
* \return true on success, false on failure
*/
bool dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
bool dvbpsi_sdt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
dvbpsi_sdt_callback pf_callback, void* p_cb_data);
/*****************************************************************************
* dvbpsi_DetachSDT
* dvbpsi_sdt_detach
*****************************************************************************/
/*!
* \fn void dvbpsi_DetachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
* \fn void dvbpsi_sdt_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id,
uint16_t i_extension)
* \brief Destroy a SDT decoder.
* \param p_dvbpsi pointer holding decoder/demuxer structure
......@@ -136,13 +136,13 @@ bool dvbpsi_AttachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extensi
* \param i_extension Table ID extension, here TS ID.
* \return nothing.
*/
void dvbpsi_DetachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
void dvbpsi_sdt_detach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
/*****************************************************************************
* dvbpsi_InitSDT/dvbpsi_NewSDT
* dvbpsi_sdt_init/dvbpsi_NewSDT
*****************************************************************************/
/*!
* \fn void dvbpsi_InitSDT(dvbpsi_sdt_t* p_sdt, uint16_t i_ts_id,
* \fn void dvbpsi_sdt_init(dvbpsi_sdt_t* p_sdt, uint16_t i_ts_id,
uint8_t i_version, bool b_current_next, uint16_t i_network_id)
* \brief Initialize a user-allocated dvbpsi_sdt_t structure.
* \param p_sdt pointer to the SDT structure
......@@ -152,11 +152,11 @@ void dvbpsi_DetachSDT(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extensi
* \param i_network_id original network id
* \return nothing.
*/
void dvbpsi_InitSDT(dvbpsi_sdt_t *p_sdt, uint16_t i_ts_id, uint8_t i_version,
void dvbpsi_sdt_init(dvbpsi_sdt_t *p_sdt, uint16_t i_ts_id, uint8_t i_version,
bool b_current_next, uint16_t i_network_id);
/*!
* \fn dvbpsi_sdt_t *dvbpsi_NewSDT(uint16_t i_ts_id, uint8_t i_version,
* \fn dvbpsi_sdt_t *dvbpsi_sdt_new(uint16_t i_ts_id, uint8_t i_version,
bool b_current_next, uint16_t i_network_id)
* \brief Allocate and initialize a new dvbpsi_sdt_t structure.
* \param i_ts_id transport stream ID
......@@ -165,33 +165,33 @@ void dvbpsi_InitSDT(dvbpsi_sdt_t *p_sdt, uint16_t i_ts_id, uint8_t i_version,
* \param i_network_id original network id
* \return p_sdt pointer to the SDT structure
*/
dvbpsi_sdt_t *dvbpsi_NewSDT(uint16_t i_ts_id, uint8_t i_version,
dvbpsi_sdt_t *dvbpsi_sdt_new(uint16_t i_ts_id, uint8_t i_version,
bool b_current_next, uint16_t i_network_id);
/*****************************************************************************
* dvbpsi_EmptySDT/dvbpsi_DeleteSDT
* dvbpsi_sdt_empty/dvbpsi_sdt_delete
*****************************************************************************/
/*!
* \fn void dvbpsi_EmptySDT(dvbpsi_sdt_t* p_sdt)
* \fn void dvbpsi_sdt_empty(dvbpsi_sdt_t* p_sdt)
* \brief Clean a dvbpsi_sdt_t structure.
* \param p_sdt pointer to the SDT structure
* \return nothing.
*/
void dvbpsi_EmptySDT(dvbpsi_sdt_t *p_sdt);
void dvbpsi_sdt_empty(dvbpsi_sdt_t *p_sdt);
/*!
* \fn void dvbpsi_DeleteSDT(dvbpsi_sdt_t *p_sdt)
* \fn dvbpsi_sdt_delete(dvbpsi_sdt_t *p_sdt)
* \brief Clean and free a dvbpsi_sdt_t structure.
* \param p_sdt pointer to the SDT structure
* \return nothing.
*/
void dvbpsi_DeleteSDT(dvbpsi_sdt_t *p_sdt);
void dvbpsi_sdt_delete(dvbpsi_sdt_t *p_sdt);
/*****************************************************************************
* dvbpsi_SDTAddService
* dvbpsi_sdt_service_add
*****************************************************************************/
/*!
* \fn dvbpsi_sdt_service_t* dvbpsi_SDTAddService(dvbpsi_sdt_t* p_sdt,
* \fn dvbpsi_sdt_service_t* dvbpsi_sdt_service_add(dvbpsi_sdt_t* p_sdt,
uint16_t i_service_id,
bool b_eit_schedule,
bool b_eit_present,
......@@ -206,15 +206,15 @@ void dvbpsi_DeleteSDT(dvbpsi_sdt_t *p_sdt);
* \param b_free_ca Free CA flag
* \return a pointer to the added service description.
*/
dvbpsi_sdt_service_t *dvbpsi_SDTAddService(dvbpsi_sdt_t* p_sdt,
dvbpsi_sdt_service_t *dvbpsi_sdt_service_add(dvbpsi_sdt_t* p_sdt,
uint16_t i_service_id, bool b_eit_schedule, bool b_eit_present,
uint8_t i_running_status, bool b_free_ca);
/*****************************************************************************
* dvbpsi_SDTServiceAddDescriptor
* dvbpsi_sdt_service_descriptor_add
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t *dvbpsi_SDTServiceAddDescriptor(
* \fn dvbpsi_descriptor_t *dvbpsi_sdt_service_descriptor_add(
dvbpsi_sdt_service_t *p_service,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data)
......@@ -225,18 +225,18 @@ dvbpsi_sdt_service_t *dvbpsi_SDTAddService(dvbpsi_sdt_t* p_sdt,
* \param p_data descriptor's data
* \return a pointer to the added descriptor.
*/
dvbpsi_descriptor_t *dvbpsi_SDTServiceAddDescriptor(
dvbpsi_descriptor_t *dvbpsi_sdt_service_descriptor_add(
dvbpsi_sdt_service_t *p_service,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
/*****************************************************************************
* dvbpsi_GenSDTSections
* dvbpsi_sdt_sections_generate
*****************************************************************************
* Generate SDT sections based on the dvbpsi_sdt_t structure.
*****************************************************************************/
/*!
* \fn dvbpsi_psi_section_t* dvbpsi_GenSDTSections(dvbpsi_t *p_dvbpsi,
* \fn dvbpsi_psi_section_t* dvbpsi_sdt_sections_generate(dvbpsi_t *p_dvbpsi,
dvbpsi_sdt_t * p_sdt)
* \brief SDT generator
* \param p_dvbpsi handle to dvbpsi with attached decoder
......@@ -245,7 +245,33 @@ dvbpsi_descriptor_t *dvbpsi_SDTServiceAddDescriptor(
*
* Generate SDT sections based on the dvbpsi_sdt_t structure.
*/
dvbpsi_psi_section_t *dvbpsi_GenSDTSections(dvbpsi_t *p_dvbpsi, dvbpsi_sdt_t * p_sdt);
dvbpsi_psi_section_t *dvbpsi_sdt_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_sdt_t * p_sdt);
/*****************************************************************************
* deprecated API's
*****************************************************************************/
__attribute__((deprecated))
int dvbpsi_AttachSDT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
uint16_t i_extension, dvbpsi_sdt_callback pf_callback,
void* p_cb_data);
__attribute__((deprecated))
void dvbpsi_DetachSDT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
uint16_t i_extension);
__attribute__((deprecated))
void dvbpsi_InitSDT(dvbpsi_sdt_t *p_sdt, uint16_t i_ts_id, uint8_t i_version,
int b_current_next, uint16_t i_network_id);
__attribute__((deprecated)) void dvbpsi_EmptySDT(dvbpsi_sdt_t *p_sdt);
__attribute__((deprecated))
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);
__attribute__((deprecated))
dvbpsi_descriptor_t *dvbpsi_SDTServiceAddDescriptor(
dvbpsi_sdt_service_t *p_service,
uint8_t i_tag, uint8_t i_length,
uint8_t *p_data);
__attribute__((deprecated))
dvbpsi_psi_section_t *dvbpsi_GenSDTSections(dvbpsi_sdt_t * p_sdt);
#ifdef __cplusplus
};
......
......@@ -46,19 +46,30 @@ typedef struct dvbpsi_sdt_decoder_s
} dvbpsi_sdt_decoder_t;
/*****************************************************************************
* dvbpsi_GatherSDTSections
* dvbpsi_sdt_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherSDTSections(dvbpsi_t *p_dvbpsi,
dvbpsi_decoder_t *p_private_decoder,
dvbpsi_psi_section_t *p_section);
void dvbpsi_sdt_sections_gather(dvbpsi_t *p_dvbpsi,
dvbpsi_decoder_t *p_private_decoder,
dvbpsi_psi_section_t *p_section);
/*****************************************************************************
* dvbpsi_DecodeSDTSection
* dvbpsi_sdt_sections_decode
*****************************************************************************
* SDT decoder.
*****************************************************************************/
void dvbpsi_sdt_sections_decode(dvbpsi_sdt_t* p_sdt,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_GatherSDTSections(dvbpsi_handle *p_dvbpsi,
dvbpsi_decoder_t *p_private_decoder,
dvbpsi_psi_section_t *p_section);
__attribute__((deprecated))
void dvbpsi_DecodeSDTSections(dvbpsi_sdt_t* p_sdt,
dvbpsi_psi_section_t* p_section);
......
This diff is collapsed.
This diff is collapsed.
......@@ -46,23 +46,32 @@ typedef struct dvbpsi_sis_decoder_s
} dvbpsi_sis_decoder_t;
/*****************************************************************************
* dvbpsi_GatherSISSections
* dvbpsi_sis_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherSISSections(dvbpsi_t* p_dvbpsi,
void dvbpsi_sis_sections_gather(dvbpsi_t* p_dvbpsi,
dvbpsi_decoder_t * p_decoder,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeSISSection
* dvbpsi_sis_sections_decode
*****************************************************************************
* SIS decoder.
*****************************************************************************/
void dvbpsi_DecodeSISSections(dvbpsi_t* p_dvbpsi, dvbpsi_sis_t* p_sis,
dvbpsi_psi_section_t* p_section);
void dvbpsi_sis_sections_decode(dvbpsi_t* p_dvbpsi, dvbpsi_sis_t* p_sis,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* Deprecated API's
*****************************************************************************/
__attribute__((deprecated))
void dvbpsi_GatherSISSections(dvbpsi_handle* p_dvbpsi,
dvbpsi_decoder_t * p_decoder,
dvbpsi_psi_section_t* p_section);
__attribute__((deprecated))
void dvbpsi_DecodeSISSections(dvbpsi_sis_t* p_sis,
dvbpsi_psi_section_t* p_section);
#else
#error "Multiple inclusions of sis_private.h"
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -50,27 +50,31 @@ typedef struct dvbpsi_tot_decoder_s
/*****************************************************************************
* dvbpsi_GatherTOTSections
* dvbpsi_tot_sections_gather
*****************************************************************************
* Callback for the PSI decoder.
*****************************************************************************/
void dvbpsi_GatherTOTSections(dvbpsi_t* p_dvbpsi,
void dvbpsi_tot_sections_gather(dvbpsi_t* p_dvbpsi,
dvbpsi_decoder_t* p_decoder,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_ValidTOTSection
* dvbpsi_tot_sections_decode
*****************************************************************************
* Check the CRC_32 if the section has b_syntax_indicator set.
* TDT/TOT decoder.
*****************************************************************************/
static bool dvbpsi_ValidTOTSection(dvbpsi_t* p_dvbpsi, dvbpsi_psi_section_t* p_section);
void dvbpsi_tot_sections_decode(dvbpsi_t* p_dvbpsi, dvbpsi_tot_t* p_tot,
dvbpsi_psi_section_t* p_section);
/*****************************************************************************
* dvbpsi_DecodeTOTSections
*****************************************************************************
* TDT/TOT decoder.
* Deprecated API's
*****************************************************************************/
void dvbpsi_DecodeTOTSections(dvbpsi_t* p_dvbpsi, dvbpsi_tot_t* p_tot,
__attribute__((deprecated))
void dvbpsi_GatherTOTSections(dvbpsi_handle* p_dvbpsi,
dvbpsi_decoder_t* p_decoder,
dvbpsi_psi_section_t* p_section);
__attribute__((deprecated))
void dvbpsi_DecodeTOTSections(dvbpsi_handle* p_dvbpsi, dvbpsi_tot_t* p_tot,
dvbpsi_psi_section_t* p_section);
#else
......
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