You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
5.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2009-2019. All rights reserved.
* Description: Defines avplay config api
* Author: Hisilicon
* Create: 2009-12-21
* History:
*/
#ifndef __AVPLAY_CONFIG_H__
#define __AVPLAY_CONFIG_H__
#include "td_type.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#define AVPLAY_SUPPORT_DEBUGGER
#define AVPLAY_SUPPORT_VDEC_DEINIT_INPUT_BUF
#define AVPLAY_MAX_VDEC_ERR_COVER 100
#define AVPLAY_BUFF_TIME_MAX 1000
#define AVPLAY_BUFF_TIME_NORMAL 800
#define AVPLAY_BUFF_TIME_MIN 200
/* video buffer dither waterline */
/* CNcomment: 视频缓冲管理抖动水线的百分比0-99 */
#define AVPLAY_ES_VID_FULL_PERCENT 85
#define AVPLAY_ES_VID_HIGH_PERCENT 70
#define AVPLAY_ES_VID_LOW_PERCENT 30
#define AVPLAY_ES_VID_EMPTY_PERCENT 10
#define AVPLAY_ES_VID_DROP_PERCENT 60
#define AVPLAY_ES_VID_BPS_THRESHOLD (128 * 100)
#define AVPLAY_ES_VID_DELAY_TIME_EMPTY 100
#define AVPLAY_ES_VID_DELAY_TIME_LOW 200
/* audio buffer dither waterline */
/* CNcomment: 音频缓冲管理抖动水线的百分比0-99 */
#define AVPLAY_ES_AUD_FULL_PERCENT 98
#define AVPLAY_ES_AUD_HIGH_PERCENT 85
#define AVPLAY_ES_AUD_LOW_PERCENT 5
#define AVPLAY_ES_AUD_EMPTY_PERCENT 2
/* CNcomment: 音频攒流缓冲管理抖动水线的百分比0-99 */
#define AVPLAY_BUF_PERCENT_MAX 25 /* 预同步后攒流最大值 */
#define AVPLAY_FUND_STREAM_TIMEOUT 1000 /* 预同步后攒流时间 */
#define AVPLAY_ADEC_BUF_PERCENT_MIN 4 /* 断流进入攒流条件时ADEC buff状态 */
#define AVPLAY_FUND_BUF_TIME_MAX 1000 /* 断流退出攒流条件时AO buff time 状态 */
#define AVPLAY_FUND_BUF_TIME_MIN 400 /* 断流进入攒流条件时AO buff time状态 */
#define AVPLAY_AO_BUF_TIME_MIN 50 /* 同步攒流ao delay最小值 */
#define AVPLAY_BREAK_TIME_MIN 200 /* 断流最小时间 */
#define AVPLAY_BUF_PERCENT_MAX_PRE_SYNC 4 /* 预同步后攒流最大值 */
#define AVPLAY_FUND_MIN_TIME 400 /* 攒流buf最小值 */
#define AVPLAY_PRE_FUND_TIME 200 /* 起播攒流buf最小值 */
#define AVPLAY_FUND_CODEX 0x80340007
#define AVPLAY_ES_AUD_DELAY_TIME_EMPTY 150
#define AVPLAY_ES_AUD_DELAY_TIME_LOW 240
#define AVPLAY_EFIFO_DEFAULT_SIZE (32 * 1024)
#define AVPLAY_EFIFO_MAX_SIZE (512 * 1024)
#define AVPLAY_EFIFO_MAX_PARAM_SIZE 128
#define AVPLAY_EFIFO_INVALID_ID 0xff
#define AVPLAY_MAX_BUFQ_SIZE (64 * 1024 * 1024)
#define AVPLAY_MIN_UVMOS_FRAME_CNT 40
#define AVPLAY_MAX_UVMOS_INFO_CNT 16
#define AVPLAY_MIN_UVMOS_INFO_CNT 5
#define AVPLAY_INVALID_AUD_TYPE 0xffffffff
#define AVPLAY_INVALID_ID 0xFF
#define AVPLAY_MAX_CNT 32
#define AVPLAY_MAX_DMX_AUD_CHAN_NUM 32
#define AVPLAY_MAX_TRACK_NUM 6
#define AVPLAY_MAX_VIR_FRMCHAN 1
#define AVPLAY_MAX_VDP_FRAME_NUM 3
/* adapt the audio driver range : -32 ~ 32 */
#define avplay_ad_balance_user_to_drv(balance) (td_s16)((balance) / 3.125)
#define AVPLAY_MAX_AD_BALANCE_VALUE 100
#define AVPLAY_MAX_ADEC_FRAME 32
#define AVPLAY_DEFAULT_ADEC_FRAME_NUM 8
/* TPLAY */
#define AVPLAY_MAX_TPLAY_INTEGER 64
#define AVPLAY_MAX_TPLAY_DECIMAL 999
#define AVPLAY_MAX_AUD_TPLAY_SPEED 2000 /* Double speed */
#define AVPLAY_MIN_AUD_TPLAY_SPEED 200 /* 0.2 speed */
#define AVPLAY_DEFAULT_FRAME_DURATION 40
#define AVPLAY_MULTIAUD_SYNC_NOVEL_REGION (3000 * 1000) /* unit: us */
#define AVPLAY_MULTIAUD_SYNC_START_REGION (100 * 1000) /* unit: us */
#define AVPLAY_DMX_BUF_HIGH_THRESHOLD 85
#define AVPLAY_MAX_BUF_BLK_CNT (1024 * 1024)
#define AVPLAY_DEFAULT_BUF_BLK_CNT 4096
#define AVPLAY_ALLOC_USER_DATA_SIZE (16 * 1024) /* 4K byte alignment required */
typedef enum {
AVPLAY_LOOP_DEBUG_WAKEUP_SIGNAL = 1 << 0,
AVPLAY_LOOP_DEBUG_DISABLE_VDMX = 1 << 1,
AVPLAY_LOOP_DEBUG_DISABLE_VDEC = 1 << 2,
AVPLAY_LOOP_DEBUG_DISABLE_VOUT = 1 << 3,
AVPLAY_LOOP_DEBUG_DISABLE_ADMX = 1 << 4,
AVPLAY_LOOP_DEBUG_DISABLE_ADEC = 1 << 5,
AVPLAY_LOOP_DEBUG_DISABLE_AOUT = 1 << 6,
} avplay_loop_debug_flag;
/* config_step 1: define the config tag here */
typedef enum {
AVPLAY_CONFIG_TAG_GLOBAL_SETTING = 0,
AVPLAY_CONFIG_TAG_LOOP_SHOW,
AVPLAY_CONFIG_TAG_LOOP_POLL, /* polling or event-driven, value: 1: polling; 0: event-driven */
AVPLAY_CONFIG_TAG_LOOP_DEBUG, /* value: avplay_loop_debug_flag */
AVPLAY_CONFIG_TAG_AUD_THREAD_PRIO,
AVPLAY_CONFIG_TAG_VID_THREAD_PRIO,
AVPLAY_CONFIG_TAG_EVT_THREAD_PRIO,
AVPLAY_CONFIG_TAG_RPT_THREAD_PRIO,
AVPLAY_CONFIG_TAG_MUTEX_TYPE, /* 0: default mutex, 1: recursive mutex */
AVPLAY_CONFIG_TAG_UVMOS_ENABLE,
AVPLAY_CONFIG_TAG_VID_EB_SIZE,
AVPLAY_CONFIG_TAG_AUD_EB_SIZE,
AVPLAY_CONFIG_TAG_MAX
} avplay_config_tag;
void avplay_config_init(void);
td_u32 avplay_config_get(avplay_config_tag tag);
td_u32 avplay_property_get(avplay_config_tag tag);
#ifdef AVPLAY_SUPPORT_DEBUGGER
td_s32 avplay_config_set(void *private, avplay_config_tag tag, td_u32 val);
td_s32 avplay_config_set_by_name(void *private, const td_char *name, const td_char *val);
td_s32 avplay_config_help(td_u32 id, td_char *help_info, td_u32 info_length);
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif