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;
}
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