CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
宏定义 | 函数 | 变量
parse_m4a_atom_containers.c 文件参考

解析m4a格式头信息以获取aac解码需要的信息 更多...

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "parse_m4a_atom_containers_port.h"
#include "parse_m4a_atom_containers.h"
#include "romlib_runtime.h"
#include "ci_log.h"
#include "ci130x_system.h"

宏定义

#define USE_M4A_ATOM_PARSE_VERBOSE   0
 
#define BE16TOH(x)   (uint16_t)be16toh(*((uint16_t *)(x)))
 
#define BE32TOH(x)   (uint32_t)be32toh(*((uint32_t *)(x)))
 
#define ATOM_ITEMS   (sizeof(atomHasChild) / sizeof(atomHasChild[0]))
 
#define CMARK   0xA9
 
#define TAG_MAX_CNT   100
 

函数

static uint16_t be16toh (uint16_t value)
 
static uint32_t be32toh (uint32_t value)
 
static uint32_t getAtomSize (void *atom)
 转换字节序返回atom size 更多...
 
int collectMediaData (mem_file_t *fp, m4a_file_info_t *m4a_file_info, uint32_t parentAtomSize, uint32_t child)
 解析m4a容器 更多...
 
int32_t alloc_m4a_info (m4a_file_info_t *m4a_file_info)
 申请m4a容器解码器 更多...
 
int32_t free_m4a_info (m4a_file_info_t *m4a_file_info)
 销毁m4a容器解码器 更多...
 

变量

static uint8_t atomHasChild []
 
static const uint8_t atomTypeString [(sizeof(atomHasChild)/sizeof(atomHasChild[0]))][5]
 
static uint8_t atombuf [512]
 

详细描述

解析m4a格式头信息以获取aac解码需要的信息

版本
1.0
日期
2019-07-18

宏定义说明

◆ ATOM_ITEMS

#define ATOM_ITEMS   (sizeof(atomHasChild) / sizeof(atomHasChild[0]))

◆ BE16TOH

#define BE16TOH (   x)    (uint16_t)be16toh(*((uint16_t *)(x)))

◆ BE32TOH

#define BE32TOH (   x)    (uint32_t)be32toh(*((uint32_t *)(x)))

◆ CMARK

#define CMARK   0xA9

◆ TAG_MAX_CNT

#define TAG_MAX_CNT   100

◆ USE_M4A_ATOM_PARSE_VERBOSE

#define USE_M4A_ATOM_PARSE_VERBOSE   0

函数说明

◆ alloc_m4a_info()

int32_t alloc_m4a_info ( m4a_file_info_t m4a_file_info)

申请m4a容器解码器

参数
m4a_file_infom4a容器解码器
返回值
RETURN_OK申请成功
RETURN_ERR申请失败

◆ be16toh()

static uint16_t be16toh ( uint16_t  value)
static

◆ be32toh()

static uint32_t be32toh ( uint32_t  value)
static

◆ collectMediaData()

int collectMediaData ( mem_file_t fp,
m4a_file_info_t m4a_file_info,
uint32_t  parentAtomSize,
uint32_t  child 
)

解析m4a容器

参数
fp数据读取描述符
m4a_file_infom4a容器解码器
parentAtomSize文件大小
childatom节点
返回值
RETURN_OK播放启动成功
RETURN_ERR播放启动失败

◆ free_m4a_info()

int32_t free_m4a_info ( m4a_file_info_t m4a_file_info)

销毁m4a容器解码器

参数
m4a_file_infom4a容器解码器
返回值
RETURN_OK销毁成功
RETURN_ERR销毁失败

◆ getAtomSize()

static uint32_t getAtomSize ( void *  atom)
inlinestatic

转换字节序返回atom size

参数
atombuff地址
返回
uint32_t atom值

变量说明

◆ atombuf

uint8_t atombuf[512]
static

◆ atomHasChild

uint8_t atomHasChild[]
static
初始值:
=
{
0, 0, 0, 1, 0, 1,
0, 1, 0, 0, 0, 1,
0, 1, 0 ,0, 1, 0,
0, 1, 0, 1, 0, 0,
0, 0, 0, 1, 0, 0,
1, 0, 0, 1, 0, 0,
1, 1, 1, 1, 1, 1,
0,
0, 0,
0, 0,
0, 0,
0,
0
}

◆ atomTypeString

const uint8_t atomTypeString[(sizeof(atomHasChild)/sizeof(atomHasChild[0]))][5]
static
初始值:
=
{
"ftyp", "wide", "mdat", "moov", "mvhd", "trak",
"tkhd", "tapt", "clef", "prof", "enof", "edts",
"elst", "mdia", "mdhd", "hdlr", "minf", "vmhd",
"smhd", "dinf", "dref", "stbl", "stsd", "stts",
"stsc", "stsz", "stco", "udta", "free", "skip",
"meta", "load", "iods", "ilst", "keys", "data",
"trkn", "disk", "cpil", "pgap", "tmpo", "gnre",
"covr",
{ 0xA9 , 'n', 'a', 'm', '\0'}, { 0xA9 , 'A', 'R', 'T', '\0'},
{ 0xA9 , 'a', 'l', 'b', '\0'}, { 0xA9 , 'g', 'e', 'n', '\0'},
{ 0xA9 , 'd', 'a', 'y', '\0'}, { 0xA9 , 't', 'o', 'o', '\0'},
{ 0xA9 , 'w', 'r', 't', '\0'},
"----",
}