GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_H__
|
||||
#define __XMEDIA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
#include "bsp_config.h"
|
||||
#include "bsp_defs.h"
|
||||
#include "bsp_type.h"
|
||||
|
||||
#include "bsp_version.h"
|
||||
|
||||
#include "bsp_os.h"
|
||||
#include "bsp_module.h"
|
||||
#include "bsp_error.h"
|
||||
#include "bsp_dbg.h"
|
||||
#include "bsp_bits.h"
|
||||
#include "bsp_utils.h"
|
||||
#include "bsp_help_en.h"
|
||||
#include "bsp_thread.h"
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_H__ */
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_BITS_H__
|
||||
#define __XMEDIA_BITS_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
|
||||
/*** High 8 bits of 16 ***/
|
||||
#define GET_0Byte_32(ul) ((U32)ul & 0x000000FF)
|
||||
#define GET_1Byte_32(ul) ((U32)ul & 0x0000FF00) >> 8
|
||||
#define GET_2Byte_32(ul) ((U32)ul & 0x00FF0000) >> 16
|
||||
#define GET_3Byte_32(ul) ((U32)ul & 0xFF000000) >> 24
|
||||
|
||||
#define GET_HI8_16(us) ((U16)us >> 8)
|
||||
#define GET_LO8_16(us) ((U16)us & 0x00FF)
|
||||
|
||||
#define SET_HI8_16(us, v) (((U16)us & 0x00FF) | (v << 8))
|
||||
#define SET_LO8_16(us, v) (((U16)us & 0xFF00) | (v))
|
||||
|
||||
/**/
|
||||
#define GET_HI16_32(dw) ((dw) >> 16)
|
||||
#define GET_LO16_32(dw) ((dw) & 0x0000FFFF)
|
||||
|
||||
#define SET_HI16_32(dw, v) ((dw & 0x0000FFFF) | (v << 16))
|
||||
#define SET_LO16_32(dw, v) ((dw & 0xFFFF0000) | (v))
|
||||
|
||||
#define GET_LO32_64(dw) ((dw) & 0x00000000FFFFFFFF)
|
||||
|
||||
/*15...3 2 1 0*/
|
||||
#define SET_BIT0_16(us, v) ((us & 0xFFFE) | v)
|
||||
#define SET_BIT1_16(us, v) ((us & 0xFFFD) | (v << 1))
|
||||
#define SET_BIT2_16(us, v) ((us & 0xFFFB) | (v << 2))
|
||||
#define SET_BIT3_16(us, v) ((us & 0xFFF7) | (v << 3))
|
||||
|
||||
#define SET_BIT4_16(us, v) ((us & 0xFFEF) | (v << 4))
|
||||
#define SET_BIT5_16(us, v) ((us & 0xFFDF) | (v << 5))
|
||||
#define SET_BIT6_16(us, v) ((us & 0xFFBF) | (v << 6))
|
||||
#define SET_BIT7_16(us, v) ((us & 0xFF7F) | (v << 7))
|
||||
|
||||
#define SET_BIT8_16(us, v) ((us & 0xFEFF) | (v << 8))
|
||||
#define SET_BIT9_16(us, v) ((us & 0xFDFF) | (v << 9))
|
||||
#define SET_BIT10_16(us, v) ((us & 0xFBFF) | (v << 10))
|
||||
#define SET_BIT11_16(us, v) ((us & 0xF7FF) | (v << 11))
|
||||
|
||||
#define SET_BIT12_16(us, v) ((us & 0xEFFF) | (v << 12))
|
||||
#define SET_BIT13_16(us, v) ((us & 0xDFFF) | (v << 13))
|
||||
#define SET_BIT14_16(us, v) ((us & 0xBFFF) | (v << 14))
|
||||
#define SET_BIT15_16(us, v) ((us & 0x7FFF) | (v << 15))
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* __XMEDIA_BITS_H__ */
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_CONFIG_H__
|
||||
#define __XMEDIA_CONFIG_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if defined(TARGET_X86)
|
||||
|
||||
//#define PC_EMULATOR
|
||||
/*#undefine PC_EMULATOR*/
|
||||
|
||||
/* Whether to use the BTRACE debug library */
|
||||
/*#define USE_BTRACE*/
|
||||
/*#undefine USE_BTRACE*/
|
||||
#endif
|
||||
|
||||
/* DEBUG MODE */
|
||||
#define DEBUG
|
||||
/*#define RELEASE*/
|
||||
|
||||
#define OS_LINUX
|
||||
|
||||
/**/
|
||||
|
||||
/************ -D in Makefile ******/
|
||||
/* Simulate the program on ARM, Use -DARM_CPU*/
|
||||
/*#define ARM_CPU*/
|
||||
|
||||
/*Simulate the program on ZSP, Use -DZSP_CPU*/
|
||||
/*#define ZSP_CPU*/
|
||||
|
||||
/* Whether to perform the print function */
|
||||
#define LOGQUEUE
|
||||
|
||||
/* Whether to do Arm and ZSP communication statistics */
|
||||
#define AZ_STAT
|
||||
|
||||
/* multi-task logqueue*/
|
||||
#define MULTI_TASK_LOGQUEUE
|
||||
|
||||
/* Using inerrupt mode on ARM and ZSP communication */
|
||||
#define USE_AZ_INT
|
||||
|
||||
#define STAT
|
||||
|
||||
#if 0
|
||||
/*Turn on both when test video */
|
||||
#define AZ_POOL_LOW
|
||||
#define AZ_MAGIC_LOW
|
||||
#endif
|
||||
|
||||
//#define H264STREAM_CORRECT
|
||||
/*RingBuffer count */
|
||||
#define RBSTAT
|
||||
|
||||
#define BITSTREAM_ENC_CHECKSUM
|
||||
#define BITSTREAM_DEC_CHECKSUM
|
||||
|
||||
#define RTSP_VOD
|
||||
|
||||
#define SAVE_VOICE 1
|
||||
|
||||
/* Support network on-demand */
|
||||
#define MPLAYER_NETWORK
|
||||
|
||||
#define DEMO_MEDIA
|
||||
|
||||
#define DEMO_VOICE
|
||||
#define DEMO_VIDEO_ENC
|
||||
#define DEMO_VIDEO_DEC
|
||||
|
||||
//#define SYNC_USE_COND
|
||||
|
||||
#define AZPOOLS_X
|
||||
|
||||
#if defined(IMAGESIZE_CIF)
|
||||
#define CONFIG_VIU_CAPTURE_DOWNSCALING //CIF
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_CONFIG_H__ */
|
||||
+238
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_DBG_H__
|
||||
#define __XMEDIA_DBG_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(DEBUG)
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#ifdef LOGQUEUE
|
||||
#include "bsp_message.h"
|
||||
USE_GLOBALVAR LOG_QUEUE gLogQueue;
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
#define DBG_ASSERT(expression) assert(expression)
|
||||
#define DBG_ASSERT_STR(expression, str) \
|
||||
do \
|
||||
{ \
|
||||
if (!(expression)) \
|
||||
{ \
|
||||
WRITE_LOG_DEBUG(str); \
|
||||
assert(expression); \
|
||||
} \
|
||||
}while(0);
|
||||
|
||||
|
||||
#define DBG_LOG WRITE_LOG_DEBUG
|
||||
#define DBG_LOG1 WRITE_LOG_DEBUG1
|
||||
#define DBG_LOG2 WRITE_LOG_DEBUG2
|
||||
|
||||
#else
|
||||
#define DBG_ASSERT(expression) ((void)0)
|
||||
#define DBG_ASSERT_STR(expression, str)
|
||||
|
||||
#define DBG_LOG(args...)
|
||||
#define DBG_LOG1 WRITE_LOG_DEBUG1
|
||||
#define DBG_LOG2 WRITE_LOG_DEBUG2
|
||||
|
||||
#endif
|
||||
#define LOG_LEVEL_NORMAL 0
|
||||
#define LOG_LEVEL_FATAL 1
|
||||
#define LOG_LEVEL_ERROR 2
|
||||
#define LOG_LEVEL_WARN 3
|
||||
#define LOG_LEVEL_INFO 4
|
||||
|
||||
#define LOG_LEVEL_DEBUG 5
|
||||
#define LOG_LEVEL_DEBUG1 6
|
||||
#define LOG_LEVEL_DEBUG2 7
|
||||
|
||||
#define LOG_LEVEL_ALL 10
|
||||
#define LOG_LEVEL_NONE 0
|
||||
|
||||
#define LOG_LEVEL_DEFAULT LOG_LEVEL_INFO
|
||||
#define LOG_LEVEL_MINI LOG_LEVEL_ERROR
|
||||
#define LOG_LEVEL_MAX LOG_LEVEL_ALL
|
||||
|
||||
/* LOG */
|
||||
/*
|
||||
*WRITE_LOG_FATAL("Memory is too much , total: %u M, it's waste, please save people's money , 1024");
|
||||
*WRITE_LOG ( LOG_LEVEL_WARN, "after VIU device analyse: you are a handsome pig." );
|
||||
*/
|
||||
|
||||
/*gLogQueue is a Global Var, now defined at bsp_message.c and
|
||||
declare at bsp_dbg.h, it you use this log functions outside,
|
||||
you can declare your owner "gLogQueue"*/
|
||||
/*Call this first , and only call it once*/
|
||||
|
||||
/*level = LOG_LEVEL_ERROR .....*/
|
||||
|
||||
#ifdef LOGQUEUE
|
||||
#define LOG_CREATE(level, msglen) Log_Create(&gLogQueue, level, msglen)
|
||||
|
||||
#define LOG_SETLEVEL(level) (gLogQueue.ucMinLevel = level)
|
||||
|
||||
#define LOG_GETLEVEL() (gLogQueue.ucMinLevel)
|
||||
|
||||
#define LOG_DESTROY() Log_Destroy(&gLogQueue)
|
||||
|
||||
#if 0
|
||||
#define WRITE_LOG_NORMAL(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_NORMAL, psz_format, ##args )
|
||||
|
||||
#define WRITE_LOG_INFO(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_INFO, psz_format, ##args )
|
||||
|
||||
#define WRITE_LOG_FATAL(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_FATAL, psz_format, ##args )
|
||||
|
||||
#define WRITE_LOG_ERROR(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_ERROR, psz_format, ##args )
|
||||
|
||||
#define WRITE_LOG_WARN(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_WARN, psz_format, ##args )
|
||||
|
||||
#define WRITE_LOG_DEBUG(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_DEBUG, "{%s:%i}:"psz_format, \
|
||||
__FILE__, __LINE__ ,##args)
|
||||
|
||||
#define WRITE_LOG_DEBUG1(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_DEBUG1, "{%s:%i}:"psz_format, \
|
||||
__FILE__, __LINE__ ,##args)
|
||||
|
||||
#define WRITE_LOG_DEBUG2(psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_DEBUG2, "{%s:%i}:"psz_format, \
|
||||
__FILE__, __LINE__ ,##args)
|
||||
|
||||
#define WRITE_LOG(iLevel, psz_format, args... ) \
|
||||
Log_Msg(&gLogQueue, iLevel, psz_format, ##args )
|
||||
#endif /* End of #if 0 */
|
||||
|
||||
#define MKSTR(exp) # exp
|
||||
#define MKMARCOTOSTR(exp) MKSTR(exp)
|
||||
#define LINENUMBER MKMARCOTOSTR(__LINE__)
|
||||
|
||||
#define ATTACHINFO ""
|
||||
|
||||
#define WRITE_LOG_NORMAL(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_NORMAL, args )
|
||||
|
||||
#define WRITE_LOG_INFO(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_INFO, args)
|
||||
|
||||
#define WRITE_LOG_FATAL(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_FATAL, args )
|
||||
|
||||
#define WRITE_LOG_ERROR(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_ERROR, args )
|
||||
|
||||
#define WRITE_LOG_WARN(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_WARN, args )
|
||||
|
||||
#define WRITE_LOG_DEBUG(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_DEBUG, ATTACHINFO args)
|
||||
|
||||
#define WRITE_LOG_DEBUG1(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_DEBUG1, ATTACHINFO args)
|
||||
|
||||
#define WRITE_LOG_DEBUG2(args... ) \
|
||||
Log_Msg(&gLogQueue, LOG_LEVEL_DEBUG2, ATTACHINFO args)
|
||||
|
||||
#define WRITE_LOG(iLevel, args... ) \
|
||||
Log_Msg(&gLogQueue, iLevel, args )
|
||||
|
||||
#else
|
||||
|
||||
#define LOG_CREATE(level, msglen)
|
||||
|
||||
#define LOG_SETLEVEL(level)
|
||||
|
||||
#define LOG_GETLEVEL() (0)
|
||||
|
||||
#define LOG_DESTROY()
|
||||
|
||||
#define WRITE_LOG_NORMAL(args...)
|
||||
|
||||
#define WRITE_LOG_INFO(args...)
|
||||
|
||||
#define WRITE_LOG_FATAL(args...)
|
||||
|
||||
#define WRITE_LOG_ERROR(args...)
|
||||
|
||||
#define WRITE_LOG_WARN(args...)
|
||||
|
||||
#define WRITE_LOG_DEBUG(args...)
|
||||
|
||||
#define WRITE_LOG_DEBUG1(args...)
|
||||
|
||||
#define WRITE_LOG_DEBUG2(args...)
|
||||
|
||||
#define WRITE_LOG(args...)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX) && defined(USE_BTRACE) && defined(DEBUG)
|
||||
#if !defined(BTRACE_ENABLE)
|
||||
#define BTRACE_ENABLE
|
||||
#endif
|
||||
#else
|
||||
#if defined(BTRACE_ENABLE)
|
||||
#undef BTRACE_ENABLE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BTRACE_ENABLE)
|
||||
#define BTRACE_INIT() btrace()
|
||||
#define BTRACE_PRINT btrace_print
|
||||
#define BTRACE_PRINT_FUNC() btrace_print_str(__func__)
|
||||
#define BTRACE_PRINT_STR(str) btrace_print_str(str)
|
||||
|
||||
#else
|
||||
#define BTRACE_INIT()
|
||||
#define BTRACE_PRINT
|
||||
#define BTRACE_PRINT_FUNC()
|
||||
#define BTRACE_PRINT_STR(str)
|
||||
#endif
|
||||
|
||||
EXTERNFUNC XMEDIA_RET bsp_md(IN VOID* pStart,IN U32 ulLen,IN FD fd);
|
||||
/*Memory Dump 2 file*/
|
||||
EXTERNFUNC XMEDIA_RET bsp_md2file(IN VOID* pStart,IN U32 ulLen,
|
||||
IN const char* strLabel,
|
||||
IN char* fn);
|
||||
|
||||
EXTERNFUNC void bsp_hexdump(OUT FILE *stream,
|
||||
IN const void *src, IN size_t len,
|
||||
IN size_t width);
|
||||
|
||||
EXTERNFUNC VOID bsp_hexdump_log(IN const void *src, IN size_t len,
|
||||
IN size_t width);
|
||||
|
||||
VOID bsp_hexdump2(OUT FILE *stream,
|
||||
IN const void *src, IN size_t len, IN size_t width);
|
||||
|
||||
#if defined(DEBUG)
|
||||
#define MEM_DUMP bsp_md
|
||||
#define MEM_DUMP2FILE bsp_md2file
|
||||
#else
|
||||
#define MEM_DUMP
|
||||
#define MEM_DUMP2FILE
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_DBG_H__ */
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_DEFS_H__
|
||||
#define __XMEDIA_DEFS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define __asm__ asm
|
||||
#define __inline__ inline
|
||||
#endif
|
||||
|
||||
#define DO_NOTHING
|
||||
|
||||
#define INLINE inline
|
||||
|
||||
/*use for parameter INPUT, *DO NOT Modify the value* */
|
||||
#define IN
|
||||
/* use for parameter OUTPUT, the value maybe change when return from the function
|
||||
* the init value is ingore in the function.*/
|
||||
#define OUT
|
||||
/*use for parameter INPUT and OUTPUT*/
|
||||
#define IO
|
||||
|
||||
/* -------------------------------- */
|
||||
#define EXTERN extern
|
||||
#define STATIC static
|
||||
|
||||
#define LOCALVAR static
|
||||
#define GLOBALVAR extern
|
||||
|
||||
#define DECLARE_GLOBALVAR
|
||||
|
||||
#define USE_GLOBALVAR extern
|
||||
|
||||
#define LOCALFUNC static
|
||||
#define EXTERNFUNC extern
|
||||
|
||||
#define LAPI
|
||||
#define HAPI
|
||||
/*Multimedia Frame API*/
|
||||
#define MMFAPI
|
||||
|
||||
/* -------- Standard input/output/err *****/
|
||||
#define STDIN stdin
|
||||
#define STDOUT stdout
|
||||
#define STDERR stderr
|
||||
|
||||
#define MIN(x,y) ((x) < (y) ? (x) : (y))
|
||||
#define MAX(x,y) ((x) > (y) ? (x) : (y))
|
||||
|
||||
#define ALIGN_START(v,a) (((v)) & (~((a)-1)))
|
||||
|
||||
#define ALIGN_END(v,a) (((v) & ~((a)-1)) + ((a)-1) )
|
||||
|
||||
#define ALIGN_NEXT(v,a) ((((v) + ((a)-1)) & (~((a)-1))))
|
||||
|
||||
#define ALIGN_LENGTH(l, a) ALIGN_NEXT(l, a)
|
||||
|
||||
#define ALIGNTYPE_1BYTE 1
|
||||
/*zsp*/
|
||||
#define ALIGNTYPE_2BYTE 2
|
||||
/*x86... default*/
|
||||
#define ALIGNTYPE_4BYTE 4
|
||||
|
||||
#define ALIGNTYPE_8BYTE 8
|
||||
/*1 Page*/
|
||||
#define ALIGNTYPE_4K 4096
|
||||
|
||||
#define ALIGNTYPE_ZSP ALIGNTYPE_2BYTE
|
||||
|
||||
#define ALIGNTYPE_VIDEO ALIGNTYPE_8BYTE
|
||||
|
||||
#define PRINT_OUT(args...) printf(##args)
|
||||
|
||||
#define PACK_ONE_BYTE __attribute__((__packed__))
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_DEFS_H__ */
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_ERROR_H__
|
||||
#define __XMEDIA_ERROR_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
#define ERR_SUB_MODULE_BASE(module, submodule) \
|
||||
(( module << 24 ) | ( submodule << 16 ))
|
||||
|
||||
#define ERR_NUMBER(err, base) ( (base) | (err) )
|
||||
|
||||
/*****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
/*0x00XX*/
|
||||
#define ERR_GENERAL_BASE ERR_SUB_MODULE_BASE(MODULE_GENERAL, 0)
|
||||
|
||||
#define ERR_GEN_NOT_ENOUGH_MEMORY ERR_NUMBER(2, ERR_GENERAL_BASE) /*0x0002*/
|
||||
#define ERR_GEN_INVALID_POINTER ERR_NUMBER(3, ERR_GENERAL_BASE) /*0x0003*/
|
||||
#define ERR_GEN_OVERFLOW ERR_NUMBER(4, ERR_GENERAL_BASE) /*0x0004*/
|
||||
#define ERR_GEN_OUT_OF_BOUND ERR_NUMBER(5, ERR_GENERAL_BASE) /*0x0004*/
|
||||
#define ERR_GEN_INVALID_FP ERR_NUMBER(6, ERR_GENERAL_BASE) /*0x0004*/
|
||||
|
||||
#define ERR_GEN_TIMEOUT ERR_NUMBER(7, ERR_GENERAL_BASE) /*0x0007*/
|
||||
#define ERR_GEN_INVALID_PARAMETER ERR_NUMBER(8, ERR_GENERAL_BASE) /*0x0008*/
|
||||
|
||||
/*****************************************************************************
|
||||
****************************************************************************/
|
||||
#define ERR_DRV_VIU_BASE ERR_SUB_MODULE_BASE(MODULE_DRV, DRV_SUB_MODULE_VIU)
|
||||
#define ERR_DRV_VOU_BASE ERR_SUB_MODULE_BASE(MODULE_DRV, DRV_SUB_MODULE_VOU)
|
||||
#define ERR_DRV_DSU_BASE ERR_SUB_MODULE_BASE(MODULE_DRV, DRV_SUB_MODULE_DSU)
|
||||
#define ERR_DRV_USB_BASE ERR_SUB_MODULE_BASE(MODULE_DRV, DRV_SUB_MODULE_USB)
|
||||
#define ERR_DRV_SF_BASE ERR_SUB_MODULE_BASE(MODULE_DRV, DRV_SUB_MODULE_SF)
|
||||
#define ERR_DRV_TDE_BASE ERR_SUB_MODULE_BASE(MODULE_DRV, DRV_SUB_MODULE_TDE)
|
||||
|
||||
/* ERR_DRV_VOU_BASE */
|
||||
#define ERR_DRV_VOU_ERROR ERR_NUMBER(0, ERR_DRV_VOU_BASE)
|
||||
#define ERR_DRV_VOU_NOT_INITED ERR_NUMBER(1, ERR_DRV_VOU_BASE)
|
||||
#define ERR_DRV_VOU_INIT_FAILED ERR_NUMBER(2, ERR_DRV_VOU_BASE)
|
||||
#define ERR_DRV_VOU_OUTPUT_MODE_NOT_SUPPORT ERR_NUMBER(3, ERR_DRV_VOU_BASE)
|
||||
#define ERR_DRV_VOU_LAYER_INVALID ERR_NUMBER(4, ERR_DRV_VOU_BASE)
|
||||
|
||||
/* ERR_DRV_VIU_BASE */
|
||||
#define ERR_DRV_VIU_ERROR ERR_NUMBER(0, ERR_DRV_VIU_BASE)
|
||||
#define ERR_DRV_VIU_NOT_INITED ERR_NUMBER(1, ERR_DRV_VIU_BASE)
|
||||
#define ERR_DRV_VIU_INIT_FAILED ERR_NUMBER(2, ERR_DRV_VIU_BASE)
|
||||
#define ERR_DRV_VIU_MODE_NOT_SUPPORT ERR_NUMBER(3, ERR_DRV_VIU_BASE)
|
||||
|
||||
/* ERR_DRV_DSU_BASE */
|
||||
#define ERR_DRV_DSU_ERROR ERR_NUMBER(0, ERR_DRV_DSU_BASE)
|
||||
#define ERR_DRV_DSU_NOT_INITED ERR_NUMBER(1, ERR_DRV_DSU_BASE)
|
||||
#define ERR_DRV_DSU_INIT_FAILED ERR_NUMBER(2, ERR_DRV_DSU_BASE)
|
||||
#define ERR_DRV_DSU_FILTER_NOT_SUPPORT ERR_NUMBER(3, ERR_DRV_DSU_BASE)
|
||||
|
||||
/* ERR_DRV_TDE_BASE */
|
||||
#define ERR_DRV_TDE_ERROR ERR_NUMBER(0, ERR_DRV_TDE_BASE)
|
||||
#define ERR_DRV_TDE_NOT_INITED ERR_NUMBER(1, ERR_DRV_TDE_BASE)
|
||||
#define ERR_DRV_TDE_INIT_FAILED ERR_NUMBER(2, ERR_DRV_TDE_BASE)
|
||||
#define ERR_DRV_TDE_FIFO_TIMEOUT ERR_NUMBER(3, ERR_DRV_TDE_BASE)
|
||||
|
||||
/*
|
||||
Add By You , man
|
||||
......
|
||||
.....
|
||||
*/
|
||||
|
||||
/*00000001-00000001-xxxxxxxx-xxxxxxxx 0x11XX*/
|
||||
#define ERR_SYS_AZ_BASE ERR_SUB_MODULE_BASE(MODULE_SYS, SYS_SUB_MODULE_AZ)
|
||||
|
||||
#define ERR_AZMSG_INVALID_MSGPOOLS ERR_NUMBER(1, ERR_SYS_AZ_BASE) /*0x1101*/
|
||||
#define ERR_AZMSG_INVALID_MSG ERR_NUMBER(2, ERR_SYS_AZ_BASE) /*0x1102*/
|
||||
#define ERR_AZMSG_NO_SPACE_TOSEND ERR_NUMBER(3, ERR_SYS_AZ_BASE) /*0x1103*/
|
||||
#define ERR_AZMSG_NO_MSG_TORECV ERR_NUMBER(4, ERR_SYS_AZ_BASE)
|
||||
#define ERR_AZMSG_INVALID_MSGDATA ERR_NUMBER(5, ERR_SYS_AZ_BASE) /*0x1105*/
|
||||
|
||||
#define ERR_AZMSG_OVERFLOW ERR_NUMBER(6, ERR_SYS_AZ_BASE) /*0x1106*/
|
||||
#define ERR_AZMSG_EMPTY ERR_NUMBER(7, ERR_SYS_AZ_BASE) /*0x1107*/
|
||||
#define ERR_AZMSG_READY_TIMEOUT ERR_NUMBER(8, ERR_SYS_AZ_BASE) /*0x1108*/
|
||||
#define ERR_AZMSG_POOL_OFFREAD ERR_NUMBER(9, ERR_SYS_AZ_BASE) /*0x1109*/
|
||||
#define ERR_AZMSG_POOL_OFFWRITE ERR_NUMBER(10, ERR_SYS_AZ_BASE) /*0x1110*/
|
||||
|
||||
#define ERR_AZMSG_MSG_MAGIC ERR_NUMBER(11, ERR_SYS_AZ_BASE) /*0x1111*/
|
||||
#define ERR_AZMSG_MSG_LENGTH ERR_NUMBER(12, ERR_SYS_AZ_BASE) /*0x1112*/
|
||||
#define ERR_AZMSG_MSG_PID ERR_NUMBER(13, ERR_SYS_AZ_BASE) /*0x1113*/
|
||||
/*Ring Buffer*/
|
||||
/*00000001-00000002-xxxxxxxx-xxxxxxxx 0x12XX*/
|
||||
#define ERR_SYS_RB_BASE ERR_SUB_MODULE_BASE(MODULE_SYS, SYS_SUB_MODULE_RB)
|
||||
|
||||
#define ERR_RB_ERROR ERR_NUMBER(0, ERR_SYS_RB_BASE) /*0x1201*/
|
||||
#define ERR_RB_INIT ERR_NUMBER(1, ERR_SYS_RB_BASE) /*0x1201*/
|
||||
#define ERR_RB_OVERFLOW ERR_NUMBER(2, ERR_SYS_RB_BASE) /*0x1202*/
|
||||
#define ERR_RB_READ_NOTENOGH ERR_NUMBER(3, ERR_SYS_RB_BASE) /*0x1203*/
|
||||
#define ERR_RB_WRITE_NOTENOGH ERR_NUMBER(4, ERR_SYS_RB_BASE) /*0x1204*/
|
||||
#define ERR_RB_NULL_BUF ERR_NUMBER(5, ERR_SYS_RB_BASE) /*0x1205*/
|
||||
#define ERR_RB_DAMAGE ERR_NUMBER(6, ERR_SYS_RB_BASE) /*0x1206*/
|
||||
|
||||
/*Buffer Manager*/
|
||||
/*00000001-00000003-xxxxxxxx-xxxxxxxx 0x13XX*/
|
||||
#define ERR_SYS_BM_BASE ERR_SUB_MODULE_BASE(MODULE_SYS, SYS_SUB_MODULE_BM)
|
||||
|
||||
#define ERR_BM_ERROR ERR_NUMBER(0, ERR_SYS_BM_BASE) /*0x1301*/
|
||||
#define ERR_BM_INIT ERR_NUMBER(1, ERR_SYS_BM_BASE) /*0x1301*/
|
||||
#define ERR_BM_OVERFLOW ERR_NUMBER(2, ERR_SYS_BM_BASE) /*0x1302*/
|
||||
#define ERR_BM_READ_NOTENOGH ERR_NUMBER(3, ERR_SYS_BM_BASE) /*0x1303*/
|
||||
#define ERR_BM_WRITE_NOTENOGH ERR_NUMBER(4, ERR_SYS_BM_BASE) /*0x1304*/
|
||||
#define ERR_BM_INVALIDLEN ERR_NUMBER(5, ERR_SYS_BM_BASE) /*0x1304*/
|
||||
|
||||
/*Message Queue*/
|
||||
/*00000001-00000004-xxxxxxxx-xxxxxxxx 0x14XX*/
|
||||
#define ERR_SYS_MQ_BASE ERR_SUB_MODULE_BASE(MODULE_SYS, SYS_SUB_MODULE_MQ)
|
||||
/*Message Queue's Normal Error*/
|
||||
#define ERR_MQ_ERROR ERR_NUMBER(0, ERR_SYS_MQ_BASE)
|
||||
/*the Queue is invalid*/
|
||||
#define ERR_MQ_QUEUE_INVALUD ERR_NUMBER(1, ERR_SYS_MQ_BASE)
|
||||
/*no enough space to write to queue*/
|
||||
#define ERR_MQ_QUEUE_OVERFLOW ERR_NUMBER(2, ERR_SYS_MQ_BASE)
|
||||
/*the queue is empty to read */
|
||||
#define ERR_MQ_QUEUE_EMPTY ERR_NUMBER(3, ERR_SYS_MQ_BASE)
|
||||
/*the message is invalid*/
|
||||
#define ERR_MQ_MSG_INVALID ERR_NUMBER(4, ERR_SYS_MQ_BASE)
|
||||
/*the message length is null*/
|
||||
#define ERR_MQ_MSG_LEN_INVALID ERR_NUMBER(5, ERR_SYS_MQ_BASE)
|
||||
/*the buffer is invalid*/
|
||||
#define ERR_MQ_BUFFER_INVALID ERR_NUMBER(6, ERR_SYS_MQ_BASE)
|
||||
|
||||
/*thread manager*/
|
||||
#define ERR_SYS_THREAD_BASE ERR_SUB_MODULE_BASE(MODULE_SYS, SYS_SUB_MODULE_THREAD)
|
||||
|
||||
#define ERR_SYS_THREAD_MUTEX_ERROR ERR_NUMBER(0, ERR_SYS_THREAD_BASE)
|
||||
|
||||
/*------------- MMF Module Error Number Define ---------------0x31xx----------*/
|
||||
#define ERR_MMF_INPUT_BASE \
|
||||
ERR_SUB_MODULE_BASE(MODULE_MMF, MMF_SUB_MODULE_INPUT)
|
||||
|
||||
#define ERR_INPUT_STREAM_ERROR \
|
||||
ERR_NUMBER(1, ERR_MMF_INPUT_BASE) /*0x3102*/
|
||||
#define ERR_INPUT_STREAM_NOTSUPPORT \
|
||||
ERR_NUMBER(2, ERR_MMF_INPUT_BASE) /*0x3102*/
|
||||
#define ERR_INPUT_FILE_OPEN_ERROR \
|
||||
ERR_NUMBER(3, ERR_MMF_INPUT_BASE) /*0x3102*/
|
||||
|
||||
/*------------- DEMUX Module Error Number Define ---------------0x35xx--------*/
|
||||
#define ERR_MMF_DEMUX_BASE \
|
||||
ERR_SUB_MODULE_BASE(MODULE_MMF, MMF_SUB_MODULE_DEMUX)
|
||||
|
||||
#define ERR_DEMUX_STREAM_END \
|
||||
ERR_NUMBER(1, ERR_MMF_DEMUX_BASE)
|
||||
#define ERR_DEMUX_STREAM_SEEK_FAILED \
|
||||
ERR_NUMBER(2, ERR_MMF_DEMUX_BASE)
|
||||
#define ERR_DEMUX_STREAM_SEEK_NOSUPPORT \
|
||||
ERR_NUMBER(3, ERR_MMF_DEMUX_BASE)
|
||||
#define ERR_DEMUX_NO_DEMUX_INFO \
|
||||
ERR_NUMBER(4, ERR_MMF_DEMUX_BASE)
|
||||
|
||||
#define ERR_MMF_STREAM_BASE \
|
||||
ERR_SUB_MODULE_BASE(MODULE_MMF, MMF_SUB_MODULE_STREAM)
|
||||
|
||||
#define ERR_STREAM_EMPTY \
|
||||
ERR_NUMBER(1, MMF_SUB_MODULE_STREAM) /*0x3601*/
|
||||
|
||||
/*************** video decode error code define *******************/
|
||||
#define ERR_MMF_VDEC_BASE \
|
||||
ERR_SUB_MODULE_BASE(MODULE_MMF, MMF_SUB_MODULE_VDEC)
|
||||
|
||||
#define ERR_MMF_VDEC_ERROR \
|
||||
ERR_NUMBER(0, ERR_MMF_VDEC_BASE) /*0x3701*/
|
||||
|
||||
#define ERR_MMF_VDEC_HANDLE_INVALID \
|
||||
ERR_NUMBER(1, ERR_MMF_VDEC_BASE)
|
||||
|
||||
#define ERR_MMF_VDEC_DATA_INVALID \
|
||||
ERR_NUMBER(2, ERR_MMF_VDEC_BASE)
|
||||
|
||||
#define ERR_MMF_VDEC_DATATYPE_INVALID \
|
||||
ERR_NUMBER(3, ERR_MMF_VDEC_BASE)
|
||||
|
||||
#define ERR_MMF_VDEC_PAYTYPE_INVALID \
|
||||
ERR_NUMBER(4, ERR_MMF_VDEC_BASE)
|
||||
|
||||
#define ERR_MMF_VDEC_FIRST_NALU_INVALID \
|
||||
ERR_NUMBER(5, ERR_MMF_VDEC_BASE)
|
||||
|
||||
/*************** jitter buffer error code define *******************/
|
||||
#define ERR_MMF_JB_BASE \
|
||||
ERR_SUB_MODULE_BASE(MODULE_MMF, MMF_SUB_MODULE_JB)
|
||||
|
||||
|
||||
#define ERR_APP_VPAI_BASE ERR_SUB_MODULE_BASE(MODULE_APP, APP_SUB_MODULE_VAPI)
|
||||
|
||||
/* ERR_APP_VPAI_BASE */
|
||||
#define ERR_APP_VAPI_ERROR ERR_NUMBER(0, ERR_APP_VPAI_BASE)
|
||||
#define ERR_APP_VAPI_NOT_INITED ERR_NUMBER(1, ERR_APP_VPAI_BASE)
|
||||
#define ERR_APP_VAPI_INIT_FAILED ERR_NUMBER(2, ERR_APP_VPAI_BASE)
|
||||
|
||||
#define STRFMT_ERRCODE "%#010lX"
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#define XMEDIA_ERRNO(err) \
|
||||
do{ \
|
||||
(err) \
|
||||
? WRITE_LOG_DEBUG("<ERROR>%s:"STRFMT_ERRCODE"\n", #err, err ) \
|
||||
: (void)0 ; \
|
||||
return (err); \
|
||||
}while(0)
|
||||
|
||||
#else
|
||||
#define XMEDIA_ERRNO(err) return (err)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define EXIT(msg, errno) \
|
||||
WRITE_LOG_ERROR("%s exit:"STRFMT_ERRCODE"\n", msg, errno); \
|
||||
printf("[END]\n"); \
|
||||
exit(errno)
|
||||
|
||||
#else
|
||||
#define EXIT(msg, errno) \
|
||||
printf("[END]\n"); \
|
||||
(exit(errno))
|
||||
#endif
|
||||
#define XMEDIA_RETCHECK(err) \
|
||||
do{\
|
||||
(err) \
|
||||
? WRITE_LOG_DEBUG("<ERROR>%s:"STRFMT_ERRCODE"\n", #err, err ) \
|
||||
: (void)0 ; \
|
||||
exit(err);\
|
||||
}while(0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_ERROR_H__ */
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_HELP_EN_H__
|
||||
#define __XMEDIA_HELP_EN_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define MSG_CR "\n"
|
||||
|
||||
#define MSG_NEWLINE(msg) (msg MSG_CR)
|
||||
|
||||
#define MSG_FILE_NotFound "File '%s' not found."
|
||||
#define MSG_FILE_Open_Error "File '%s' open error."
|
||||
#define MSG_FILE_Open_Success "File '%s' open success."
|
||||
#define MSG_FILE_Filename_Error "File name error."
|
||||
#define MSG_THREAD_CREATE_INFO "Create Thread. name:%s, threadid:%i "
|
||||
|
||||
#define AZ_WAITREADY_TIMEOUT "Waitting for pools ready is timeout."
|
||||
#define AZ_POOLS_NOTREADY "Pools is not ready."
|
||||
|
||||
#define MSG_COMMON_NOTSUPPORT "Not support now."
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_HELP_EN_H__ */
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
#ifndef __XMEDIA_I2C_H__
|
||||
#define __XMEDIA_I2C_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef struct I2C_DATA_S
|
||||
{
|
||||
unsigned char dev_addr;
|
||||
unsigned int reg_addr;
|
||||
unsigned int addr_byte_num;
|
||||
unsigned int data;
|
||||
unsigned int data_byte_num;
|
||||
|
||||
}I2C_DATA_S ;
|
||||
|
||||
#define READ_OPERATION (1)
|
||||
#define WRITE_OPERATION 0xfe
|
||||
#define CMD_I2C_WRITE 0x01
|
||||
#define CMD_I2C_READ 0x03
|
||||
|
||||
|
||||
/* I2C_CTRL_REG */
|
||||
#define I2C_ENABLE (1 << 8)
|
||||
#define I2C_UNMASK_TOTAL (1 << 7)
|
||||
#define I2C_UNMASK_START (1 << 6)
|
||||
#define I2C_UNMASK_END (1 << 5)
|
||||
#define I2C_UNMASK_SEND (1 << 4)
|
||||
#define I2C_UNMASK_RECEIVE (1 << 3)
|
||||
#define I2C_UNMASK_ACK (1 << 2)
|
||||
#define I2C_UNMASK_ARBITRATE (1<< 1)
|
||||
#define I2C_UNMASK_OVER (1 << 0)
|
||||
#define I2C_UNMASK_ALL (I2C_UNMASK_START | I2C_UNMASK_END | \
|
||||
I2C_UNMASK_SEND | I2C_UNMASK_RECEIVE | \
|
||||
I2C_UNMASK_ACK | I2C_UNMASK_ARBITRATE | \
|
||||
I2C_UNMASK_OVER)
|
||||
|
||||
/* I2C_COM_REB */
|
||||
#define I2C_SEND_ACK (~(1 << 4))
|
||||
#define I2C_START (1 << 3)
|
||||
#define I2C_READ (1 << 2)
|
||||
#define I2C_WRITE (1 << 1)
|
||||
#define I2C_STOP (1 << 0)
|
||||
|
||||
/* I2C_ICR_REG */
|
||||
#define I2C_CLEAR_START (1 << 6)
|
||||
#define I2C_CLEAR_END (1 << 5)
|
||||
#define I2C_CLEAR_SEND (1 << 4)
|
||||
#define I2C_CLEAR_RECEIVE (1 << 3)
|
||||
#define I2C_CLEAR_ACK (1 << 2)
|
||||
#define I2C_CLEAR_ARBITRATE (1 << 1)
|
||||
#define I2C_CLEAR_OVER (1 << 0)
|
||||
#define I2C_CLEAR_ALL (I2C_CLEAR_START | I2C_CLEAR_END | \
|
||||
I2C_CLEAR_SEND | I2C_CLEAR_RECEIVE | \
|
||||
I2C_CLEAR_ACK | I2C_CLEAR_ARBITRATE | \
|
||||
I2C_CLEAR_OVER)
|
||||
|
||||
/* I2C_SR_REG */
|
||||
#define I2C_BUSY (1 << 7)
|
||||
#define I2C_START_INTR (1 << 6)
|
||||
#define I2C_END_INTR (1 << 5)
|
||||
#define I2C_SEND_INTR (1 << 4)
|
||||
#define I2C_RECEIVE_INTR (1 << 3)
|
||||
#define I2C_ACK_INTR (1 << 2)
|
||||
#define I2C_ARBITRATE_INTR (1 << 1)
|
||||
#define I2C_OVER_INTR (1 << 0)
|
||||
|
||||
int XMEDIA_I2C_WriteConfig(unsigned char dev_addr);
|
||||
int XMEDIA_I2C_Write(unsigned char dev_addr, unsigned int reg_addr,
|
||||
unsigned int addr_byte_num, unsigned int data, unsigned int data_byte_num);
|
||||
int XMEDIA_I2C_Read (unsigned char dev_addr, unsigned int reg_addr,
|
||||
unsigned int addr_byte_num, unsigned int data_byte_num);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* external variables *
|
||||
*----------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* external routine prototypes *
|
||||
*----------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* internal routine prototypes *
|
||||
*----------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* project-wide global variables *
|
||||
*----------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* module-wide global variables *
|
||||
*----------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* constants *
|
||||
*----------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* macros *
|
||||
*----------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*
|
||||
* routines' implementations *
|
||||
*----------------------------------------------*/
|
||||
|
||||
#ifndef XMEDIA_LIMIT_H__
|
||||
#define XMEDIA_LIMIT_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define INT_MAX ((int)(~0U>>1))
|
||||
#define MAXINT INT_MAX
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
#define UINT_MAX (~0U)
|
||||
#define LONG_MAX ((long)(~0UL>>1))
|
||||
#define LONG_MIN (-LONG_MAX - 1)
|
||||
#define ULONG_MAX (~0UL)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* XMEDIA_LIMIT_H__ */
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
#if !defined( XMEDIA_MESSAGE_H__ )
|
||||
#define XMEDIA_MESSAGE_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined(MULTI_TASK_LOGQUEUE)
|
||||
#ifdef OS_LINUX
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MAX_MESSAG_STRLEN 512
|
||||
typedef struct LOG_QUEUE_STRU
|
||||
{
|
||||
/** Message queue lock */
|
||||
#if defined(MULTI_TASK_LOGQUEUE)
|
||||
pthread_mutex_t mutex_lock;
|
||||
#endif
|
||||
U8 ucMinLevel;
|
||||
|
||||
LENGTH_T lenMsg;
|
||||
CHAR *pMsg;
|
||||
}LOG_QUEUE;
|
||||
|
||||
XMEDIA_RET Log_Create (IO LOG_QUEUE *pLogQueue, IN U8 minLevel, IN LENGTH_T lenMsg);
|
||||
|
||||
VOID Log_Destroy(IO LOG_QUEUE *pLogQueue );
|
||||
|
||||
|
||||
VOID Log_Msg (IO LOG_QUEUE *pLogQueue,
|
||||
IN U32 ucLogLevel,
|
||||
IN char *psz_format, ... );
|
||||
|
||||
VOID Log_MsgVa( IO LOG_QUEUE* pLogQueue,
|
||||
IN U32 ucLogLevel,
|
||||
IN const char *psz_format,IN va_list args );
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_MODULE_H__
|
||||
#define __XMEDIA_MODULE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef enum tag_MODULE
|
||||
{
|
||||
MODULE_GENERAL = 0,
|
||||
MODULE_SYS = 1 ,
|
||||
MODULE_DRV = 2 ,
|
||||
MODULE_MMF = 3, /*MultiMedia Frame*/
|
||||
MODULE_APP = 4,
|
||||
|
||||
MODULE_BUTT
|
||||
}MODULE_E;
|
||||
|
||||
typedef enum tag_SYS_SUB_MODULE
|
||||
{
|
||||
SYS_SUB_MODULE_AZ = 1, /*Arm ZSP Message Communication*/
|
||||
SYS_SUB_MODULE_RB = 2, /*Ring Buffer */
|
||||
SYS_SUB_MODULE_BM = 3, /*Buffer Manager*/
|
||||
SYS_SUB_MODULE_MQ = 4, /*Message Queue*/
|
||||
SYS_SUB_MODULE_THREAD = 5,
|
||||
SYS_SUB_MODULE_BUTT
|
||||
}SYS_SUB_MODULE;
|
||||
|
||||
typedef enum tag_DRV_SUB_MODULE
|
||||
{
|
||||
DRV_SUB_MODULE_VIU = 1, /*Video In Unit*/
|
||||
DRV_SUB_MODULE_VOU = 2, /*Video Out Unit*/
|
||||
DRV_SUB_MODULE_DSU = 3, /*DS Unit*/
|
||||
DRV_SUB_MODULE_USB = 4, /*USB*/
|
||||
DRV_SUB_MODULE_SF = 5, /*Soft Switch*/
|
||||
DRV_SUB_MODULE_TDE = 6, /*2d accelarate */
|
||||
|
||||
DRV_SUB_MODULE_BUTT
|
||||
}DRV_SUB_MODULE;
|
||||
|
||||
typedef enum tag_MMF_SUB_MODULE
|
||||
{
|
||||
MMF_SUB_MODULE_INPUT = 1,
|
||||
MMF_SUB_MODULE_DEMUX = 2,
|
||||
MMF_SUB_MODULE_MUX = 3,
|
||||
MMF_SUB_MODULE_AO = 4,
|
||||
MMF_SUB_MODULE_VO = 5,
|
||||
MMF_SUB_MODULE_STREAM = 6,
|
||||
MMF_SUB_MODULE_VDEC = 7,
|
||||
MMF_SUB_MODULE_JB = 8,
|
||||
|
||||
MMF_SUB_MODULE_BUTT
|
||||
}MMF_SUB_MODULE;
|
||||
|
||||
typedef enum tag_APP_SUB_MODULE
|
||||
{
|
||||
APP_SUB_MODULE_VAPI = 1,
|
||||
|
||||
APP_SUB_MODULE_BUTT
|
||||
}APP_SUB_MODULE;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_MODULE_H__ */
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_OS_H__
|
||||
#define __XMEDIA_OS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(OS_WINCE)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN32)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#define _UNUSED_FUNC __attribute__ ((unused))
|
||||
#define _UNUSED_VAR __attribute__ ((unused))
|
||||
|
||||
/*
|
||||
int xxx() _NOWARN_UNUSED;
|
||||
|
||||
int _NOWARN_UNUSED YYY()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
#define _NOWARN_UNUSED _UNUSED_FUNC
|
||||
#endif
|
||||
|
||||
#if defined(OS_VXWORKS)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_OS_H__ */
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
#ifndef __XMEDIA_SPI_H__
|
||||
#define __XMEDIA_SPI_H__
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/* User space versions of kernel symbols for SPI clocking modes,
|
||||
* matching <linux/spi/spi.h>
|
||||
*/
|
||||
|
||||
#define SPI_CPHA 0x01
|
||||
#define SPI_CPOL 0x02
|
||||
|
||||
#define SPI_MODE_0 (0|0)
|
||||
#define SPI_MODE_1 (0|SPI_CPHA)
|
||||
#define SPI_MODE_2 (SPI_CPOL|0)
|
||||
#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
|
||||
|
||||
#define SPI_CS_HIGH 0x04
|
||||
#define SPI_LSB_FIRST 0x08
|
||||
#define SPI_3WIRE 0x10
|
||||
#define SPI_LOOP 0x20
|
||||
#define SPI_NO_CS 0x40
|
||||
#define SPI_READY 0x80
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/* IOCTL commands */
|
||||
|
||||
#define SPI_IOC_MAGIC 'k'
|
||||
|
||||
/**
|
||||
* struct spi_ioc_transfer - describes a single SPI transfer
|
||||
* @tx_buf: Holds pointer to userspace buffer with transmit data, or null.
|
||||
* If no data is provided, zeroes are shifted out.
|
||||
* @rx_buf: Holds pointer to userspace buffer for receive data, or null.
|
||||
* @len: Length of tx and rx buffers, in bytes.
|
||||
* @speed_hz: Temporary override of the device's bitrate.
|
||||
* @bits_per_word: Temporary override of the device's wordsize.
|
||||
* @delay_usecs: If nonzero, how long to delay after the last bit transfer
|
||||
* before optionally deselecting the device before the next transfer.
|
||||
* @cs_change: True to deselect device before starting the next transfer.
|
||||
*
|
||||
* This structure is mapped directly to the kernel spi_transfer structure;
|
||||
* the fields have the same meanings, except of course that the pointers
|
||||
* are in a different address space (and may be of different sizes in some
|
||||
* cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel).
|
||||
* Zero-initialize the structure, including currently unused fields, to
|
||||
* accommodate potential future updates.
|
||||
*
|
||||
* SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync().
|
||||
* Pass it an array of related transfers, they'll execute together.
|
||||
* Each transfer may be half duplex (either direction) or full duplex.
|
||||
*
|
||||
* struct spi_ioc_transfer mesg[4];
|
||||
* ...
|
||||
* status = ioctl(fd, SPI_IOC_MESSAGE(4), mesg);
|
||||
*
|
||||
* So for example one transfer might send a nine bit command (right aligned
|
||||
* in a 16-bit word), the next could read a block of 8-bit data before
|
||||
* terminating that command by temporarily deselecting the chip; the next
|
||||
* could send a different nine bit command (re-selecting the chip), and the
|
||||
* last transfer might write some register values.
|
||||
*/
|
||||
struct spi_ioc_transfer {
|
||||
__u64 tx_buf;
|
||||
__u64 rx_buf;
|
||||
|
||||
__u32 len;
|
||||
__u32 speed_hz;
|
||||
|
||||
__u16 delay_usecs;
|
||||
__u8 bits_per_word;
|
||||
__u8 cs_change;
|
||||
__u32 pad;
|
||||
|
||||
/* If the contents of 'struct spi_ioc_transfer' ever change
|
||||
* incompatibly, then the ioctl number (currently 0) must change;
|
||||
* ioctls with constant size fields get a bit more in the way of
|
||||
* error checking than ones (like this) where that field varies.
|
||||
*
|
||||
* NOTE: struct layout is the same in 64bit and 32bit userspace.
|
||||
*/
|
||||
};
|
||||
|
||||
/* not all platforms use <asm-generic/ioctl.h> or _IOC_TYPECHECK() ... */
|
||||
#define SPI_MSGSIZE(N) \
|
||||
((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \
|
||||
? ((N)*(sizeof (struct spi_ioc_transfer))) : 0)
|
||||
#define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)])
|
||||
|
||||
|
||||
/* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) */
|
||||
#define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8)
|
||||
#define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8)
|
||||
|
||||
/* Read / Write SPI bit justification */
|
||||
#define SPI_IOC_RD_LSB_FIRST _IOR(SPI_IOC_MAGIC, 2, __u8)
|
||||
#define SPI_IOC_WR_LSB_FIRST _IOW(SPI_IOC_MAGIC, 2, __u8)
|
||||
|
||||
/* Read / Write SPI device word length (1..N) */
|
||||
#define SPI_IOC_RD_BITS_PER_WORD _IOR(SPI_IOC_MAGIC, 3, __u8)
|
||||
#define SPI_IOC_WR_BITS_PER_WORD _IOW(SPI_IOC_MAGIC, 3, __u8)
|
||||
|
||||
/* Read / Write SPI device default max speed hz */
|
||||
#define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32)
|
||||
#define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32)
|
||||
|
||||
|
||||
|
||||
#endif /* __XMEDIA_SPI_H__ */
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_THREAD_H__
|
||||
#define __XMEDIA_THREAD_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
#include <bsp_defs.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef pthread_mutex_t XMEDIA_THREAD_MUTEX ;
|
||||
typedef pthread_mutexattr_t XMEDIA_THREAD_MUTEXATTR;
|
||||
|
||||
typedef pthread_cond_t XMEDIA_THREAD_COND;
|
||||
typedef pthread_condattr_t XMEDIA_THREAD_CONDATTR;
|
||||
|
||||
typedef struct XMEDIA_SYNC_STRU
|
||||
{
|
||||
#if defined(SYNC_USE_COND)
|
||||
XMEDIA_THREAD_MUTEX _mutex;
|
||||
XMEDIA_THREAD_COND _cond;
|
||||
#else
|
||||
sem_t _sem;
|
||||
#endif
|
||||
}XMEDIA_SYNC_T;
|
||||
|
||||
#define MAX_THREAD_NAME_LEN 16
|
||||
|
||||
typedef int XMEDIA_PRIORITY_T;
|
||||
|
||||
typedef char THREAD_NAME[MAX_THREAD_NAME_LEN];
|
||||
|
||||
typedef VOID* (*THREAD_RUN)(VOID* );
|
||||
|
||||
typedef struct XMEDIA_THREAD_STRU
|
||||
{
|
||||
THREAD_NAME szThreadName;
|
||||
/**/
|
||||
pthread_t threadid;
|
||||
|
||||
pid_t pid;
|
||||
|
||||
XMEDIA_PRIORITY_T priority;
|
||||
|
||||
THREAD_RUN pf_run;
|
||||
|
||||
BOOL bStart;
|
||||
|
||||
XMEDIA_THREAD_COND cond_start;
|
||||
XMEDIA_THREAD_MUTEX mutex_cond_start;
|
||||
|
||||
VOID* args;
|
||||
}XMEDIA_THREAD_T;
|
||||
|
||||
EXTERNFUNC XMEDIA_RET bsp_thread_init(XMEDIA_THREAD_T *pThread, const char* szName,
|
||||
THREAD_RUN pf, INT32 priority, BOOL bStart);
|
||||
|
||||
VOID* bsp_thread_run_handle(VOID* arg);
|
||||
|
||||
EXTERNFUNC void bsp_delay(U32 ulUsDelay);
|
||||
|
||||
/*__wait is TRUE, not run when create , wait cond_start to run*/
|
||||
EXTERNFUNC INT32 bsp_thread_create(XMEDIA_THREAD_T *pThread,const pthread_attr_t*__attr,
|
||||
void*__arg);
|
||||
|
||||
EXTERNFUNC INT32 bsp_thread_join(XMEDIA_THREAD_T *pThread, void **thread_return);
|
||||
|
||||
EXTERNFUNC INT32 XMEDIA_THREAD_Start(XMEDIA_THREAD_T *pThread);
|
||||
|
||||
EXTERNFUNC INT32 bsp_thread_pause(XMEDIA_THREAD_T *pThread);
|
||||
|
||||
EXTERNFUNC INT32 bsp_thread_cancel(XMEDIA_THREAD_T *pThread);
|
||||
EXTERNFUNC VOID bsp_thread_setid(XMEDIA_THREAD_T *pThread);
|
||||
|
||||
EXTERNFUNC VOID bsp_thread_setpriority(XMEDIA_THREAD_T *pThread, XMEDIA_PRIORITY_T prio);
|
||||
|
||||
/*** ------------------------------------ ***/
|
||||
EXTERNFUNC INT32 bsp_thread_mutex_init(XMEDIA_THREAD_MUTEX* pMutex, XMEDIA_THREAD_MUTEXATTR* pMutexattr);
|
||||
|
||||
EXTERNFUNC INT32 bsp_thread_mutex_lock(XMEDIA_THREAD_MUTEX* pMutex);
|
||||
|
||||
EXTERNFUNC INT32 bsp_thread_mutex_trylock(XMEDIA_THREAD_MUTEX* pMutex);
|
||||
|
||||
EXTERNFUNC INT32 bsp_thread_mutex_unlock(XMEDIA_THREAD_MUTEX* pMutex);
|
||||
|
||||
EXTERNFUNC INT32 bsp_thread_mutex_destroy(XMEDIA_THREAD_MUTEX* pMutex);
|
||||
|
||||
/*** ------------------------------------ ***/
|
||||
EXTERNFUNC INT32 bsp_thread_cond_init(XMEDIA_THREAD_COND* pCond, XMEDIA_THREAD_CONDATTR* pCondattr);
|
||||
EXTERNFUNC INT32 bsp_thread_cond_signal(XMEDIA_THREAD_COND* pCond);
|
||||
EXTERNFUNC INT32 bsp_thread_cond_broadcast(XMEDIA_THREAD_COND* pCond);
|
||||
EXTERNFUNC INT32 bsp_thread_cond_wait(XMEDIA_THREAD_COND* pCond, XMEDIA_THREAD_MUTEX *pMutex, U32 msecs);
|
||||
EXTERNFUNC INT32 bsp_thread_cond_destroy(XMEDIA_THREAD_COND* pCond);
|
||||
|
||||
#define DEFAULT_PRIORITY 0
|
||||
#define THREAD_PRIORITY_AUDIO 0
|
||||
#define THREAD_PRIORITY_AZ 10
|
||||
|
||||
#define THREAD_SLEEP(msec) usleep(msec * 1000)
|
||||
/*#define THREAD_SLEEP(msec) */
|
||||
|
||||
/*** -------------------------------------***/
|
||||
EXTERNFUNC XMEDIA_RET bsp_sync_create(IO XMEDIA_SYNC_T *pWait);
|
||||
EXTERNFUNC XMEDIA_RET bsp_sync_wait(IO XMEDIA_SYNC_T *pWait, IN U32 msec);
|
||||
EXTERNFUNC XMEDIA_RET bsp_sync_notify(IO XMEDIA_SYNC_T *pWait);
|
||||
EXTERNFUNC XMEDIA_RET bsp_sync_destroy(IO XMEDIA_SYNC_T *pWait);
|
||||
|
||||
#if defined(DEBUG)
|
||||
#define SYNC_WAIT(pSync, msec, pStr) \
|
||||
if (pStr) \
|
||||
WRITE_LOG_DEBUG(pStr); \
|
||||
bsp_sync_wait(pSync, msec)
|
||||
|
||||
#define SYNC_NOTIFY(pSync, msec, pStr) \
|
||||
if (pStr) \
|
||||
WRITE_LOG_DEBUG(pStr); \
|
||||
bsp_sync_notify(pSync)
|
||||
#else
|
||||
#define SYNC_WAIT(pSync, msec, pStr) \
|
||||
bsp_sync_wait(pSync, msec)
|
||||
|
||||
#define SYNC_NOTIFY(pSync, msec, pStr) \
|
||||
bsp_sync_notify(pSync)
|
||||
#endif
|
||||
|
||||
/*__wait is TRUE, not run when create , wait cond_start to run*/
|
||||
#define XMEDIA_THREAD_CREATE (pThread, __attr, __arg)\
|
||||
bsp_thread_create(pThread, __attr, __arg)
|
||||
|
||||
#define XMEDIA_THREAD_JOIN(pThread, ppthread_return) \
|
||||
bsp_thread_join(pThread, ppthread_return)
|
||||
|
||||
#define XMEDIA_THREAD_START(pThread) \
|
||||
XMEDIA_THREAD_Start(pThread)
|
||||
|
||||
#define XMEDIA_THREAD_PAUSE(pThread) \
|
||||
bsp_thread_pause(pThread)
|
||||
|
||||
#define XMEDIA_THREAD_SETID(pThread) \
|
||||
bsp_thread_setid(pThread)
|
||||
|
||||
#define XMEDIA_THREAD_SETPRIORITY(pThread ,prio) \
|
||||
bsp_thread_setpriority(pThread ,prio)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_THREAD_H__ */
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
*/
|
||||
#ifndef __XMEDIA_TYPE_H__
|
||||
#define __XMEDIA_TYPE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined( OS_VXWORKS) /* there is a same typedef in vxworks for U8 */
|
||||
typedef unsigned char U8;
|
||||
#endif
|
||||
typedef unsigned short U16;
|
||||
typedef unsigned long U32;
|
||||
typedef unsigned long long U64;
|
||||
|
||||
typedef char S8;
|
||||
typedef short S16;
|
||||
typedef long S32;
|
||||
typedef long long S64;
|
||||
|
||||
typedef char INT8;
|
||||
typedef short INT16;
|
||||
typedef int INT32;
|
||||
typedef char CHAR;
|
||||
typedef char* PCHAR;
|
||||
#if 0
|
||||
typedef U8 B8;
|
||||
typedef U16 B16;
|
||||
typedef U32 B32;
|
||||
#endif
|
||||
|
||||
typedef float FLOAT;
|
||||
typedef double DOUBLE;
|
||||
typedef void VOID;
|
||||
typedef unsigned char UCHAR;
|
||||
typedef unsigned char UINT8;
|
||||
typedef unsigned short UINT16;
|
||||
typedef unsigned long UINT32;
|
||||
typedef unsigned long ULONG;
|
||||
|
||||
typedef U16 ZWORD;
|
||||
typedef U32 ZDWORD;
|
||||
typedef U32 ZLENGTH;
|
||||
typedef U32 ZSIZE;
|
||||
|
||||
#define LEN_Z2C(len) (len+len)
|
||||
|
||||
#define LEN_C2Z(len) (len >> 1)
|
||||
typedef unsigned long PHY_ADDR;
|
||||
typedef unsigned long VADDR;
|
||||
|
||||
typedef void* PVOID;
|
||||
typedef void* PTR;
|
||||
|
||||
#define INVALID_ADDR 0
|
||||
/*File descriptor*/
|
||||
typedef int FD;
|
||||
|
||||
typedef unsigned long LENGTH_T;
|
||||
typedef unsigned long size_type;
|
||||
typedef unsigned long SIZE_T;
|
||||
typedef unsigned long COUNT_T;
|
||||
|
||||
#if !defined(OFF_T)
|
||||
typedef unsigned long OFF_T ;
|
||||
#endif
|
||||
|
||||
typedef long SOFF_T;//by hhm
|
||||
|
||||
typedef unsigned long XMEDIA_RET;
|
||||
|
||||
#define MAX_FILENAME_LENGTH 128
|
||||
typedef char FILENAME_T[MAX_FILENAME_LENGTH];
|
||||
|
||||
typedef char CHECKNAME_T[32];
|
||||
typedef char IPADDRESS_T[32]; //add by ququ
|
||||
|
||||
/*#define EMPTY_VAR U32 null_var*/
|
||||
#define EMPTY_VAR unsigned int xyz
|
||||
|
||||
/* Vxworks defined BOOL type */
|
||||
#if !defined(BOOL) && !defined(OS_VXWORKS)
|
||||
#define BOOL U8
|
||||
#endif
|
||||
|
||||
#ifdef TRUE
|
||||
#undef TRUE
|
||||
#endif
|
||||
#define TRUE 0x1
|
||||
|
||||
#ifdef FALSE
|
||||
#undef FALSE
|
||||
#endif
|
||||
#define FALSE 0x0L
|
||||
|
||||
#define YES 0x1
|
||||
#define NO 0x0L
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (U32)0x0L
|
||||
#endif
|
||||
|
||||
/* *DO NOT* type like : if(XMEDIA_OK)*/
|
||||
#define XMEDIA_OK 0
|
||||
#define XMEDIA_ERROR (1)
|
||||
|
||||
#define XMEDIA_SUCCESS 0
|
||||
#define XMEDIA_FAILURE 1
|
||||
|
||||
#define XMEDIA_RET_NOT_DEFINED 0
|
||||
|
||||
#define AV_MALLOC(sizeLen) malloc(sizeLen)
|
||||
#define AV_MALLOC_ALIGN(ucAlign, sizeLen) malloc(sizeLen)
|
||||
|
||||
typedef void* AV_PTR;
|
||||
typedef void* VIDEO_PTR;
|
||||
typedef void* AUDIO_PTR;
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 1024
|
||||
#endif
|
||||
|
||||
/*typedef char[MAXPATHLEN] FILENAME_T;*/
|
||||
|
||||
#define MAX_POOL_NAME_LEN 16
|
||||
typedef char POOL_NAME[MAX_POOL_NAME_LEN];
|
||||
|
||||
typedef unsigned long long PTS_TIME;
|
||||
|
||||
typedef struct PVADDR_STRU
|
||||
{
|
||||
VOID* pvAddr;/*point of virtual address*/
|
||||
PHY_ADDR phyAddr; /*phy address*/
|
||||
}PVADDR_T;
|
||||
|
||||
typedef struct ADDRINFO_STRU
|
||||
{
|
||||
PHY_ADDR phyAddrStart;
|
||||
SIZE_T sizeAddr;
|
||||
}ADDRINFO_T;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_TYPE_H__ */
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef XMEDIA_LIMIT_H__
|
||||
#define XMEDIA_LIMIT_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* XMEDIA_LIMIT_H__ */
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __XMEDIA_VERSION_H__
|
||||
#define __XMEDIA_VERSION_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdio.h>
|
||||
typedef unsigned long XMEDIA_VERSION_T;
|
||||
|
||||
/*
|
||||
Version define
|
||||
31 24 23 16 15 0
|
||||
-----------------------------------------------
|
||||
| major | minor | build number |
|
||||
-----------------------------------------------
|
||||
*/
|
||||
|
||||
#define VERSION_CODE(major, minor, build) \
|
||||
( ((major) << 24) | ((minor) << 16) | (build) )
|
||||
|
||||
#define VERSION_CODE_MAJOR(v) ((v) >> 24)
|
||||
#define VERSION_CODE_MINOR(v) (((v) >> 16) & 0xFF)
|
||||
#define VERSION_CODE_BUILD(v) ((v) & 0xFFFF )
|
||||
|
||||
#define MMPLIB_VER_MAJOR 0L
|
||||
#define MMPLIB_VER_MINOR 6L
|
||||
#define MMPLIB_VER_BUILD 0106L
|
||||
#define MMPLIB_BUILD_DATE "20060415-V100ITr1"
|
||||
|
||||
#define MMPLIB_VER_EXTFLAG 0
|
||||
|
||||
#define GET_MMPLIB_VER VERSION_CODE(MMPLIB_VER_MAJOR, MMPLIB_VER_MINOR,MMPLIB_VER_BUILD )
|
||||
|
||||
#define VERSTF_SIZE 64
|
||||
static inline const char* MMPLIB_VER_STR()
|
||||
{
|
||||
static char verstr[VERSTF_SIZE];
|
||||
sprintf(verstr, "%02lu.%02lu.%04lu build:%s",
|
||||
MMPLIB_VER_MAJOR,
|
||||
MMPLIB_VER_MINOR,
|
||||
MMPLIB_VER_BUILD,
|
||||
MMPLIB_BUILD_DATE
|
||||
);
|
||||
return ( (char*)verstr );
|
||||
}
|
||||
|
||||
static inline const char* bsp_version_str(XMEDIA_VERSION_T v)
|
||||
{
|
||||
static char verstr[VERSTF_SIZE];
|
||||
sprintf(verstr, "%02lu.%02lu.%04lu ",
|
||||
VERSION_CODE_MAJOR(v),
|
||||
VERSION_CODE_MINOR(v),
|
||||
VERSION_CODE_BUILD(v)
|
||||
);
|
||||
return verstr;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __XMEDIA_VERSION_H__ */
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _GPIO_I2C_H
|
||||
#define _GPIO_I2C_H
|
||||
|
||||
|
||||
#define GPIO_I2C_READ 0x01
|
||||
#define GPIO_I2C_WRITE 0x03
|
||||
typedef unsigned char byte;
|
||||
|
||||
unsigned char gpio_i2c_read(unsigned char devaddress, unsigned char address);
|
||||
void gpio_i2c_write(unsigned char devaddress, unsigned char address, unsigned char value);
|
||||
byte siiReadSegmentBlockEDID(byte SlaveAddr, byte Segment, byte Offset, byte *Buffer, byte Length);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _UAPI_LINUX_I2C_DEV_H
|
||||
#define _UAPI_LINUX_I2C_DEV_H
|
||||
|
||||
/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
|
||||
* unsigned long, except for:
|
||||
* - I2C_FUNCS, takes pointer to an unsigned long
|
||||
* - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
|
||||
* - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
|
||||
*/
|
||||
#define I2C_RETRIES 0x0701 /* number of times a device address should
|
||||
be polled when not acknowledging */
|
||||
#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
|
||||
|
||||
/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
|
||||
* are NOT supported! (due to code brokenness)
|
||||
*/
|
||||
#define I2C_SLAVE 0x0703 /* Use this slave address */
|
||||
#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
|
||||
is already in use by a driver! */
|
||||
#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
|
||||
|
||||
#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
|
||||
|
||||
#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
|
||||
|
||||
#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
|
||||
#define I2C_SMBUS 0x0720 /* SMBus transfer */
|
||||
#define I2C_16BIT_REG 0x0709 /* 16BIT REG WIDTH */
|
||||
#define I2C_16BIT_DATA 0x070a /* 16BIT DATA WIDTH */
|
||||
|
||||
/* This is the structure as used in the I2C_RDWR ioctl call */
|
||||
struct i2c_rdwr_ioctl_data {
|
||||
struct i2c_msg *msgs; /* pointers to i2c_msgs */
|
||||
__u32 nmsgs; /* number of i2c_msgs */
|
||||
};
|
||||
|
||||
#define I2C_RDRW_IOCTL_MAX_MSGS 42
|
||||
|
||||
|
||||
#endif /* _UAPI_LINUX_I2C_DEV_H */
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) XMEDIA. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __MMPVER_H__
|
||||
#define __MMPVER_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
USE_GLOBALVAR XMEDIA_VERSION_T g_mmplib_ver;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __MMPVER_H__ */
|
||||
Reference in New Issue
Block a user