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

misc: update API's used

parent 7cfea795
......@@ -37,7 +37,7 @@
<xsl:apply-templates mode="code" />
/* main function */
int main()
int main(void)
{
int i_err = 0;
<xsl:apply-templates mode="main" />
......@@ -60,7 +60,7 @@ int main()
<xsl:template match="descriptor" mode="code">
/* <xsl:value-of select="@name" /> */
int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" />()
static int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" />(void)
{
BOZO_VARS(<xsl:value-of select="@sname" />);
BOZO_START(<xsl:value-of select="@name" />);
......
/*****************************************************************************
* gen_pat.c: PAT generator
*----------------------------------------------------------------------------
* Copyright (C) 2001-2010 VideoLAN
* Copyright (C) 2001-2011 VideoLAN
* $Id: gen_pat.c,v 1.3 2002/10/07 14:15:14 sam Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -46,7 +46,6 @@
#include <dvbpsi/pat.h>
#endif
/*****************************************************************************
* writePSI
*****************************************************************************/
......@@ -95,6 +94,10 @@ static void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section)
}
}
static void message(dvbpsi_t *handle, const char* msg)
{
fprintf(stderr, "%s\n", msg);
}
/*****************************************************************************
* main
......@@ -108,6 +111,10 @@ 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);
if (p_dvbpsi == NULL)
return 1;
/* PAT generation */
dvbpsi_InitPAT(&pat, 1, 0, 0);
dvbpsi_PATAddProgram(&pat, 0, 0x12);
......@@ -117,23 +124,23 @@ int main(int i_argc, char* pa_argv[])
for(i = 4; i < 43; i++)
dvbpsi_PATAddProgram(&pat, i, i);
p_section1 = dvbpsi_GenPATSections(&pat, 4);
p_section1 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 4);
pat.b_current_next = 1;
p_section2 = dvbpsi_GenPATSections(&pat, 8);
p_section2 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 8);
pat.i_version = 1;
pat.b_current_next = 0;
p_section3 = dvbpsi_GenPATSections(&pat, 16);
p_section3 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 16);
pat.b_current_next = 1;
p_section4 = dvbpsi_GenPATSections(&pat, 300);
p_section4 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 300);
pat.i_version = 2;
pat.b_current_next = 0;
p_section5 = dvbpsi_GenPATSections(&pat, 16);
p_section5 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 16);
pat.b_current_next = 1;
p_section6 = dvbpsi_GenPATSections(&pat, 16);
p_section6 = dvbpsi_GenPATSections(p_dvbpsi, &pat, 16);
/* TS packets generation */
packet[0] = 0x47;
......@@ -147,7 +154,6 @@ int main(int i_argc, char* pa_argv[])
writePSI(packet, p_section5);
writePSI(packet, p_section6);
dvbpsi_DeletePSISections(p_section1);
dvbpsi_DeletePSISections(p_section2);
dvbpsi_DeletePSISections(p_section3);
......@@ -157,6 +163,7 @@ int main(int i_argc, char* pa_argv[])
dvbpsi_EmptyPAT(&pat);
dvbpsi_DeleteHandle(p_dvbpsi);
return 0;
}
/*****************************************************************************
* gen_pmt.c: PMT generator
*----------------------------------------------------------------------------
* Copyright (C) 2001-2010 VideoLAN
* Copyright (C) 2001-2011 VideoLAN
* $Id$
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -97,6 +97,10 @@ static void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section)
}
}
static void message(dvbpsi_t *handle, const char* msg)
{
fprintf(stderr, "%s\n", msg);
}
/*****************************************************************************
* main
......@@ -111,6 +115,10 @@ 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);
if (p_dvbpsi == NULL)
return 1;
/* PMT generation */
dvbpsi_InitPMT(&pmt, 12, 0, 0, 42);
dvbpsi_PMTAddDescriptor(&pmt, 12, 26, data);
......@@ -123,23 +131,23 @@ int main(int i_argc, char* pa_argv[])
dvbpsi_PMTESAddDescriptor(p_es, 2, 1, data + 4);
dvbpsi_PMTESAddDescriptor(p_es, 0, 4, data + 7);
p_section1 = dvbpsi_GenPMTSections(&pmt);
p_section1 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
pmt.b_current_next = 1;
p_section2 = dvbpsi_GenPMTSections(&pmt);
p_section2 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
pmt.i_version = 1;
pmt.b_current_next = 0;
p_section3 = dvbpsi_GenPMTSections(&pmt);
p_section3 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
pmt.b_current_next = 1;
p_section4 = dvbpsi_GenPMTSections(&pmt);
p_section4 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
pmt.i_version = 2;
pmt.b_current_next = 0;
p_section5 = dvbpsi_GenPMTSections(&pmt);
p_section5 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
pmt.b_current_next = 1;
p_section6 = dvbpsi_GenPMTSections(&pmt);
p_section6 = dvbpsi_GenPMTSections(p_dvbpsi, &pmt);
/* TS packets generation */
packet[0] = 0x47;
......@@ -163,7 +171,7 @@ int main(int i_argc, char* pa_argv[])
dvbpsi_DeletePSISections(p_section6);
dvbpsi_EmptyPMT(&pmt);
dvbpsi_DeleteHandle(p_dvbpsi);
return 0;
}
......@@ -25,14 +25,14 @@
#include "test_dr.h"
/* video stream (b_mpeg2 = false) */
static int main_vstream_1(void)
{
BOZO_VARS(vstream);
BOZO_START(video stream (b_mpeg2 = false));
/* check b_multiple_frame_rate */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
......@@ -93,7 +93,7 @@ static int main_vstream_2(void)
BOZO_VARS(vstream);
BOZO_START(video stream (b_mpeg2 = true));
/* check b_multiple_frame_rate */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
......@@ -211,7 +211,7 @@ static int main_astream_(void)
BOZO_VARS(astream);
BOZO_START(audio stream);
/* check b_free_format */
BOZO_init_boolean(b_free_format, 0);
BOZO_init_integer(i_id, 0);
......@@ -254,7 +254,7 @@ static int main_hierarchy_(void)
BOZO_VARS(hierarchy);
BOZO_START(hierarchy);
/* check i_h_type */
BOZO_init_integer(i_h_type, 0);
BOZO_init_integer(i_h_layer_index, 0);
......@@ -311,7 +311,7 @@ static int main_registration_(void)
BOZO_VARS(registration);
BOZO_START(registration);
/* check i_format_identifier */
s_decoded.i_additional_length = 0;
BOZO_init_integer(i_format_identifier, 0);
......@@ -333,7 +333,7 @@ static int main_ds_alignment_(void)
BOZO_VARS(ds_alignment);
BOZO_START(data stream alignment);
/* check i_alignment_type */
BOZO_init_integer(i_alignment_type, 0);
BOZO_begin_integer(i_alignment_type, 8)
......@@ -354,7 +354,7 @@ static int main_target_bg_grid_(void)
BOZO_VARS(target_bg_grid);
BOZO_START(target background grid);
/* check i_horizontal_size */
BOZO_init_integer(i_horizontal_size, 0);
BOZO_init_integer(i_vertical_size, 0);
......@@ -397,7 +397,7 @@ static int main_vwindow_(void)
BOZO_VARS(vwindow);
BOZO_START(video window);
/* check i_horizontal_offset */
BOZO_init_integer(i_horizontal_offset, 0);
BOZO_init_integer(i_vertical_offset, 0);
......@@ -440,7 +440,7 @@ static int main_ca_(void)
BOZO_VARS(ca);
BOZO_START(conditional access);
/* check i_ca_system_id */
s_decoded.i_private_length = 0;
BOZO_init_integer(i_ca_system_id, 0);
......@@ -473,7 +473,7 @@ static int main_system_clock_(void)
BOZO_VARS(system_clock);
BOZO_START(system clock);
/* check b_external_clock_ref */
BOZO_init_boolean(b_external_clock_ref, 0);
BOZO_init_integer(i_clock_accuracy_integer, 0);
......@@ -516,7 +516,7 @@ static int main_mx_buff_utilization_(void)
BOZO_VARS(mx_buff_utilization);
BOZO_START(multiplex buffer utilization);
/* check b_mdv_valid */
BOZO_init_boolean(b_mdv_valid, 0);
BOZO_init_integer(i_mx_delay_variation, 0);
......@@ -559,7 +559,7 @@ static int main_copyright_(void)
BOZO_VARS(copyright);
BOZO_START(copyright);
/* check i_copyright_identifier */
s_decoded.i_additional_length = 0;
BOZO_init_integer(i_copyright_identifier, 0);
......@@ -581,7 +581,7 @@ static int main_max_bitrate_(void)
BOZO_VARS(max_bitrate);
BOZO_START(maximum bitrate);
/* check i_max_bitrate */
BOZO_init_integer(i_max_bitrate, 0);
BOZO_begin_integer(i_max_bitrate, 22)
......@@ -602,7 +602,7 @@ static int main_private_data_(void)
BOZO_VARS(private_data);
BOZO_START(private data indicator);
/* check i_private_data */
BOZO_init_integer(i_private_data, 0);
BOZO_begin_integer(i_private_data, 32)
......@@ -623,7 +623,7 @@ static int main_service_(void)
BOZO_VARS(service);
BOZO_START(service);
/* check i_service_type */
s_decoded.i_service_provider_name_length = 0;
s_decoded.i_service_name_length = 0;
......@@ -645,7 +645,7 @@ static int main_service_(void)
int main(void)
{
int i_err = 0;
i_err |= main_vstream_1();
i_err |= main_vstream_2();
i_err |= main_astream_();
......
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