Commit 1ee3ed01 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Add AAC Audio descriptor 0x7c

Decode AAC Audio descriptor 0x7c and identify profile, level and type.
parent 6083a0de
......@@ -59,6 +59,7 @@ pkginclude_HEADERS = dvbpsi.h psi.h descriptor.h demux.h \
descriptors/dr_69.h \
descriptors/dr_73.h \
descriptors/dr_76.h \
descriptors/dr_7c.h \
descriptors/dr_83.h \
descriptors/dr_8a.h \
descriptors/dr.h
......@@ -102,6 +103,7 @@ descriptors_src = descriptors/dr_02.c \
descriptors/dr_69.c \
descriptors/dr_73.c \
descriptors/dr_76.c \
descriptors/dr_7c.c \
descriptors/dr_83.c \
descriptors/dr_8a.c
......
......@@ -69,6 +69,7 @@
#include "dr_62.h"
#include "dr_66.h"
#include "dr_69.h"
#include "dr_7c.h"
#include "dr_73.h"
#include "dr_76.h"
#include "dr_83.h"
......
/*****************************************************************************
* dr_7c.c
* 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
*
*****************************************************************************/
#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_7c.h"
/* */
struct dvbpsi_aac_profile_and_level_table_s
{
uint8_t hex;
dvbpsi_aac_profile_and_level_t profile_and_level;
};
static struct dvbpsi_aac_profile_and_level_table_s aac_profile_and_level_table[] =
{
{ 0x00, DVBPSI_AAC_PROFILE_RESERVED },
/* 0x00-0x0F Reserved */
{ 0x10, DVBPSI_AAC_PROFILE_MAIN_LEVEL_1 },
{ 0x11, DVBPSI_AAC_PROFILE_MAIN_LEVEL_2 },
{ 0x12, DVBPSI_AAC_PROFILE_MAIN_LEVEL_3 },
{ 0x13, DVBPSI_AAC_PROFILE_MAIN_LEVEL_4 },
/* 0x14-0x17 Reserved */
{ 0x18, DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_1 },
{ 0x19, DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_2 },
{ 0x1A, DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_3 },
{ 0x1B, DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_4 },
/* 0x1C-0x1F Reserved */
{ 0x20, DVBPSI_AAC_PROFILE_SPEECH_LEVEL_1 },
{ 0x21, DVBPSI_AAC_PROFILE_SPEECH_LEVEL_2 },
/* 0x22-0x27 Reserved */
{ 0x28, DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_1 },
{ 0x29, DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_2 },
{ 0x2A, DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_3 },
/* 0x2B-0x2F Reserved */
{ 0x30, DVBPSI_AAC_PROFILE_HQ_LEVEL_1 },
{ 0x31, DVBPSI_AAC_PROFILE_HQ_LEVEL_2 },
{ 0x32, DVBPSI_AAC_PROFILE_HQ_LEVEL_3 },
{ 0x33, DVBPSI_AAC_PROFILE_HQ_LEVEL_4 },
{ 0x34, DVBPSI_AAC_PROFILE_HQ_LEVEL_5 },
{ 0x35, DVBPSI_AAC_PROFILE_HQ_LEVEL_6 },
{ 0x36, DVBPSI_AAC_PROFILE_HQ_LEVEL_7 },
{ 0x37, DVBPSI_AAC_PROFILE_HQ_LEVEL_8 },
{ 0x38, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_1 },
{ 0x39, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_2 },
{ 0x3A, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_3 },
{ 0x3B, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_4 },
{ 0x3C, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_5 },
{ 0x3D, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_6 },
{ 0x3E, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_7 },
{ 0x3F, DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_8 },
{ 0x40, DVBPSI_AAC_PROFILE_NATURAL_LEVEL_1 },
{ 0x41, DVBPSI_AAC_PROFILE_NATURAL_LEVEL_2 },
{ 0x42, DVBPSI_AAC_PROFILE_NATURAL_LEVEL_3 },
{ 0x43, DVBPSI_AAC_PROFILE_NATURAL_LEVEL_4 },
/* 0x44-0x47 Reserved */
{ 0x48, DVBPSI_AAC_PROFILE_MOBILE_LEVEL_1 },
{ 0x49, DVBPSI_AAC_PROFILE_MOBILE_LEVEL_2 },
{ 0x4A, DVBPSI_AAC_PROFILE_MOBILE_LEVEL_3 },
{ 0x4B, DVBPSI_AAC_PROFILE_MOBILE_LEVEL_4 },
{ 0x4C, DVBPSI_AAC_PROFILE_MOBILE_LEVEL_5 },
{ 0x4D, DVBPSI_AAC_PROFILE_MOBILE_LEVEL_6 },
/* 0x4E-0x4F Reserved */
{ 0x50, DVBPSI_AAC_PROFILE_LEVEL_1 },
{ 0x51, DVBPSI_AAC_PROFILE_LEVEL_2 },
{ 0x52, DVBPSI_AAC_PROFILE_LEVEL_4 },
{ 0x53, DVBPSI_AAC_PROFILE_LEVEL_5 },
/* 0x54-0x57 RESERVED */
{ 0x58, DVBPSI_HE_AAC_PROFILE_LEVEL_2 },
{ 0x59, DVBPSI_HE_AAC_PROFILE_LEVEL_3 },
{ 0x5A, DVBPSI_HE_AAC_PROFILE_LEVEL_4 },
{ 0x5B, DVBPSI_HE_AAC_PROFILE_LEVEL_5 }
/* 0x5C-0xFF RESERVED */
};
static dvbpsi_aac_profile_and_level_t dvbpsi_aac_profile_and_level_lookup(const uint8_t value)
{
dvbpsi_aac_profile_and_level_t profile_and_level = DVBPSI_AAC_PROFILE_RESERVED;
for (unsigned int i = 0; i < ARRAY_SIZE(aac_profile_and_level_table); i++)
{
if (aac_profile_and_level_table[i].hex == value)
profile_and_level = aac_profile_and_level_table[i].profile_and_level;
}
return profile_and_level;
}
static uint8_t dvbpsi_aac_profile_and_level_to_hex(const dvbpsi_aac_profile_and_level_t profile_and_level)
{
uint8_t value = 0x00; /* Reserved */
if (profile_and_level == DVBPSI_AAC_PROFILE_RESERVED)
value = 0x56; /* FIXME: levels 0x56..0x57 and 0x5C..0xFF are mapped onto 0x56 here */
else
{
for (unsigned int i = 0; i < ARRAY_SIZE(aac_profile_and_level_table); i++)
{
if (aac_profile_and_level_table[i].profile_and_level == profile_and_level)
value = aac_profile_and_level_table[i].hex;
}
}
return value;
}
/* */
struct dvbpsi_aac_type_table_s
{
uint8_t hex;
dvbpsi_aac_type_t type;
};
static struct dvbpsi_aac_type_table_s aac_type_table[] =
{
{ 0x00, DVBPSI_AAC_RESERVED0 },
{ 0x01, DVBPSI_HE_AAC_MONO },
{ 0x02, DVBPSI_AAC_RESERVED1 },
{ 0x03, DVBPSI_HE_AAC_STEREO },
{ 0x04, DVBPSI_AAC_RESERVED2 },
{ 0x05, DVBPSI_HE_AAC_SURROUND },
{ 0x40, DVBPSI_HE_AAC_IMPAIRED },
{ 0x41, DVBPSI_HE_AAC_HEARING },
{ 0x42, DVBPSI_HE_AAC_MIXED },
{ 0x43, DVBPSI_HE_AAC_V2_STEREO },
{ 0x44, DVBPSI_HE_AAC_V2_IMPAIRED },
{ 0x45, DVBPSI_HE_AAC_V2_HEARING },
{ 0x46, DVBPSI_HE_AAC_V2_MIXED },
{ 0x47, DVBPSI_HE_AAC_MIXED_IMPAIRED },
{ 0x48, DVBPSI_HE_AAC_BROADCAST_MIXED_IMPAIRED },
{ 0x49, DVBPSI_HE_AAC_V2_MIXED_IMPAIRED },
{ 0x4A, DVBPSI_HE_AAC_V2_BROADCAST_MIXED_IMPAIRED }
};
static dvbpsi_aac_type_t dvbpsi_aac_type_lookup(const uint8_t value)
{
dvbpsi_aac_type_t type = 0;
if ((value >= 0x06) && (value <= 0x3F))
type = DVBPSI_AAC_RESERVED3;
else if ((value >= 0x4B) && (value <= 0xAF))
type = DVBPSI_AAC_RESERVED4;
else if ((value >= 0xB0) && (value <= 0xFE))
type = DVBPSI_AAC_USER;
else if (value == 0xFF)
type = DVBPSI_AAC_RESERVED5;
else
{
for (unsigned int i = 0; i < ARRAY_SIZE(aac_type_table); i++)
{
if (aac_type_table[i].hex == value)
type = aac_type_table[i].type;
}
}
return type;
}
static uint8_t dvbpsi_aac_type_to_hex(const dvbpsi_aac_type_t type)
{
uint8_t value = 0;
if (type == DVBPSI_AAC_RESERVED3)
value = 0x06; /* FIXME: 0x06..0x3F */
else if (type == DVBPSI_AAC_RESERVED4)
value = 0x4B; /* FIXME: 0x4B..0xAF */
else if (type == DVBPSI_AAC_USER)
value = 0xB0; /* FIXME: 0xB0..0xFE */
else if (type == DVBPSI_AAC_RESERVED5)
value = 0xFF;
else
{
for (unsigned int i = 0; i < ARRAY_SIZE(aac_type_table); i++)
{
if (aac_type_table[i].type == type)
value = aac_type_table[i].hex;
}
}
return value;
}
/*****************************************************************************
* dvbpsi_DecodeAACDr
*****************************************************************************/
dvbpsi_aac_dr_t *dvbpsi_DecodeAACDr(dvbpsi_descriptor_t *p_descriptor)
{
/* Check the tag */
if (!dvbpsi_CanDecodeAsDescriptor(p_descriptor, 0x7c))
return NULL;
/* Don't decode twice */
if (dvbpsi_IsDescriptorDecoded(p_descriptor))
return p_descriptor->p_decoded;
if (p_descriptor->i_length == 0x01)
return NULL;
/* Allocate memory */
dvbpsi_aac_dr_t *p_decoded;
p_decoded = (dvbpsi_aac_dr_t*)calloc(1, sizeof(dvbpsi_aac_dr_t));
if (!p_decoded)
return NULL;
/* AAC Audio descriptor
* ETSI EN 300 468 V1.13.1 (2012-04) Annex H
*/
p_decoded->i_profile_and_level = dvbpsi_aac_profile_and_level_lookup(p_descriptor->p_data[0]);
if (p_descriptor->i_length > 1)
p_decoded->b_type = ((p_descriptor->p_data[1]>>7) == 0x01);
if (p_decoded->b_type)
p_decoded->i_type = dvbpsi_aac_type_lookup(p_descriptor->p_data[2]);
/* Keep additional info bytes field */
if (p_descriptor->i_length > 1)
{
uint8_t i_info_length = p_descriptor->i_length - p_decoded->b_type ? 3 : 2;
dvbpsi_aac_dr_t *p_tmp = realloc(p_decoded, sizeof(dvbpsi_aac_dr_t) + i_info_length);
if (!p_tmp)
{
free(p_decoded);
return NULL;
}
p_decoded->p_additional_info = ((uint8_t*)p_tmp + sizeof(dvbpsi_aac_dr_t));
p_decoded->i_additional_info_length = i_info_length;
uint8_t i_data = p_decoded->b_type ? 3 : 2;
uint8_t *p = &p_descriptor->p_data[i_data];
memcpy(&p_decoded->p_additional_info, p, i_info_length);
}
p_descriptor->p_decoded = (void*)p_decoded;
return p_decoded;
}
/*****************************************************************************
* dvbpsi_GenAACDr
*****************************************************************************/
dvbpsi_descriptor_t *dvbpsi_GenAACDr(dvbpsi_aac_dr_t *p_decoded, bool b_duplicate)
{
/* Create the descriptor */
uint8_t i_length = p_decoded->b_type ? 3 + p_decoded->i_additional_info_length : 1;
dvbpsi_descriptor_t *p_descriptor = dvbpsi_NewDescriptor(0x7c, i_length, NULL);
if (!p_descriptor)
return NULL;
/* Encode data */
p_descriptor->p_data[0] = dvbpsi_aac_profile_and_level_to_hex(p_decoded->i_profile_and_level);
if (p_descriptor->i_length > 1)
{
p_descriptor->p_data[1] = 0x00;
p_descriptor->p_data[1] |= ((p_decoded->b_type ? 1: 0) << 7);
}
if (p_decoded->b_type)
p_descriptor->p_data[2] = dvbpsi_aac_type_to_hex(p_decoded->i_type);
/* Store additional info bytes field */
if (p_descriptor->i_length > 1)
{
uint8_t *p = &p_descriptor->p_data[p_decoded->b_type ? 3 : 2];
memcpy(&p, p_decoded->p_additional_info, p_decoded->i_additional_info_length);
}
if (b_duplicate)
{
/* Duplicate decoded data */
p_descriptor->p_decoded =
dvbpsi_DuplicateDecodedDescriptor(p_descriptor->p_decoded,
sizeof(dvbpsi_aac_dr_t));
}
return p_descriptor;
}
/*****************************************************************************
* dr_7c.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
*
*****************************************************************************/
/*!
* \file <dr_7c.h>
* \author Jean-Paul Saman <jpsaman@videolan.org>
* \brief AAC Audio descriptor
*
* AAC Audio descriptor parsing, according to
* ETSI EN 300 468 V1.13.1 (2012-04) Annex H
*/
#ifndef _DVBPSI_DR_7C_H_
#define _DVBPSI_DR_7c_H_
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************
* dvbpsi_aac_dr_t
*****************************************************************************/
/*!
* \struct dvbpsi_aac_dr_s
* \brief "AAC Audio" descriptor structure.
*
* The AAC Audio descriptor is used to label the PIDs that carry AAC audio data.
*/
/*!
* \typedef enum dvbpsi_aac_profile_and_level_s dvbpsi_aac_profile_and_level_t
* \brief AAC profile and level as specified in ISO/IEC 13818-1:2007 table 2.71
value description
===== ===========
0x00-0x0F Reserved
0x10 Main profile, level 1
0x11 Main profile, level 2
0x12 Main profile, level 3
0x13 Main profile, level 4
0x14-0x17 Reserved
0x18 Scalable Profile, level 1
0x19 Scalable Profile, level 2
0x1A Scalable Profile, level 3
0x1B Scalable Profile, level 4
0x1C-0x1F Reserved
0x20 Speech profile, level 1
0x21 Speech profile, level 2
0x22-0x27 Reserved
0x28 Synthesis profile, level 1
0x29 Synthesis profile, level 2
0x2A Synthesis profile, level 3
0x2B-0x2F Reserved
0x30 High quality audio profile, level 1
0x31 High quality audio profile, level 2
0x32 High quality audio profile, level 3
0x33 High quality audio profile, level 4
0x34 High quality audio profile, level 5
0x35 High quality audio profile, level 6
0x36 High quality audio profile, level 7
0x37 High quality audio profile, level 8
0x38 Low delay audio profile, level 1
0x39 Low delay audio profile, level 2
0x3A Low delay audio profile, level 3
0x3B Low delay audio profile, level 4
0x3C Low delay audio profile, level 5
0x3D Low delay audio profile, level 6
0x3E Low delay audio profile, level 7
0x3F Low delay audio profile, level 8
0x40 Natural audio profile, level 1
0x41 Natural audio profile, level 2
0x42 Natural audio profile, level 3
0x43 Natural audio profile, level 4
0x44-0x47 Reserved
0x48 Mobile audio internetworking profile, level 1
0x49 Mobile audio internetworking profile, level 2
0x4A Mobile audio internetworking profile, level 3
0x4B Mobile audio internetworking profile, level 4
0x4C Mobile audio internetworking profile, level 5
0x4D Mobile audio internetworking profile, level 6
0x4E-0x4F Reserved
0x50 AAC profile, level 1
0x51 AAC profile, level 2
0x52 AAC profile, level 4
0x53 AAC profile, level 5
0x54-0x57 Reserved
0x58 High efficiency AAC profile, level 2
0x59 High efficiency AAC profile, level 3
0x5A High efficiency AAC profile, level 4
0x5B High efficiency AAC profile, level 5
0x5C-0xFF Reserved
*/
typedef enum dvbpsi_aac_profile_and_level_s
{
DVBPSI_AAC_PROFILE_RESERVED = 0x00, /* 0x00-0x0F Reserved */
DVBPSI_AAC_PROFILE_MAIN_LEVEL_1 = 0x10,
DVBPSI_AAC_PROFILE_MAIN_LEVEL_2 = 0x11,
DVBPSI_AAC_PROFILE_MAIN_LEVEL_3 = 0x12,
DVBPSI_AAC_PROFILE_MAIN_LEVEL_4 = 0x13,
/* 0x14-0x17 Reserved */
DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_1 = 0x18,
DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_2 = 0x19,
DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_3 = 0x1A,
DVBPSI_AAC_PROFILE_SCALABLE_LEVEL_4 = 0x1B,
/* 0x1C-0x1F Reserved */
DVBPSI_AAC_PROFILE_SPEECH_LEVEL_1 = 0x20,
DVBPSI_AAC_PROFILE_SPEECH_LEVEL_2 = 0x21,
/* 0x22-0x27 Reserved */
DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_1 = 0x28,
DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_2 = 0x29,
DVBPSI_AAC_PROFILE_SYNTHESIS_LEVEL_3 = 0x2A,
/* 0x2B-0x2F Reserved */
DVBPSI_AAC_PROFILE_HQ_LEVEL_1 = 0x30,
DVBPSI_AAC_PROFILE_HQ_LEVEL_2 = 0x31,
DVBPSI_AAC_PROFILE_HQ_LEVEL_3 = 0x32,
DVBPSI_AAC_PROFILE_HQ_LEVEL_4 = 0x33,
DVBPSI_AAC_PROFILE_HQ_LEVEL_5 = 0x34,
DVBPSI_AAC_PROFILE_HQ_LEVEL_6 = 0x35,
DVBPSI_AAC_PROFILE_HQ_LEVEL_7 = 0x36,
DVBPSI_AAC_PROFILE_HQ_LEVEL_8 = 0x37,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_1 = 0x38,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_2 = 0x39,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_3 = 0x3A,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_4 = 0x3B,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_5 = 0x3C,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_6 = 0x3D,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_7 = 0x3E,
DVBPSI_AAC_PROFILE_LOW_DELAY_LEVEL_8 = 0x3F,
DVBPSI_AAC_PROFILE_NATURAL_LEVEL_1 = 0x40,
DVBPSI_AAC_PROFILE_NATURAL_LEVEL_2 = 0x41,
DVBPSI_AAC_PROFILE_NATURAL_LEVEL_3 = 0x42,
DVBPSI_AAC_PROFILE_NATURAL_LEVEL_4 = 0x43,
/* 0x44-0x47 Reserved */
DVBPSI_AAC_PROFILE_MOBILE_LEVEL_1 = 0x48,
DVBPSI_AAC_PROFILE_MOBILE_LEVEL_2 = 0x49,
DVBPSI_AAC_PROFILE_MOBILE_LEVEL_3 = 0x4A,
DVBPSI_AAC_PROFILE_MOBILE_LEVEL_4 = 0x4B,
DVBPSI_AAC_PROFILE_MOBILE_LEVEL_5 = 0x4C,
DVBPSI_AAC_PROFILE_MOBILE_LEVEL_6 = 0x4D,
/* 0x4E-0x4F Reserved */
DVBPSI_AAC_PROFILE_LEVEL_1 = 0x50,
DVBPSI_AAC_PROFILE_LEVEL_2 = 0x51,
DVBPSI_AAC_PROFILE_LEVEL_4 = 0x52,
DVBPSI_AAC_PROFILE_LEVEL_5 = 0x53,
/* 0x54-0x57 RESERVED */
DVBPSI_HE_AAC_PROFILE_LEVEL_2 = 0x58,
DVBPSI_HE_AAC_PROFILE_LEVEL_3 = 0x59,
DVBPSI_HE_AAC_PROFILE_LEVEL_4 = 0x5A,
DVBPSI_HE_AAC_PROFILE_LEVEL_5 = 0x5B
/* 0x5C-0xFF RESERVED */
} dvbpsi_aac_profile_and_level_t;
/*!
* \typedef enum dvbpsi_aac_type_s dvbpsi_aac_type_t
* \brief AAC type information as descripted in table 26, page 41 where column
* 'stream_content' has value 0x06. The following values are excepted:
type description
==== ======================
0x00 reserved for future use
0x01 HE-AAC audio, single mono channel
0x02 reserved for future use
0x03 HE-AAC audio, stereo
0x04 reserved for future use
0x05 HE-AAC audio, surround sound
0x06 to 0x3F reserved for future use
0x40 HE-AAC audio description for the visually impaired
0x41 HE-AAC audio for the hard of hearing
0x42 HE-AAC receiver-mixed supplementary audio as per annex E of TS 101 154
0x43 HE-AAC v2 audio, stereo
0x44 HE-AAC v2 audio description for the visually impaired
0x45 HE-AAC v2 audio for the hard of hearing
0x46 HE-AAC v2 receiver-mixed supplementary audio as per annex E of TS 101 154
0x47 HE-AAC receiver mix audio description for the visually impaired
0x48 HE-AAC broadcaster mix audio description for the visually impaired
0x49 HE-AAC v2 receiver mix audio description for the visually impaired
0x4A HE-AAC v2 broadcaster mix audio description for the visually impaired
0x4B to 0xAF reserved for future use
0xB0 to 0xFE user-defined
0xFF reserved for future use
*/
typedef enum dvbpsi_aac_type_s
{
DVBPSI_AAC_RESERVED0 = 0x00, /*!< reserved for future use */
DVBPSI_HE_AAC_MONO = 0x01, /*!< HE-AAC audio, single mono channel */
DVBPSI_AAC_RESERVED1 = 0x02, /*!< reserved for future use */
DVBPSI_HE_AAC_STEREO = 0x03, /*!< HE-AAC audio, stereo */
DVBPSI_AAC_RESERVED2 = 0x04, /*!< reserved for future use */
DVBPSI_HE_AAC_SURROUND = 0x05, /*!< HE-AAC audio, surround sound */
DVBPSI_AAC_RESERVED3 = 0x06, /*!< 0x06 to 0x3F reserved for future use */
DVBPSI_HE_AAC_IMPAIRED = 0x40, /*!< HE-AAC audio description for
the visually impaired */
DVBPSI_HE_AAC_HEARING = 0x41, /*!< HE-AAC audio for the hard of hearing */
DVBPSI_HE_AAC_MIXED = 0x42, /*!< HE-AAC receiver-mixed supplementary
audio as per annex E of TS 101 154 */
DVBPSI_HE_AAC_V2_STEREO = 0x43, /*!< HE-AAC v2 audio, stereo */
DVBPSI_HE_AAC_V2_IMPAIRED = 0x44, /*!< HE-AAC v2 audio description for the
visually impaired */
DVBPSI_HE_AAC_V2_HEARING = 0x45, /*!< HE-AAC v2 audio for the hard of hearing */
DVBPSI_HE_AAC_V2_MIXED = 0x46, /*!< HE-AAC v2 receiver-mixed supplementary
audio as per annex E of TS 101 154 */
DVBPSI_HE_AAC_MIXED_IMPAIRED = 0x47, /*!< HE-AAC receiver mix audio description
for the visually impaired */
DVBPSI_HE_AAC_BROADCAST_MIXED_IMPAIRED = 0x48, /*!< HE-AAC broadcaster mix
audio description for the visually impaired */
DVBPSI_HE_AAC_V2_MIXED_IMPAIRED = 0x49, /*!< HE-AAC v2 receiver mix audio
description for the visually impaired */
DVBPSI_HE_AAC_V2_BROADCAST_MIXED_IMPAIRED = 0x4A, /*!< HE-AAC v2 broadcaster
mix audio description for the visually impaired */
DVBPSI_AAC_RESERVED4 = 0x4B, /*!< to 0xAF reserved for future use */
DVBPSI_AAC_USER = 0xB0, /*!< to 0xFE user-defined */
DVBPSI_AAC_RESERVED5 = 0xFF /*!< reserved for future use */
} dvbpsi_aac_type_t;
/*!
* \typedef struct dvbpsi_aac_dr_s dvbpsi_aac_dr_t
* \brief dvbpsi_aac_dr_t type definition.
*/
typedef struct dvbpsi_aac_dr_s
{
dvbpsi_aac_profile_and_level_t i_profile_and_level;
/*!< Specifies the Profile and Level used in MPEG-4 AAC,
MPEG-4 HE AAC or MPEG-4 HE AAC v2 according to
table 2-71 in ISO/IEC 13818-1:2007/AMD1 [18]. */
bool b_type; /*!< Indicates presence of AAC type information. */
dvbpsi_aac_type_t i_type; /*!< AAC type information, @see enum dvbpsi_aac_type_t */
uint8_t i_additional_info_length; /*!< Length of additional info bytes fields */
uint8_t *p_additional_info; /*!< additional info bytes field. Memory is allocated
right after sizeof struct, when freeing this struct
the additional info bytes field is freed at the same time. */
} dvbpsi_aac_dr_t;
/*****************************************************************************
* dvbpsi_DecodeAACDr
*****************************************************************************/
/*!
* \fn dvbpsi_aac_dr_t * dvbpsi_DecodeAACDr(dvbpsi_descriptor_t * p_descriptor)
* \brief "AAC Audio" descriptor decoder.
* \param p_descriptor pointer to the descriptor structure
* \return a pointer to a new "AAC" descriptor structure
* which contains the decoded data.
*/
dvbpsi_aac_dr_t* dvbpsi_DecodeAACDr(dvbpsi_descriptor_t *p_descriptor);
/*****************************************************************************
* dvbpsi_GenAACDr
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t *dvbpsi_GenAACDr(dvbpsi_aac_dr_t *p_decoded, bool b_duplicate)
* \brief "AAC" descriptor generator.
* \param p_decoded pointer to a decoded "AAC" descriptor structure
* \param b_duplicate if true 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_GenAACDr(dvbpsi_aac_dr_t *p_decoded, bool b_duplicate);
#ifdef __cplusplus
};
#endif
#else
#error "Multiple inclusions of dr_7c.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