* src/descriptors/dr_09.c: reserved bits set to 1 as specified in ISO.

  * src/descriptors/dr.h: new headers.
  * src/descriptors/Makefile.am: new descriptors.
  * misc/dr.xml, misc/test_dr.c: up to date descriptor definition and
    associated generated file.
  * src/descriptors/dr_0b.h, src/descriptors/dr_0b.c: MPEG2 "system
    clock" descriptor decoder and generator.
  * src/descriptors/dr_0c.h, src/descriptors/dr_0c.c: MPEG2 "multiplex
    buffer utilization" descriptor decoder and generator.
  * src/descriptors/dr_0d.h, src/descriptors/dr_0d.c: MPEG2 "copyright"
    descriptor decoder and generator.
  * src/descriptors/dr_0e.h, src/descriptors/dr_0e.c: MPEG2 "maximum
    bitrate" descriptor decoder and generator.
  * src/descriptors/dr_0f.h, src/descriptors/dr_0f.c: MPEG2 "private
    data indicator" descriptor decoder and generator.

Note: all the MPEG2 descriptors decoders and generators (except for wide
range data) have been tested with the "test_dr" program located in the
"misc" directory.
parent 6a75b337
......@@ -81,4 +81,32 @@
<integer name="i_audio_type" bitcount="8" default="0" />
</descriptor>
<descriptor name="system clock" sname="system_clock" fname="SystemClock">
<boolean name="b_external_clock_ref" default="0" />
<integer name="i_clock_accuracy_integer" bitcount="6" default="0" />
<integer name="i_clock_accuracy_exponent" bitcount="3" default="0" />
</descriptor>
<descriptor name="multiplex buffer utilization" sname="mx_buff_utilization" fname="MxBuffUtilization">
<boolean name="b_mdv_valid" default="0" />
<integer name="i_mx_delay_variation" bitcount="15" default="0" />
<integer name="i_mx_strategy" bitcount="3" default="0" />
</descriptor>
<descriptor name="copyright" sname="copyright" fname="Copyright">
<insert>
<begin>
s_decoded.i_additional_length = 0;</begin>
</insert>
<integer name="i_copyright_identifier" bitcount="32" default="0" />
</descriptor>
<descriptor name="maximum bitrate" sname="max_bitrate" fname="MaxBitrate">
<integer name="i_max_bitrate" bitcount="22" default="0" />
</descriptor>
<descriptor name="private data indicator" sname="private_data" fname="PrivateData">
<integer name="i_private_data" bitcount="32" default="0" />
</descriptor>
</dr>
......@@ -483,6 +483,156 @@ int main_iso639_()
return i_err;
}
/* system clock */
int main_system_clock_()
{
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);
BOZO_init_integer(i_clock_accuracy_exponent, 0);
BOZO_begin_boolean(b_external_clock_ref)
BOZO_DOJOB(SystemClock);
BOZO_check_boolean(b_external_clock_ref)
BOZO_CLEAN();
BOZO_end_boolean(b_external_clock_ref)
/* check i_clock_accuracy_integer */
BOZO_init_boolean(b_external_clock_ref, 0);
BOZO_init_integer(i_clock_accuracy_integer, 0);
BOZO_init_integer(i_clock_accuracy_exponent, 0);
BOZO_begin_integer(i_clock_accuracy_integer, 6)
BOZO_DOJOB(SystemClock);
BOZO_check_integer(i_clock_accuracy_integer, 6)
BOZO_CLEAN();
BOZO_end_integer(i_clock_accuracy_integer, 6)
/* check i_clock_accuracy_exponent */
BOZO_init_boolean(b_external_clock_ref, 0);
BOZO_init_integer(i_clock_accuracy_integer, 0);
BOZO_init_integer(i_clock_accuracy_exponent, 0);
BOZO_begin_integer(i_clock_accuracy_exponent, 3)
BOZO_DOJOB(SystemClock);
BOZO_check_integer(i_clock_accuracy_exponent, 3)
BOZO_CLEAN();
BOZO_end_integer(i_clock_accuracy_exponent, 3)
BOZO_END(system clock);
return i_err;
}
/* multiplex buffer utilization */
int main_mx_buff_utilization_()
{
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);
BOZO_init_integer(i_mx_strategy, 0);
BOZO_begin_boolean(b_mdv_valid)
BOZO_DOJOB(MxBuffUtilization);
BOZO_check_boolean(b_mdv_valid)
BOZO_CLEAN();
BOZO_end_boolean(b_mdv_valid)
/* check i_mx_delay_variation */
BOZO_init_boolean(b_mdv_valid, 0);
BOZO_init_integer(i_mx_delay_variation, 0);
BOZO_init_integer(i_mx_strategy, 0);
BOZO_begin_integer(i_mx_delay_variation, 15)
BOZO_DOJOB(MxBuffUtilization);
BOZO_check_integer(i_mx_delay_variation, 15)
BOZO_CLEAN();
BOZO_end_integer(i_mx_delay_variation, 15)
/* check i_mx_strategy */
BOZO_init_boolean(b_mdv_valid, 0);
BOZO_init_integer(i_mx_delay_variation, 0);
BOZO_init_integer(i_mx_strategy, 0);
BOZO_begin_integer(i_mx_strategy, 3)
BOZO_DOJOB(MxBuffUtilization);
BOZO_check_integer(i_mx_strategy, 3)
BOZO_CLEAN();
BOZO_end_integer(i_mx_strategy, 3)
BOZO_END(multiplex buffer utilization);
return i_err;
}
/* copyright */
int main_copyright_()
{
BOZO_VARS(copyright);
BOZO_START(copyright);
/* check i_copyright_identifier */
s_decoded.i_additional_length = 0;
BOZO_init_integer(i_copyright_identifier, 0);
BOZO_begin_integer(i_copyright_identifier, 32)
BOZO_DOJOB(Copyright);
BOZO_check_integer(i_copyright_identifier, 32)
BOZO_CLEAN();
BOZO_end_integer(i_copyright_identifier, 32)
BOZO_END(copyright);
return i_err;
}
/* maximum bitrate */
int main_max_bitrate_()
{
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)
BOZO_DOJOB(MaxBitrate);
BOZO_check_integer(i_max_bitrate, 22)
BOZO_CLEAN();
BOZO_end_integer(i_max_bitrate, 22)
BOZO_END(maximum bitrate);
return i_err;
}
/* private data indicator */
int main_private_data_()
{
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)
BOZO_DOJOB(PrivateData);
BOZO_check_integer(i_private_data, 32)
BOZO_CLEAN();
BOZO_end_integer(i_private_data, 32)
BOZO_END(private data indicator);
return i_err;
}
/* main function */
int main()
......@@ -499,6 +649,11 @@ int main()
i_err |= main_vwindow_();
i_err |= main_ca_();
i_err |= main_iso639_();
i_err |= main_system_clock_();
i_err |= main_mx_buff_utilization_();
i_err |= main_copyright_();
i_err |= main_max_bitrate_();
i_err |= main_private_data_();
if(i_err)
fprintf(stderr, "At least one test has FAILED !!!\n");
......
......@@ -12,7 +12,12 @@ lib_descriptors_la_SOURCES = dr_02.c \
dr_07.c \
dr_08.c \
dr_09.c \
dr_0a.c
dr_0a.c \
dr_0b.c \
dr_0c.c \
dr_0d.c \
dr_0e.c \
dr_0f.c
pkginclude_HEADERS = dr_02.h \
dr_03.h \
......@@ -23,5 +28,10 @@ pkginclude_HEADERS = dr_02.h \
dr_08.h \
dr_09.h \
dr_0a.h \
dr_0b.h \
dr_0c.h \
dr_0d.h \
dr_0e.h \
dr_0f.h \
dr.h
......@@ -77,10 +77,10 @@ pkgincludedir = $(includedir)/dvbpsi
noinst_LTLIBRARIES = lib_descriptors.la
lib_descriptors_la_SOURCES = dr_02.c dr_03.c dr_04.c dr_05.c dr_06.c dr_07.c dr_08.c dr_09.c dr_0a.c
lib_descriptors_la_SOURCES = dr_02.c dr_03.c dr_04.c dr_05.c dr_06.c dr_07.c dr_08.c dr_09.c dr_0a.c dr_0b.c dr_0c.c dr_0d.c dr_0e.c dr_0f.c
pkginclude_HEADERS = dr_02.h dr_03.h dr_04.h dr_05.h dr_06.h dr_07.h dr_08.h dr_09.h dr_0a.h dr.h
pkginclude_HEADERS = dr_02.h dr_03.h dr_04.h dr_05.h dr_06.h dr_07.h dr_08.h dr_09.h dr_0a.h dr_0b.h dr_0c.h dr_0d.h dr_0e.h dr_0f.h dr.h
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../src/config.h
......@@ -95,7 +95,8 @@ LIBS = @LIBS@
lib_descriptors_la_LDFLAGS =
lib_descriptors_la_LIBADD =
lib_descriptors_la_OBJECTS = dr_02.lo dr_03.lo dr_04.lo dr_05.lo \
dr_06.lo dr_07.lo dr_08.lo dr_09.lo dr_0a.lo
dr_06.lo dr_07.lo dr_08.lo dr_09.lo dr_0a.lo dr_0b.lo dr_0c.lo dr_0d.lo \
dr_0e.lo dr_0f.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
......@@ -111,7 +112,8 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
DEP_FILES = .deps/dr_02.P .deps/dr_03.P .deps/dr_04.P .deps/dr_05.P \
.deps/dr_06.P .deps/dr_07.P .deps/dr_08.P .deps/dr_09.P .deps/dr_0a.P
.deps/dr_06.P .deps/dr_07.P .deps/dr_08.P .deps/dr_09.P .deps/dr_0a.P \
.deps/dr_0b.P .deps/dr_0c.P .deps/dr_0d.P .deps/dr_0e.P .deps/dr_0f.P
SOURCES = $(lib_descriptors_la_SOURCES)
OBJECTS = $(lib_descriptors_la_OBJECTS)
......
/*****************************************************************************
* dr.h
* (c)2001-2002 VideoLAN
* $Id: dr.h,v 1.1 2002/05/09 17:00:03 bozo Exp $
* $Id: dr.h,v 1.2 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -41,6 +41,11 @@
#include "../src/descriptors/dr_08.h"
#include "../src/descriptors/dr_09.h"
#include "../src/descriptors/dr_0a.h"
#include "../src/descriptors/dr_0b.h"
#include "../src/descriptors/dr_0c.h"
#include "../src/descriptors/dr_0d.h"
#include "../src/descriptors/dr_0e.h"
#include "../src/descriptors/dr_0f.h"
#else
#error "Multiple inclusions of dr.h"
......
/*****************************************************************************
* dr_09.c
* (c)2001-2002 VideoLAN
* $Id: dr_09.c,v 1.2 2002/05/09 17:00:03 bozo Exp $
* $Id: dr_09.c,v 1.3 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -100,7 +100,7 @@ dvbpsi_descriptor_t * dvbpsi_GenCADr(dvbpsi_ca_dr_t * p_decoded,
/* Encode data */
p_descriptor->p_data[0] = p_decoded->i_ca_system_id >> 8;
p_descriptor->p_data[1] = p_decoded->i_ca_system_id;
p_descriptor->p_data[2] = (p_decoded->i_ca_pid >> 8) & 0x1f;
p_descriptor->p_data[2] = 0xe0 | ((p_decoded->i_ca_pid >> 8) & 0x1f);
p_descriptor->p_data[3] = p_decoded->i_ca_pid;
if(p_decoded->i_private_length)
memcpy(p_descriptor->p_data + 4,
......
/*****************************************************************************
* dr_0b.c
* (c)2001-2002 VideoLAN
* $Id: dr_0b.c,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../descriptor.h"
#include "dr_0b.h"
/*****************************************************************************
* dvbpsi_DecodeSystemClockDr
*****************************************************************************/
dvbpsi_system_clock_dr_t * dvbpsi_DecodeSystemClockDr(
dvbpsi_descriptor_t * p_descriptor)
{
dvbpsi_system_clock_dr_t * p_decoded;
/* Check the tag */
if(p_descriptor->i_tag != 0x0b)
{
DVBPSI_ERROR_ARG("dr_0b decoder", "bad tag (0x%x)", p_descriptor->i_tag);
return NULL;
}
/* Don't decode twice */
if(p_descriptor->p_decoded)
return p_descriptor->p_decoded;
/* Allocate memory */
p_decoded =
(dvbpsi_system_clock_dr_t*)malloc(sizeof(dvbpsi_system_clock_dr_t));
if(!p_decoded)
{
DVBPSI_ERROR("dr_0b decoder", "out of memory");
return NULL;
}
/* Decode data and check the length */
if(p_descriptor->i_length != 2)
{
DVBPSI_ERROR_ARG("dr_0b decoder", "bad length (%d)",
p_descriptor->i_length);
free(p_decoded);
}
p_decoded->b_external_clock_ref = (p_descriptor->p_data[0] & 0x80) ? 1 : 0;
p_decoded->i_clock_accuracy_integer = p_descriptor->p_data[0] & 0x3f;
p_decoded->i_clock_accuracy_exponent = (p_descriptor->p_data[1] & 0xe0) >> 5;
p_descriptor->p_decoded = (void*)p_decoded;
return p_decoded;
}
/*****************************************************************************
* dvbpsi_GenSystemClockDr
*****************************************************************************/
dvbpsi_descriptor_t * dvbpsi_GenSystemClockDr(
dvbpsi_system_clock_dr_t * p_decoded,
int b_duplicate)
{
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x0b, 2, NULL);
if(p_descriptor)
{
/* Encode data */
p_descriptor->p_data[0] =
0x40 | (p_decoded->i_clock_accuracy_integer & 0x3f);
if(p_decoded->b_external_clock_ref)
p_descriptor->p_data[0] |= 0x80;
p_descriptor->p_data[1] = 0x1f | p_decoded->i_clock_accuracy_exponent << 5;
if(b_duplicate)
{
/* Duplicate decoded data */
dvbpsi_system_clock_dr_t * p_dup_decoded =
(dvbpsi_system_clock_dr_t*)malloc(sizeof(dvbpsi_system_clock_dr_t));
if(p_dup_decoded)
memcpy(p_dup_decoded, p_decoded, sizeof(dvbpsi_system_clock_dr_t));
p_descriptor->p_decoded = (void*)p_dup_decoded;
}
}
return p_descriptor;
}
/*****************************************************************************
* dr_0b.h
* (c)2001-2002 VideoLAN
* $Id: dr_0b.h,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
/*!
* \file <dr_0b.h>
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the MPEG 2 "system clock"
* descriptor decoder and generator.
*
* Application interface for the MPEG 2 "system clock" descriptor
* decoder and generator. This descriptor's definition can be found in
* ISO/IEC 13818-1 section 2.6.20.
*/
#ifndef _DVBPSI_DR_0B_H_
#define _DVBPSI_DR_0B_H_
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_system_clock_dr_t
*****************************************************************************/
/*!
* \struct dvbpsi_system_clock_dr_s
* \brief "system clock" descriptor structure.
*
* This structure is used to store a decoded "system clock"
* descriptor. (ISO/IEC 13818-1 section 2.6.20).
*/
/*!
* \typedef struct dvbpsi_system_clock_dr_s dvbpsi_system_clock_dr_t
* \brief dvbpsi_system_clock_dr_t type definition.
*/
typedef struct dvbpsi_system_clock_dr_s
{
int b_external_clock_ref; /*!< external_clock_reference_indicator
*/
uint8_t i_clock_accuracy_integer; /*!< clock_accuracy_integer */
uint8_t i_clock_accuracy_exponent; /*!< clock_accuracy_exponent */
} dvbpsi_system_clock_dr_t;
/*****************************************************************************
* dvbpsi_DecodeSystemClockDr
*****************************************************************************/
/*!
* \fn dvbpsi_system_clock_dr_t * dvbpsi_DecodeSystemClockDr(
* dvbpsi_descriptor_t * p_descriptor)
* \brief "system clock" descriptor decoder.
* \param p_descriptor pointer to the descriptor structure
* \return a pointer to a new "system clock" descriptor structure which
* contains the decoded data.
*/
dvbpsi_system_clock_dr_t* dvbpsi_DecodeSystemClockDr(
dvbpsi_descriptor_t * p_descriptor);
/*****************************************************************************
* dvbpsi_GenSystemClockDr
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t * dvbpsi_GenSystemClockDr(
* dvbpsi_system_clock_dr_t * p_decoded, int b_duplicate)
* \brief "system clock" descriptor generator.
* \param p_decoded pointer to a decoded "system clock" descriptor
* structure
* \param b_duplicate if non zero then duplicate the p_decoded structure into
* the descriptor
* \return a pointer to a new descriptor structure which contains encoded data.
*/
dvbpsi_descriptor_t * dvbpsi_GenSystemClockDr(
dvbpsi_system_clock_dr_t * p_decoded,
int b_duplicate);
#ifdef __cplusplus
};
#endif
#else
#error "Multiple inclusions of dr_0b.h"
#endif
/*****************************************************************************
* dr_0c.c
* (c)2001-2002 VideoLAN
* $Id: dr_0c.c,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../descriptor.h"
#include "dr_0c.h"
/*****************************************************************************
* dvbpsi_DecodeMxBuffUtilizationDr
*****************************************************************************/
dvbpsi_mx_buff_utilization_dr_t * dvbpsi_DecodeMxBuffUtilizationDr(
dvbpsi_descriptor_t * p_descriptor)
{
dvbpsi_mx_buff_utilization_dr_t * p_decoded;
/* Check the tag */
if(p_descriptor->i_tag != 0x0c)
{
DVBPSI_ERROR_ARG("dr_0c decoder", "bad tag (0x%x)", p_descriptor->i_tag);
return NULL;
}
/* Don't decode twice */
if(p_descriptor->p_decoded)
return p_descriptor->p_decoded;
/* Allocate memory */
p_decoded = (dvbpsi_mx_buff_utilization_dr_t*)
malloc(sizeof(dvbpsi_mx_buff_utilization_dr_t));
if(!p_decoded)
{
DVBPSI_ERROR("dr_0c decoder", "out of memory");
return NULL;
}
/* Decode data and check the length */
if(p_descriptor->i_length != 3)
{
DVBPSI_ERROR_ARG("dr_0c decoder", "bad length (%d)",
p_descriptor->i_length);
free(p_decoded);
}
p_decoded->b_mdv_valid = (p_descriptor->p_data[0] & 0x80) ? 1 : 0;
p_decoded->i_mx_delay_variation =
((uint16_t)(p_descriptor->p_data[0] & 0x7f) << 8)
| p_descriptor->p_data[1];
p_decoded->i_mx_strategy = (p_descriptor->p_data[2] & 0xe0) >> 5;
p_descriptor->p_decoded = (void*)p_decoded;
return p_decoded;
}
/*****************************************************************************
* dvbpsi_GenMxBuffUtilizationDr
*****************************************************************************/
dvbpsi_descriptor_t * dvbpsi_GenMxBuffUtilizationDr(
dvbpsi_mx_buff_utilization_dr_t * p_decoded,
int b_duplicate)
{
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x0c, 3, NULL);
if(p_descriptor)
{
/* Encode data */
p_descriptor->p_data[0] = (p_decoded->i_mx_delay_variation >> 8) & 0x7f;
if(p_decoded->b_mdv_valid)
p_descriptor->p_data[0] |= 0x80;
p_descriptor->p_data[1] = p_decoded->i_mx_delay_variation;
p_descriptor->p_data[2] = 0x1f | p_decoded->i_mx_strategy << 5;
if(b_duplicate)
{
/* Duplicate decoded data */
dvbpsi_mx_buff_utilization_dr_t * p_dup_decoded =
(dvbpsi_mx_buff_utilization_dr_t*)
malloc(sizeof(dvbpsi_mx_buff_utilization_dr_t));
if(p_dup_decoded)
memcpy(p_dup_decoded,
p_decoded,
sizeof(dvbpsi_mx_buff_utilization_dr_t));
p_descriptor->p_decoded = (void*)p_dup_decoded;
}
}
return p_descriptor;
}
/*****************************************************************************
* dr_0c.h
* (c)2001-2002 VideoLAN
* $Id: dr_0c.h,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
/*!
* \file <dr_0c.h>
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the MPEG 2 "multiplex buffer utilization"
* descriptor decoder and generator.
*
* Application interface for the MPEG 2 "multiplex buffer utilization"
* descriptor decoder and generator. This descriptor's definition can be found
* in ISO/IEC 13818-1 section 2.6.22.
*/
#ifndef _DVBPSI_DR_0C_H_
#define _DVBPSI_DR_0C_H_
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_mx_buff_utilization_dr_t
*****************************************************************************/
/*!
* \struct dvbpsi_mx_buff_utilization_dr_s
* \brief "multiplex buffer utilization" descriptor structure.
*
* This structure is used to store a decoded "multiplex buffer utilization"
* descriptor. (ISO/IEC 13818-1 section 2.6.22).
*/
/*!
* \typedef struct dvbpsi_mx_buff_utilization_dr_s
* dvbpsi_mx_buff_utilization_dr_t
* \brief dvbpsi_systemclock_dr_t type definition.
*/
typedef struct dvbpsi_mx_buff_utilization_dr_s
{
int b_mdv_valid; /*!< mdv_valid_flag */
uint16_t i_mx_delay_variation; /*!< multiplex_delay_variation */
uint8_t i_mx_strategy; /*!< multiplex_strategy */
} dvbpsi_mx_buff_utilization_dr_t;
/*****************************************************************************
* dvbpsi_DecodeMxBuffUtilizationDr
*****************************************************************************/
/*!
* \fn dvbpsi_mx_buff_utilization_dr_t * dvbpsi_DecodeMxBuffUtilizationDr(
* dvbpsi_descriptor_t * p_descriptor)
* \brief "multiplex buffer utilization" descriptor decoder.
* \param p_descriptor pointer to the descriptor structure
* \return a pointer to a new "multiplex buffer utilization" descriptor
* structure which contains the decoded data.
*/
dvbpsi_mx_buff_utilization_dr_t* dvbpsi_DecodeMxBuffUtilizationDr(
dvbpsi_descriptor_t * p_descriptor);
/*****************************************************************************
* dvbpsi_GenMxBuffUtilizationDr
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t * dvbpsi_GenMxBuffUtilizationDr(
* dvbpsi_mx_buff_utilization_dr_t * p_decoded, int b_duplicate)
* \brief "multiplex buffer utilization" descriptor generator.
* \param p_decoded pointer to a decoded "system clock" descriptor
* structure
* \param b_duplicate if non zero then duplicate the p_decoded structure into
* the descriptor
* \return a pointer to a new descriptor structure which contains encoded data.
*/
dvbpsi_descriptor_t * dvbpsi_GenMxBuffUtilizationDr(
dvbpsi_mx_buff_utilization_dr_t * p_decoded,
int b_duplicate);
#ifdef __cplusplus
};
#endif
#else
#error "Multiple inclusions of dr_0c.h"
#endif
/*****************************************************************************
* dr_0d.c
* (c)2001-2002 VideoLAN
* $Id: dr_0d.c,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../descriptor.h"
#include "dr_0d.h"
/*****************************************************************************
* dvbpsi_DecodeCopyrightDr
*****************************************************************************/
dvbpsi_copyright_dr_t * dvbpsi_DecodeCopyrightDr(
dvbpsi_descriptor_t * p_descriptor)
{
dvbpsi_copyright_dr_t * p_decoded;
/* Check the tag */
if(p_descriptor->i_tag != 0x0d)
{
DVBPSI_ERROR_ARG("dr_0d decoder", "bad tag (0x%x)", p_descriptor->i_tag);
return NULL;
}
/* Don't decode twice */
if(p_descriptor->p_decoded)
return p_descriptor->p_decoded;
/* Allocate memory */
p_decoded = (dvbpsi_copyright_dr_t*)
malloc(sizeof(dvbpsi_copyright_dr_t));
if(!p_decoded)
{
DVBPSI_ERROR("dr_0d decoder", "out of memory");
return NULL;
}
/* Decode data and check the length */
if(p_descriptor->i_length < 4)
{
DVBPSI_ERROR_ARG("dr_0c decoder", "bad length (%d)",
p_descriptor->i_length);
free(p_decoded);
}
p_decoded->i_copyright_identifier =
((uint32_t)(p_descriptor->p_data[0]) << 24)
| ((uint32_t)(p_descriptor->p_data[1]) << 16)
| ((uint32_t)(p_descriptor->p_data[2]) << 8)
| (uint32_t)(p_descriptor->p_data[3]);
p_decoded->i_additional_length = p_descriptor->i_length - 4;
if(p_decoded->i_additional_length)
memcpy(p_decoded->i_additional_info,
p_descriptor->p_data + 4,
p_decoded->i_additional_length);
p_descriptor->p_decoded = (void*)p_decoded;
return p_decoded;
}
/*****************************************************************************
* dvbpsi_GenCopyrightDr
*****************************************************************************/
dvbpsi_descriptor_t * dvbpsi_GenCopyrightDr(
dvbpsi_copyright_dr_t * p_decoded,
int b_duplicate)
{
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x0d, p_decoded->i_additional_length + 4, NULL);
if(p_descriptor)
{
/* Encode data */
p_descriptor->p_data[0] = p_decoded->i_copyright_identifier >> 24;
p_descriptor->p_data[1] = p_decoded->i_copyright_identifier >> 16;
p_descriptor->p_data[2] = p_decoded->i_copyright_identifier >> 8;
p_descriptor->p_data[3] = p_decoded->i_copyright_identifier;
if(p_decoded->i_additional_length)
memcpy(p_descriptor->p_data + 4,
p_decoded->i_additional_info,
p_decoded->i_additional_length);
if(b_duplicate)
{
/* Duplicate decoded data */
dvbpsi_copyright_dr_t * p_dup_decoded =
(dvbpsi_copyright_dr_t*)malloc(sizeof(dvbpsi_copyright_dr_t));
if(p_dup_decoded)
memcpy(p_dup_decoded, p_decoded, sizeof(dvbpsi_copyright_dr_t));
p_descriptor->p_decoded = (void*)p_dup_decoded;
}
}
return p_descriptor;
}
/*****************************************************************************
* dr_0d.h
* (c)2001-2002 VideoLAN
* $Id: dr_0d.h,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
/*!
* \file <dr_0d.h>
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the MPEG 2 "copyright" descriptor
* decoder and generator.
*
* Application interface for the MPEG 2 "copyright" descriptor
* decoder and generator. This descriptor's definition can be found in
* ISO/IEC 13818-1 section 2.6.24.
*/
#ifndef _DVBPSI_DR_0D_H_
#define _DVBPSI_DR_0D_H_
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_copyright_dr_t
*****************************************************************************/
/*!
* \struct dvbpsi_copyright_dr_s
* \brief "copyright" descriptor structure.
*
* This structure is used to store a decoded "copyright" descriptor.
* (ISO/IEC 13818-1 section 2.6.24).
*/
/*!
* \typedef struct dvbpsi_copyright_dr_s dvbpsi_copyright_dr_t
* \brief dvbpsi_copyright_dr_t type definition.
*/
typedef struct dvbpsi_copyright_dr_s
{
uint32_t i_copyright_identifier; /*!< copyright_identifier */
uint8_t i_additional_length; /*!< length of the i_additional_info
array */
uint8_t i_additional_info[251]; /*!< additional_copyright_info */
} dvbpsi_copyright_dr_t;
/*****************************************************************************
* dvbpsi_DecodeCopyrightDr
*****************************************************************************/
/*!
* \fn dvbpsi_copyright_dr_t * dvbpsi_DecodeCopyrightDr(
* dvbpsi_descriptor_t * p_descriptor)
* \brief "copyright" descriptor decoder.
* \param p_descriptor pointer to the descriptor structure
* \return a pointer to a new "copyright" descriptor structure which
* contains the decoded data.
*/
dvbpsi_copyright_dr_t* dvbpsi_DecodeCopyrightDr(
dvbpsi_descriptor_t * p_descriptor);
/*****************************************************************************
* dvbpsi_GenCopyrightDr
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t * dvbpsi_GenCopyrightDr(
* dvbpsi_copyright_dr_t * p_decoded, int b_duplicate)
* \brief "copyright" descriptor generator.
* \param p_decoded pointer to a decoded "copyright" descriptor structure
* \param b_duplicate if non zero then duplicate the p_decoded structure into
* the descriptor
* \return a pointer to a new descriptor structure which contains encoded data.
*/
dvbpsi_descriptor_t * dvbpsi_GenCopyrightDr(
dvbpsi_copyright_dr_t * p_decoded,
int b_duplicate);
#ifdef __cplusplus
};
#endif
#else
#error "Multiple inclusions of dr_0d.h"
#endif
/*****************************************************************************
* dr_0e.c
* (c)2001-2002 VideoLAN
* $Id: dr_0e.c,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../descriptor.h"
#include "dr_0e.h"
/*****************************************************************************
* dvbpsi_DecodeMaxBitrateDr
*****************************************************************************/
dvbpsi_max_bitrate_dr_t * dvbpsi_DecodeMaxBitrateDr(
dvbpsi_descriptor_t * p_descriptor)
{
dvbpsi_max_bitrate_dr_t * p_decoded;
/* Check the tag */
if(p_descriptor->i_tag != 0x0e)
{
DVBPSI_ERROR_ARG("dr_0e decoder", "bad tag (0x%x)", p_descriptor->i_tag);
return NULL;
}
/* Don't decode twice */
if(p_descriptor->p_decoded)
return p_descriptor->p_decoded;
/* Allocate memory */
p_decoded = (dvbpsi_max_bitrate_dr_t*)malloc(sizeof(dvbpsi_max_bitrate_dr_t));
if(!p_decoded)
{
DVBPSI_ERROR("dr_0e decoder", "out of memory");
return NULL;
}
/* Decode data and check the length */
if(p_descriptor->i_length != 3)
{
DVBPSI_ERROR_ARG("dr_0e decoder", "bad length (%d)",
p_descriptor->i_length);
free(p_decoded);
}
p_decoded->i_max_bitrate =
((uint32_t)(p_descriptor->p_data[0] & 0x3f) << 16)
| ((uint32_t)(p_descriptor->p_data[1]) << 8)
| p_descriptor->p_data[2];
p_descriptor->p_decoded = (void*)p_decoded;
return p_decoded;
}
/*****************************************************************************
* dvbpsi_GenMaxBitrateDr
*****************************************************************************/
dvbpsi_descriptor_t * dvbpsi_GenMaxBitrateDr(
dvbpsi_max_bitrate_dr_t * p_decoded,
int b_duplicate)
{
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x0e, 3, NULL);
if(p_descriptor)
{
/* Encode data */
p_descriptor->p_data[0] = 0xc0 | ((p_decoded->i_max_bitrate >> 16) & 0x3f);
p_descriptor->p_data[1] = p_decoded->i_max_bitrate >> 8;
p_descriptor->p_data[2] = p_decoded->i_max_bitrate;
if(b_duplicate)
{
/* Duplicate decoded data */
dvbpsi_max_bitrate_dr_t * p_dup_decoded =
(dvbpsi_max_bitrate_dr_t*)malloc(sizeof(dvbpsi_max_bitrate_dr_t));
if(p_dup_decoded)
memcpy(p_dup_decoded, p_decoded, sizeof(dvbpsi_max_bitrate_dr_t));
p_descriptor->p_decoded = (void*)p_dup_decoded;
}
}
return p_descriptor;
}
/*****************************************************************************
* dr_0e.h
* (c)2001-2002 VideoLAN
* $Id: dr_0e.h,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
/*!
* \file <dr_0e.h>
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the MPEG 2 "maximum bitrate" descriptor
* decoder and generator.
*
* Application interface for the MPEG 2 "maximum bitrate" descriptor
* decoder and generator. This descriptor's definition can be found in
* ISO/IEC 13818-1 section 2.6.26.
*/
#ifndef _DVBPSI_DR_0E_H_
#define _DVBPSI_DR_0E_H_
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_max_bitrate_dr_t
*****************************************************************************/
/*!
* \struct dvbpsi_max_bitrate_dr_s
* \brief "maximum bitrate" descriptor structure.
*
* This structure is used to store a decoded "maximum bitrate" descriptor.
* (ISO/IEC 13818-1 section 2.6.26).
*/
/*!
* \typedef struct dvbpsi_max_bitrate_dr_s dvbpsi_max_bitrate_dr_t
* \brief dvbpsi_max_bitrate_dr_t type definition.
*/
typedef struct dvbpsi_max_bitrate_dr_s
{
uint32_t i_max_bitrate; /*!< maximum_bitrate */
} dvbpsi_max_bitrate_dr_t;
/*****************************************************************************
* dvbpsi_DecodeMaxBitrateDr
*****************************************************************************/
/*!
* \fn dvbpsi_max_bitrate_dr_t * dvbpsi_DecodeMaxBitrateDr(
* dvbpsi_descriptor_t * p_descriptor)
* \brief "maximum bitrate" descriptor decoder.
* \param p_descriptor pointer to the descriptor structure
* \return a pointer to a new "maximum bitrate" descriptor structure which
* contains the decoded data.
*/
dvbpsi_max_bitrate_dr_t* dvbpsi_DecodeMaxBitrateDr(
dvbpsi_descriptor_t * p_descriptor);
/*****************************************************************************
* dvbpsi_GenMaxBitrateDr
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t * dvbpsi_GenMaxBitrateDr(
* dvbpsi_max_bitrate_dr_t * p_decoded, int b_duplicate)
* \brief "maximum bitrate" descriptor generator.
* \param p_decoded pointer to a decoded "maximum bitrate" descriptor structure
* \param b_duplicate if non zero then duplicate the p_decoded structure into
* the descriptor
* \return a pointer to a new descriptor structure which contains encoded data.
*/
dvbpsi_descriptor_t * dvbpsi_GenMaxBitrateDr(
dvbpsi_max_bitrate_dr_t * p_decoded,
int b_duplicate);
#ifdef __cplusplus
};
#endif
#else
#error "Multiple inclusions of dr_0e.h"
#endif
/*****************************************************************************
* dr_0f.c
* (c)2001-2002 VideoLAN
* $Id: dr_0f.c,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../descriptor.h"
#include "dr_0f.h"
/*****************************************************************************
* dvbpsi_DecodePrivateDataDr
*****************************************************************************/
dvbpsi_private_data_dr_t * dvbpsi_DecodePrivateDataDr(
dvbpsi_descriptor_t * p_descriptor)
{
dvbpsi_private_data_dr_t * p_decoded;
/* Check the tag */
if(p_descriptor->i_tag != 0x0f)
{
DVBPSI_ERROR_ARG("dr_0f decoder", "bad tag (0x%x)", p_descriptor->i_tag);
return NULL;
}
/* Don't decode twice */
if(p_descriptor->p_decoded)
return p_descriptor->p_decoded;
/* Allocate memory */
p_decoded =
(dvbpsi_private_data_dr_t*)malloc(sizeof(dvbpsi_private_data_dr_t));
if(!p_decoded)
{
DVBPSI_ERROR("dr_0f decoder", "out of memory");
return NULL;
}
/* Decode data and check the length */
if(p_descriptor->i_length != 4)
{
DVBPSI_ERROR_ARG("dr_0f decoder", "bad length (%d)",
p_descriptor->i_length);
free(p_decoded);
}
p_decoded->i_private_data = ((uint32_t)(p_descriptor->p_data[0]) << 24)
| ((uint32_t)(p_descriptor->p_data[1]) << 16)
| ((uint32_t)(p_descriptor->p_data[2]) << 8)
| p_descriptor->p_data[3];
p_descriptor->p_decoded = (void*)p_decoded;
return p_decoded;
}
/*****************************************************************************
* dvbpsi_GenPrivateDataDr
*****************************************************************************/
dvbpsi_descriptor_t * dvbpsi_GenPrivateDataDr(
dvbpsi_private_data_dr_t * p_decoded,
int b_duplicate)
{
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x0f, 4, NULL);
if(p_descriptor)
{
/* Encode data */
p_descriptor->p_data[0] = p_decoded->i_private_data >> 24;
p_descriptor->p_data[1] = p_decoded->i_private_data >> 16;
p_descriptor->p_data[2] = p_decoded->i_private_data >> 8;
p_descriptor->p_data[3] = p_decoded->i_private_data;
if(b_duplicate)
{
/* Duplicate decoded data */
dvbpsi_private_data_dr_t * p_dup_decoded =
(dvbpsi_private_data_dr_t*)malloc(sizeof(dvbpsi_private_data_dr_t));
if(p_dup_decoded)
memcpy(p_dup_decoded, p_decoded, sizeof(dvbpsi_private_data_dr_t));
p_descriptor->p_decoded = (void*)p_dup_decoded;
}
}
return p_descriptor;
}
/*****************************************************************************
* dr_0f.h
* (c)2001-2002 VideoLAN
* $Id: dr_0f.h,v 1.1 2002/05/10 22:58:53 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*****************************************************************************/
/*!
* \file <dr_0f.h>
* \author Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* \brief Application interface for the MPEG 2 "private data indicator"
* descriptor decoder and generator.
*
* Application interface for the MPEG 2 "private data indicator" descriptor
* decoder and generator. This descriptor's definition can be found in
* ISO/IEC 13818-1 section 2.6.28.
*/
#ifndef _DVBPSI_DR_0F_H_
#define _DVBPSI_DR_0F_H_
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_private_data_dr_t
*****************************************************************************/
/*!
* \struct dvbpsi_private_data_dr_s
* \brief "private data indicator" descriptor structure.
*
* This structure is used to store a decoded "private data indicator"
* descriptor. (ISO/IEC 13818-1 section 2.6.28).
*/
/*!
* \typedef struct dvbpsi_private_data_dr_s dvbpsi_private_data_dr_t
* \brief dvbpsi_private_data_dr_t type definition.
*/
typedef struct dvbpsi_private_data_dr_s
{
uint32_t i_private_data; /*!< private_data_indicator */
} dvbpsi_private_data_dr_t;
/*****************************************************************************
* dvbpsi_DecodePrivateDataDr
*****************************************************************************/
/*!
* \fn dvbpsi_private_data_dr_t * dvbpsi_DecodePrivateDataDr(
* dvbpsi_descriptor_t * p_descriptor)
* \brief "private data indicator" descriptor decoder.
* \param p_descriptor pointer to the descriptor structure
* \return a pointer to a new "private data indicator" descriptor structure
* which contains the decoded data.
*/
dvbpsi_private_data_dr_t* dvbpsi_DecodePrivateDataDr(
dvbpsi_descriptor_t * p_descriptor);
/*****************************************************************************
* dvbpsi_GenPrivateDataDr
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t * dvbpsi_GenPrivateDataDr(
* dvbpsi_private_data_dr_t * p_decoded, int b_duplicate)
* \brief "private data indicator" descriptor generator.
* \param p_decoded pointer to a decoded "private data indicator" descriptor
* structure
* \param b_duplicate if non zero then duplicate the p_decoded structure into
* the descriptor
* \return a pointer to a new descriptor structure which contains encoded data.
*/
dvbpsi_descriptor_t * dvbpsi_GenPrivateDataDr(
dvbpsi_private_data_dr_t * p_decoded,
int b_duplicate);
#ifdef __cplusplus
};
#endif
#else
#error "Multiple inclusions of dr_0f.h"
#endif
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