| Pre-process Video Device Mode |
typedef struct _ST_PP_VDO_MODE {
EN_PXL_FMT enPxlFmt;
STF_UINT uiHeight;
STF_UINT uiWidth;
STF_UINT uiAddr;
} ST_PP_VDO_MODE, *PST_PP_VDO_MODE;
|
- enPxlFmt: Pixel format
- uiHeight: Image height
- uiWidth: Image width
- uiAddr: Buffer address
|
| Pre-process Mod |
typedef struct _ST_PP_MODE {
STF_U8 u8Id;
bool bBusOut;
bool bFifoOut;
bool bInitialized;
ST_PP_VDO_MODE stPpVdoModeSrc;
ST_PP_VDO_MODE stPpVdoModeDst;
} ST_PP_MODE, *PST_PP_MODE;
|
- u8Id: Pre-process ID
- bBusOut: Indicates the pre-process output image
data to DDR
- bFifoOut: Indicates the pre-process output image
data to LCDC
- bInitialized: Indicates the pre-process is
initialized
- stPpVdoModeSrc: Stores the video device mode
information of the source of the pre-proces
- stPpVdoModeDst: Stores the video device mode
information of the destination of the pre-process
|
| DRM Buffer |
typedef struct _ST_DRM_BUF {
STF_U32 u32Pitch;
STF_U32 u32Size;
STF_U32 u32FbId;
STF_INT nDmaBufFd; // Used for DMA_BUF
STF_INT nBufObjHandle;
STF_U8 *pu8Buf;
} ST_DRM_BUF, *PST_DRM_BUF;
|
-
- u32Pitch: The pitch of dumb buffer
- u32Size: Dumb buffer size
- u32FbId: The index of frame buffer
- nDmaBufFd: The file descriptor for the
DMA buffer
- nBufObjHandle: The object handle of the
dumb buffer
- pu8Buf: The dumb buffer pointer
|
| DRM Device |
typedef struct _ST_DRM_DEV {
STF_U32 u32ConnId;
STF_U32 u32EncId;
STF_U32 u32CrtId;
STF_U32 u32Width;
STF_U32 u32Height;
STF_U32 u32Pitch;
drmModeModeInfo stDrmModeInfo;
drmModeCrtc *pstDrmCrtc;
STF_U32 u32DrmFormat;
ST_DRM_BUF stDrmBuf[PIPELINE_IMG_BUF_MAX];
ST_DRM_DEV *pstDrmDevNext;
} ST_DRM_DEV, *PST_DRM_DEV;
|
- u32ConnId: The connector id of DRM device
- u32EncId: Stores encoder ID
- u32CrtId: Stores selected CRT ID
- u32Width: Stores the width of DRM device
- u32Height: Stores the height of DRM device
- u32Pitch: Stores the pitch information of
buffer
- stDrmModeInfo: Stores the mode information of DRM
device
- pstDrmCrtc: Stores the context information of CRT
device
- u32DrmFormat: Stores the format information of
DRM device
- stDrmBuf: Stores the buffer information of DRM
device
- pstDrmDevNext: Points to the next DRM device
|
| DMA Buffer Information |
typedef struct _ST_DMA_BUF_INFO {
STF_INT nDmaBufFd;
STF_VOID *pvBuffer;
} ST_DMA_BUF_INFO, *PST_DMA_BUF_INFO;
|
- nDmaBufFd: DMA buffer file descriptor
- pvBuffer: Points to the user space buffer
|
| Video Device Buffer |
typedef struct _ST_VDO_BUF {
STF_U32 u32Index;
STF_INT nDmaBufFd;
STF_U32 u32Length;
STF_VOID *pvBuffer;
} ST_VDO_BUF, *PST_VDO_BUF;
|
- u32Index: Buffer index
- nDmaBufFd: DMA buffer file descriptor
- u32Length: DMA buffer size
- pvBuffer: Points to user space buffer
|
| Video Memory |
typedef union _ST_VDO_MEM {
STF_U8 u8BufIdx;
STF_INT nDmaBufFd;
STF_U32 u32Length;
STF_VOID *pvBuffer;
STF_U32 u32BytesUsed;
struct timeval stTimeStamp;
STF_BOOL8 bIsScDumpForAe;
CI_MEM_PARAM *pstMem1;
CI_MEM_PARAM *pstMem2;
sCell_T stCell;
} ST_VDO_MEM, *PST_VDO_MEM;
|
-
- u8BufIdx: Buffer index
- nDmaBufFd: DMA buffer file
descriptor
- u32Length: DMA buffer size
- pvBuffer: Points to user space
buffer
- u32BytesUsed: Indicates how many bytes be
used to store image data
- stTimeStamp: Stores the timestamp
information
- bIsScDumpForAe: Indicates that this
buffer is ready for AE or AWB
- pstMem1: Points to user space buffer
segment 1
- pstMem2: Points to user space buffer
segment 2
- stCell: Links list data structure
|
| Video Memory Table |
typedef struct _ST_VDO_MEM_TBL {
STF_U32 u32Count;
ST_VDO_MEM *pstVdoMem;
} ST_VDO_MEM_TBL, *PST_VDO_MEM_TBL;
|
- u32Count: Indicates the amount of video memory in
this table
- pstVdoMem: Video memory array
|
| Item Information Table |
typedef struct _ST_ITEM_INFO {
STF_U8 u8Cnt;
STF_U8 u8Idx;
STF_CHAR szInfo[ITEM_INFO_MAX][128];
} ST_ITEM_INFO , *PST_ITEM_INFO;
|
-
- u8Cnt: Indicates the amount of items in
this table
- u8Idx: Not used
- szInfo: Storage array of char type string
information
|
| Video Buffer Information |
typedef struct _ST_VDO_BUF_INFO {
STF_U8 u8BufIdx;
STF_BOOL8 bIsScDumpForAe;
STF_U32 u32BytesUsed;
struct timeval stTimeStamp;
} ST_VDO_BUF_INFO, *PST_VDO_BUF_INFO;
|
- u8BufIdx: Buffer index
- bIsScDumpForAe: Indicates that this buffer is
ready for AE or AWB
- u32BytesUsed: Indicates the number of bytes used
to store image data
- stTimeStamp: Stores the timestamp
information
|
| Frame Buffer Device Parameter |
typedef struct _ST_FB_DEV_PARAM {
STF_U16 u16Width;
STF_U16 u16Height;
STF_U32 u32Bpp;
STF_U32 u32ScreenSize;
STF_U32 u32PixelFormat;
STF_VOID *pvBuffer;
struct fb_var_screeninfo stFbVarScreenInfo;
struct fb_fix_screeninfo stFbFixScreenInfo;
} ST_FB_DEV_PARAM, *PST_FB_DEV_PARAM;
|
- u16Width: The width of frame buffer
- u16Height: The height of frame buffer
- u32Bpp: The bits per pixel
- u32ScreenSize: The screen buffer size
- u32PixelFormat: The pixel format
- pvBuffer: Points to user space buffer
- stFbVarScreenInfo: Stores variable screen
information
- stFbFixScreenInfo: Stores fixed screen
information
|
| Pre-process Device Parameter |
typedef struct _ST_PP_DEV_PARAM {
STF_U32 u32PixelFormat;
} ST_PP_DEV_PARAM, *PST_PP_DEV_PARAM;
|
- u32PixelFormat: Pixel format
|
| DRM Device Parameter |
typedef struct _ST_DRM_DEV_PARAM {
STF_U16 u16Width;
STF_U16 u16Height;
STF_U32 u32PixelFormat;
STF_U32 u32BufCount;
STF_INT nConnectorId;
ST_DRM_DEV *pstDrmDevHead;
} ST_DRM_DEV_PARAM, *PST_DRM_DEV_PARAM;
|
- u16Width: The width of DRM buffer
- u16Height: The height of DRM buffer
- u32PixelFormat: The pixel format
- u32BufCountIndicate: The amount of DRM
buffers
- nConnectorId: The connector id of DRM device
- pstDrmDevHead: Points to the head of the DRM
device list
|
| Video Device Parameter |
typedef struct _ST_VDEV_PARAM {
STF_BOOL8 bForceGenDev;
STF_BOOL8 bIsVideoOut;
STF_BOOL8 bStreamOn;
STF_BOOL8 bIsDmaBufAllocFromDrmDev;
STF_U16 u16Width;
STF_U16 u16Height;
STF_U32 u32PixelFormat;
STF_BOOL8 bCrop;
ST_RECT_2 stCropRect;
STF_U8 u8Fps;
ST_VDO_MEM_TBL stVdoMemTbl;
pthread_mutex_t stBufLock;
pthread_mutex_t stListLock;
sLinkedList_T stAvailableQueue;
sLinkedList_T stCompletedQueue;
} ST_VDEV_PARAM, *PST_VDEV_PARAM;
|
- bForceGenDev: Indicates that this video device
will initialize as generic device
- bIsVideoOut: Indicates that this video device is
an output or capture device
- bStreamOn: Indicates that this video device is
stream on or off
- bIsDmaBufAllocFromDrmDev: Indicates that the
video buffer is allocated by DRM or video device
- u16Width: The width of video buffer
- u16Height: The height of video buffer
- u32PixelFormat: The pixel format
- bCrop: Indicates whether the capture window is
crop
- stCropRect: Stores the crop area information
- u8Fps: Indicates frames per second
- stVdoMemTbl Video memory table
- stBufLock: For the video buffer operation
protection
- stListLock: For the link list operation
protection
- stAvailableQueue: Queue of available video
buffers for video device
- stCompletedQueue: Queue of completed video
buffers for post processing
|
| Basic Device |
typedef struct _ST_CI_DEVICE {
CI_CONNECTION *pstCiConnection;
STF_U8 u8DeviceId;
STF_U8 u8DeviceType;
STF_CHAR szDeviceName[DEV_NAME_LEN_MAX];
STF_S32 s32CiConnections;
STF_BOOL8 bConnected;
EN_MEM_TYPE enMemType;
STF_VOID *pvDevParam;
STF_RESULT (*Destroy)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*Connection)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*Disconnect)(ST_CI_DEVICE *pstDevice);
STF_BOOL8 (*IsConnected)(ST_CI_DEVICE *pstDevice);
STF_S32 (*GetConnections)(ST_CI_DEVICE *pstDevice);
CI_CONNECTION *(*GetConnection)(ST_CI_DEVICE *pstDevice);
int (*GetFileHandle)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*SubscribeEvent)(ST_CI_DEVICE *pstDevice, STF_S32 s32EventType);
STF_RESULT (*UnsubscribeEvent)(ST_CI_DEVICE *pstDevice, STF_S32 s32EventType);
STF_RESULT (*DequeueEvent)(ST_CI_DEVICE *pstDevice, struct v4l2_event *pstEvent);
STF_RESULT (*InitDevice)(ST_CI_DEVICE *pstDevice, STF_U32 u32PixelFormat);
STF_U32 (*GetPixelFormat)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*SetPixelFormat)(ST_CI_DEVICE *pstDevice, STF_U32 u32PixelFormat);
struct v4l2_rect (*QueryCropWin)(ST_CI_DEVICE *pstDevice);
ST_RECT (*QueryCropWin_2)(ST_CI_DEVICE *pstDevice);
struct v4l2_rect (*GetCropWin)(ST_CI_DEVICE *pstDevice);
ST_RECT (*GetCropWin_2)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*SetCropWin)(ST_CI_DEVICE *pstDevice, struct v4l2_rect *pstRect);
STF_RESULT (*SetCropWin_2)(ST_CI_DEVICE *pstDevice, ST_RECT *pstRect);
STF_RESULT (*EnumFormat)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*GetFormat)(ST_CI_DEVICE *pstDevice, struct v4l2_format *pstFormat);
STF_RESULT (*SetFormat)(ST_CI_DEVICE *pstDevice, STF_U16 u16Width, STF_U16 u16Height, STF_U32 u32PixelFormat);
STF_RESULT (*TryFormat)(ST_CI_DEVICE *pstDevice, STF_U32 u32PixelFormat);
STF_RESULT (*GetParam)(ST_CI_DEVICE *pstDevice, STF_U32 *pu32Numerator, STF_U32 *pu32Denominator);
STF_RESULT (*SetParam)(ST_CI_DEVICE *pstDevice, STF_U32 u32Numerator, STF_U32 u32Denominator);
STF_RESULT (*SetParam_2)(ST_CI_DEVICE *pstDevice, STF_U32 u32FPS);
struct v4l2_rect (*GetSelection)(ST_CI_DEVICE *pstDevice);
ST_RECT (*GetSelection_2)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*SetSelection)(ST_CI_DEVICE *pstDevice, struct v4l2_rect *pstRect);
STF_RESULT (*SetSelection_2)(ST_CI_DEVICE *pstDevice, ST_RECT *pstRect);
STF_RESULT (*SetStreamOn)(ST_CI_DEVICE *pstDevice, STF_BOOL8 bOn);
STF_BOOL8 (*IsStreamOn)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*AllocateBuf)(ST_CI_DEVICE *pstDevice, STF_U32 u32Count, STF_BOOL8 bMmap, STF_BOOL8 bExport, ST_DMA_BUF_INFO *pstDmaBufInfo);
STF_RESULT (*AllocateAndEnqueueBuf)(ST_CI_DEVICE *pstDevice, STF_U32 u32AllocateCount, STF_U32 u32EnqueueCount, STF_BOOL8 bMmap, STF_BOOL8 bExport, ST_DMA_BUF_INFO *pstDmaBufInfo);
ST_VDO_MEM *(*GetBuffer)(ST_CI_DEVICE *pstDevice, STF_U32 u32Index);
ST_VDO_BUF (*GetBufInfo)(ST_CI_DEVICE *pstDevice, STF_U32 u32Index);
STF_RESULT (*EnqueueBuf)(ST_CI_DEVICE *pstDevice, STF_U8 u8BufIdx);
STF_RESULT (*EnqueueBuf_2)(ST_CI_DEVICE *pstDevice, STF_U32 u32Count, ST_VDO_BUF_INFO *pstVideoBufferInfo);
STF_RESULT (*EnqueueBufFromAvailableQueue)(ST_CI_DEVICE *pstDevice, STF_S32 s32Count);
STF_RESULT (*EnqueueBufFromCompletedQueue)(ST_CI_DEVICE *pstDevice, STF_S32 s32Count);
STF_RESULT (*DequeueBuf)(ST_CI_DEVICE *pstDevice, ST_VDO_MEM **ppstVdoMem);
STF_RESULT (*DequeueBuf_2)(ST_CI_DEVICE *pstDevice, STF_S32 *ps32Count, ST_VDO_BUF_INFO *pstVideoBufferInfo);
STF_RESULT (*DequeueBufToCompletedQueue)(ST_CI_DEVICE *pstDevice, STF_S32 s32Count);
STF_RESULT (*SwitchBufFromCompletedToAvailableQueue)(ST_CI_DEVICE *pstDevice, STF_S32 s32RemainCount);
STF_RESULT (*PushBufToQueue)(ST_CI_DEVICE *pstDevice, sLinkedList_T *pstListQueue, ST_VDO_MEM *pstVdoMem, STF_BOOL8 bIsPushToFront);
ST_VDO_MEM *(*PopBufFromQueue)(ST_CI_DEVICE *pstDevice, sLinkedList_T *pstListQueue, STF_BOOL8 bIsPopFromBack);
STF_RESULT (*ReleaseBuf)(ST_CI_DEVICE *pstDevice);
STF_RESULT (*GenerateLinksInfo)(ST_CI_DEVICE *pstDevice, EN_SNSR_IF enSensorInterface, ST_ITEM_INFO *pstLinksInfo);
STF_RESULT (*ProcessLinks)(ST_CI_DEVICE *pstDevice, ST_ITEM_INFO *pstLinksInfo);
STF_RESULT (*ProcessLinks_2)(ST_CI_DEVICE *pstDevice, EN_SNSR_IF enSensorInterface);
} ST_CI_DEVICE, *PST_CI_DEVICE;
|
See Basic Device Field Description. |
| Video Device Table |
typedef struct ST_VDEV_TBL {
STF_U32 u32Count;
ST_CI_DEVICE stVDev[EN_ISP_PORT_IDX_MAX + 1];
} ST_VDEV_TBL, *PST_VDEV_TBL;
|
- u32Count: The amount of devices in this
table
- stVDev: Device structure array
|
| Video Device Pointer Table |
typedef struct _ST_VDEV_PTR_TBL {
STF_U32 u32Count;
ST_CI_DEVICE *pstVDev[EN_ISP_PORT_IDX_MAX + 1];
} ST_VDEV_PTR_TBL, *PST_VDEV_PTR_TB
|
- u32Count: The amount of devices in this
table
- stVDev: Device pointer structure array
|