Commit 0d969f66 authored by Michael Krufky's avatar Michael Krufky Committed by Jean-Paul Saman

add support for parsing extended channel name descriptor 0xA0

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
parent 47c32bb3
......@@ -69,6 +69,7 @@ pkginclude_HEADERS = dvbpsi.h psi.h descriptor.h demux.h \
descriptors/dr_83.h \
descriptors/dr_86.h \
descriptors/dr_8a.h \
descriptors/dr_a0.h \
descriptors/dr.h
descriptors_src = descriptors/dr_02.c \
......@@ -119,7 +120,8 @@ descriptors_src = descriptors/dr_02.c \
descriptors/dr_7c.c \
descriptors/dr_83.c \
descriptors/dr_86.c \
descriptors/dr_8a.c
descriptors/dr_8a.c \
descriptors/dr_a0.c
tables_src = tables/pat.c tables/pat_private.h \
tables/pmt.c tables/pmt_private.h \
......
/*
Copyright (C) 2013 Michael Krufky
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
dr_a0.c
Decode Extended Channel Name Descriptor.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
#elif defined(HAVE_STDINT_H)
#include <stdint.h>
#endif
#include "../dvbpsi.h"
#include "../dvbpsi_private.h"
#include "../descriptor.h"
#include "dr_a0.h"
/*****************************************************************************
* dvbpsi_ExtendedChannelNameDr
*****************************************************************************/
dvbpsi_extended_channel_name_dr_t *dvbpsi_ExtendedChannelNameDr(dvbpsi_descriptor_t *p_descriptor)
{
dvbpsi_extended_channel_name_dr_t *p_decoded;
/* Check the tag */
if (p_descriptor->i_tag != 0xA0)
return NULL;
/* Don't decode twice */
if (p_descriptor->p_decoded)
return p_descriptor->p_decoded;
/* Check length */
if (!p_descriptor->i_length)
return NULL;
p_decoded = (dvbpsi_extended_channel_name_dr_t*)malloc(sizeof(dvbpsi_extended_channel_name_dr_t));
if (!p_decoded)
return NULL;
p_descriptor->p_decoded = (void*)p_decoded;
p_decoded->i_long_channel_name_length = p_descriptor->i_length;
memcpy(p_decoded->i_long_channel_name, p_descriptor->p_data, p_descriptor->i_length);
return p_decoded;
}
/*
Copyright (C) 2013 Michael Krufky
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
dr_a0.h
Decode Extended Channel Name Descriptor.
*/
/*!
* \file dr_a0.h
* \author Michael Krufky
* \brief Decode Extended Channel Name Descriptor.
*/
#ifndef _DR_A0_H
#define _DR_A0_H
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_extended_channel_name_dr_s
*****************************************************************************/
/*!
* \struct dvbpsi_extended_channel_name_dr_s
* \brief Extended Channel Name Descriptor
*
* This structure is used to store a decoded Extended Channel Name descriptor.
*/
/*!
* \typedef struct dvbpsi_extended_channel_name_dr_s dvbpsi_extended_channel_name_dr_t
* \brief dvbpsi_extended_channel_name_dr_t type definition.
*/
typedef struct dvbpsi_extended_channel_name_dr_s
{
uint8_t i_long_channel_name_length; /*!< Length in bytes */
uint8_t i_long_channel_name[256]; /*!< multiple string structure format. */
}dvbpsi_extended_channel_name_dr_t;
/*****************************************************************************
* dvbpsi_ExtendedChannelNameDr
*****************************************************************************/
/*!
* \fn dvbpsi_extended_channel_name_dr_t dvbpsi_ExtendedChannelNameDr(dvbpsi_descriptor_t *p_descriptor)
* \brief Decode a Extended Channel Name descriptor (tag 0xA0)
* \param p_descriptor Raw descriptor to decode.
* \return NULL if the descriptor could not be decoded or a pointer to a
* dvbpsi_extended_channel_name_dr_t structure.
*/
dvbpsi_extended_channel_name_dr_t *dvbpsi_ExtendedChannelNameDr(dvbpsi_descriptor_t *p_descriptor);
#ifdef __cplusplus
}
#endif
#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