|
|
/*
|
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2020. All rights reserved.
|
|
|
* Description: define audio common data structure
|
|
|
* Author: Hisilicon
|
|
|
* Create: 2012-12-22
|
|
|
*/
|
|
|
|
|
|
#ifndef __UAPI_AEF_H__
|
|
|
#define __UAPI_AEF_H__
|
|
|
|
|
|
#include "uapi_audio.h"
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
#if __cplusplus
|
|
|
extern "C" {
|
|
|
#endif
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
#define UAPI_AEF_GET_AFLTID_CMD 0x0100
|
|
|
#define UAPI_AEF_GET_CH_CMD 0x0101
|
|
|
#define UAPI_AEF_GET_FRAMEDELAY_CMD 0x0102
|
|
|
#define UAPI_AEF_SET_OUTBUFADDR_CMD 0x1000
|
|
|
#define UAPI_AEF_DEBUG_CONFIG_CMD 0x1101
|
|
|
|
|
|
/* Audio effect type, uapi_aef_type keep consistent with effect type of ARM/DSP */
|
|
|
/* CNcomment: uapi_aef_type 必须 ARM/DSP 保持唯一值 */
|
|
|
typedef enum {
|
|
|
/* Dolby audio effect */
|
|
|
/* CNcomment: Dolby音效 */
|
|
|
UAPI_AEF_TYPE_DOLBY = 0x000,
|
|
|
|
|
|
/* Customer audio effect */
|
|
|
/* CNcomment: 客户自研音效 */
|
|
|
UAPI_AEF_TYPE_CUSTOMER = 0x020,
|
|
|
|
|
|
/* Customer 1 audio effect */
|
|
|
/* CNcomment: 客户1的自研音效 */
|
|
|
UAPI_AEF_TYPE_CUSTOMER_A = 0x021,
|
|
|
|
|
|
/* LP audio effect */
|
|
|
/* CNcomment: LP音效 */
|
|
|
UAPI_AEF_TYPE_LP = 0x100,
|
|
|
|
|
|
/* SPECTRUM */
|
|
|
/* CNcomment: SPECTRUM组件 */
|
|
|
UAPI_AEF_TYPE_SPECTRUM = 0x120,
|
|
|
|
|
|
/* SWS3D V2.0 audio effect */
|
|
|
/* CNcomment: SWS3D V2.0音效 */
|
|
|
UAPI_AEF_TYPE_SWS2 = 0x131,
|
|
|
|
|
|
/* SWS3D V3.0 audio effect */
|
|
|
/* CNcomment: SWS3D V3.0音 */
|
|
|
UAPI_AEF_TYPE_SWS3 = 0x132,
|
|
|
|
|
|
/* KDE audio effect */
|
|
|
/* CNcomment: 卡拉OK音效 */
|
|
|
UAPI_AEF_TYPE_KDE = 0x150,
|
|
|
|
|
|
/* SOOVEN audio effect */
|
|
|
/* CNcomment: SOOVEN音效 */
|
|
|
UAPI_AEF_TYPE_SOOVEN = 0x160,
|
|
|
|
|
|
/* SOOVEN2 audio effect */
|
|
|
/* CNcomment: SOOVEN2音效 */
|
|
|
UAPI_AEF_TYPE_SOOVEN2 = 0x161,
|
|
|
|
|
|
/* SOOVEN3 audio effect */
|
|
|
/* CNcomment: SOOVEN3音效 */
|
|
|
UAPI_AEF_TYPE_SOOVEN3 = 0x162,
|
|
|
|
|
|
/* HVS audio effect */
|
|
|
/* CNcomment: Heaven Sound effect */
|
|
|
UAPI_AEF_TYPE_HVS = 0x163,
|
|
|
|
|
|
/* HVS2 audio effect */
|
|
|
/* CNcomment: Heaven Sound2 effect */
|
|
|
UAPI_AEF_TYPE_HVS2 = 0x164,
|
|
|
|
|
|
/* HVS3 audio effect */
|
|
|
/* CNcomment: Heaven Sound3 effect */
|
|
|
UAPI_AEF_TYPE_HVS3 = 0x165,
|
|
|
|
|
|
/* global audio effect */
|
|
|
/* CNcomment: 全局音效 */
|
|
|
UAPI_SND_AEF_TYPE_GLOBAL = 0x170,
|
|
|
|
|
|
/* supplemental1 audio effect */
|
|
|
/* CNcomment: 补充1音效,补充全局音效的单一特性§ */
|
|
|
UAPI_SND_AEF_TYPE_SUPPLEMENTAL1 = 0x171,
|
|
|
|
|
|
/* supplemental2 audio effect */
|
|
|
/* CNcomment: 补充2音效,补充全局音效的单一特性,Reserved */
|
|
|
UAPI_SND_AEF_TYPE_SUPPLEMENTAL2 = 0x172,
|
|
|
} uapi_aef_type;
|
|
|
|
|
|
/* Configuration parameters required by an audio effect for creating devices. */
|
|
|
/* CNcomment: 音效创建设备的配置参数 */
|
|
|
typedef struct {
|
|
|
/* [IN]be master or not */
|
|
|
/* CNcomment:[IN]主从模式 */
|
|
|
td_bool master;
|
|
|
|
|
|
/* [IN]pointer to private data */
|
|
|
/* CNcomment:[IN]指向私有配置结构体的指针 */
|
|
|
td_void *private_data;
|
|
|
|
|
|
/* [IN]size of the private data. */
|
|
|
/* CNcomment:[IN]私有结构体大小 */
|
|
|
td_u32 private_data_size;
|
|
|
} uapi_aef_param;
|
|
|
|
|
|
typedef struct uapi_aef_authorize__ {
|
|
|
/* [IN]description information about an AEF, such as SRS_StudioSound3D or Dolby_Volume. */
|
|
|
const td_char *name;
|
|
|
|
|
|
const uapi_aef_type aef_type;
|
|
|
|
|
|
const td_u32 version; /* [IN]version. */
|
|
|
|
|
|
/* CNcomment:寄存器可查询,不对外公布 */
|
|
|
td_void (*get_auth_key)(td_u32 *customer_auth_key); /* 128/256bit key */
|
|
|
|
|
|
/* detailed information about the user of AEF, less than 64 bytes. */
|
|
|
/* CNcomment:proc信息可查询 */
|
|
|
const td_char *customer_description;
|
|
|
} uapi_aef_authorize;
|
|
|
|
|
|
typedef struct {
|
|
|
/* The common function api of ARM & DSP */
|
|
|
td_char *name; /* [IN]description of an AEF, such as SRS_StudioSound3D. */
|
|
|
uapi_aef_type aef_type;
|
|
|
td_u32 version; /* [IN]version. */
|
|
|
|
|
|
/* detailed information about the user of AEF, less than 64 bytes. */
|
|
|
const td_char *customer_description;
|
|
|
|
|
|
td_s32 (*get_default_open_param)(td_void *open_param, td_u32 param_size);
|
|
|
td_s32 (*create)(uapi_aef_authorize *auth_entry, td_void *aef_attr, td_handle *aef);
|
|
|
td_s32 (*destroy)(td_handle aef);
|
|
|
td_s32 (*set_config)(td_handle aef, td_u32 config_index, const td_void *config);
|
|
|
td_s32 (*get_config)(td_handle aef, td_u32 config_index, td_void *config);
|
|
|
td_s32 (*set_parameter)(td_handle aef, td_u32 param_index, const td_void *parameter);
|
|
|
td_s32 (*get_parameter)(td_handle aef, td_u32 param_index, td_void *parameter);
|
|
|
|
|
|
/* The private function api only on DSP */
|
|
|
td_s32 (*set_enable)(td_handle aef, td_bool enable);
|
|
|
td_s32 (*get_enable)(td_handle aef, td_bool *enable);
|
|
|
td_s32 (*get_max_pcm_in_size)(td_handle aef, td_u32 *in_size);
|
|
|
td_s32 (*get_max_pcm_out_size)(td_handle aef, td_u32 *out_size);
|
|
|
td_s32 (*in_buf_init)(td_handle aef, td_u32 buf_size);
|
|
|
td_s32 (*in_buf_deinit)(td_handle aef);
|
|
|
td_s32 (*out_buf_init)(td_handle aef, td_u32 buf_size, td_u32 buf_num);
|
|
|
td_s32 (*out_buf_deinit)(td_handle aef);
|
|
|
td_s32 (*get_buf)(td_handle aef, uapi_stream_buf *buf);
|
|
|
td_s32 (*put_buf)(td_handle aef, const uapi_stream_buf *buf);
|
|
|
td_s32 (*acquire_frame)(td_handle aef, uapi_audio_frame *frame);
|
|
|
td_s32 (*release_frame)(td_handle aef, td_u32 frame_index);
|
|
|
td_s32 (*set_eos_flag)(td_handle aef, td_bool eos);
|
|
|
|
|
|
/* The private function api only on ARM */
|
|
|
td_s32 (*proc_frame)(td_handle aef, uapi_audio_frame *in_frame, uapi_audio_frame *out_frame);
|
|
|
} uapi_aef_component;
|
|
|
|
|
|
#define UAPI_AEF_SETTING_SIZE (4 << 10)
|
|
|
|
|
|
typedef struct {
|
|
|
td_bool changed;
|
|
|
td_bool debug;
|
|
|
uapi_aef_type aef_type;
|
|
|
td_void *aef_setting;
|
|
|
} uapi_aef_setting;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
#if __cplusplus
|
|
|
}
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#endif /* __UAPI_AEF_H__ */
|