FVID2 API.
FVID2 API is used not only for on-chip peripherals drivers like capture, display but also for external off-chip video device peripherals like video decoders, video encoders and video sensors.
All video drivers and external video peripherals implement the FVID2 API. Many drivers also extend the FVID2 interface by defining their own driver specific IOCTLs.
All FVID2 API must be called from task context . Some examples in the package maybe calling FVID2 APIs from callback and/or interrupt context. Such examples will be modified in subsequent releases and in order that user application do not have to do special migration it is strongly recommended to use FVID2 APIs only from task context.
A FVID2 API can be of two kinds,
A FVID2 Driver can belong to one the below categories. The FVID2 APIs applicable to driver in a category are also listed below. The below is true for most driver unless specified otherwise by a specific driver.
Before making any FVID2 API calls, Fvid2_init() must be called. Fvid2_deInit() must be called during system shutdown.
Fvid2_getVersionString() and Fvid2_getVersionNumber() can be used to get information about current driver version number.
All FVID2 drivers are of type Fvid2_Handle, which gets created when Fvid2_create() is called. This handle is used for all subsequent FVID2 API calls. This handle and its associated resources are free'ed when Fvid2_delete() is called.
All FVID2 APIs make use of Fvid2_Frame, Fvid2_FrameList and/or Fvid2_ProcessList for exchanging and processing video frames via a driver. Further all drivers use a common user callback mechanism via Fvid2_CbParams to indicate to the user that a frame is ready. Many drivers, but not all, use the Fvid2_Format data structure to describe video input, output data formats.
All drivers use the constants, enum's, error codes defined in this file to control and configure a driver.
In addition, most drivers define driver specific create time parameters and IOCTLs to allow the user to control and configure the driver in driver specific ways. Further a driver may define driver specific run-time parameters which are passed by user to the driver via Fvid2_Frame.perFrameCfg and/or Fvid2_FrameList.perListCfg.
Also user application can associate user specific app data with a driver handle via Fvid2_CbParams.appData or with every frame via FIVD2_Frame.appData. The app data set as part of Fvid2_CbParams returned back to user when callback occurs. The app data set as part of Fvid2_Frame is returned back to the user when the Fvid2_Frame itself is returned back to user via Fvid2_dequeue() or Fvid2_getProcessedFrames(). The driver will not modify this app data. This could be used by the application to store any application specific data like application object info and so on.
Go to the source code of this file.
Data Structures | |
struct | Fvid2_CbParams |
FVID2 callback parameters that are setup during Fvid2_create(). More... | |
struct | Fvid2_TimeStampParams |
Structure used to configure time stamping of frames. More... | |
struct | Fvid2_InitPrms |
FVID2 initialization parameters. More... | |
Macros | |
#define | FVID2_VERSION_STRING "FVID_02_02_00_00" |
FVID2 driver version string. Version is of the form mm_nn_xx_yy where, mm - Product version (02 for FVID2). This increments for any new FVID2 versions. nn - Major number - Increments if any backward compatibility is broken or major change within a product version. xx - Minor number - Increments for any minor change or any additions done without breaking backward compatibility. yy - Build number - Increments for every release. More... | |
#define | FVID2_VERSION_NUMBER (0x02020000U) |
FVID2 driver version number. More... | |
#define | FVID2_CTRL_BASE (0x00000000U) |
Control command base address. More... | |
#define | FVID2_USER_BASE (0x10000000U) |
User command base address. More... | |
#define | FVID2_SET_FORMAT ((uint32_t) FVID2_CTRL_BASE + 3U) |
Control command used by Fvid2_setFormat() More... | |
#define | FVID2_GET_FORMAT ((uint32_t) FVID2_CTRL_BASE + 4U) |
Control command used by Fvid2_getFormat() More... | |
#define | FVID2_START ((uint32_t) FVID2_CTRL_BASE + 5U) |
Control command used by Fvid2_start() More... | |
#define | FVID2_STOP ((uint32_t) FVID2_CTRL_BASE + 6U) |
Control command used by Fvid2_stop() More... | |
#define | FVID2_REGISTER_TIMESTAMP_FXN ((uint32_t) FVID2_CTRL_BASE + 7U) |
Register an application function (pointer) for getting the time stamp value used at the frame completion time. More... | |
#define | FVID2_DSS_DRV_BASE (0x00001000U) |
Driver ID base for the DSS driver class. More... | |
#define | FVID2_CAL_DRV_BASE (0x00002000U) |
Driver ID base for the CAL driver class. More... | |
#define | FVID2_CSIRX_DRV_BASE (0x00003000U) |
Driver ID base for the CSIRX driver class. More... | |
#define | FVID2_CSITX_DRV_BASE (0x00004000U) |
Driver ID base for the CSITX driver class. More... | |
#define | FVID2_VHWA_DRV_BASE (0x00005000U) |
Driver ID base for the VHWA driver class. More... | |
#define | FVID2_DSS_DRV_IOCTL_BASE (FVID2_USER_BASE + FVID2_DSS_DRV_BASE) |
IOCTL base for the DSS driver class. More... | |
#define | FVID2_CAL_DRV_IOCTL_BASE (FVID2_USER_BASE + FVID2_CAL_DRV_BASE) |
IOCTL base for the CAL driver class. More... | |
#define | FVID2_CSIRX_DRV_IOCTL_BASE (FVID2_USER_BASE + FVID2_CSIRX_DRV_BASE) |
IOCTL base for the CSIRX driver class. More... | |
#define | FVID2_CSITX_DRV_IOCTL_BASE (FVID2_USER_BASE + FVID2_CSITX_DRV_BASE) |
IOCTL base for the CSITX driver class. More... | |
#define | FVID2_VHWA_DRV_IOCTL_BASE (FVID2_USER_BASE + FVID2_VHWA_DRV_BASE) |
IOCTL base for the VHWA driver class. More... | |
FVID2 Max limits | |
#define | FVID2_STREAM_ID_ANY (0xFFFFFFFFU) |
Decide the streamid based on channel number. More... | |
Typedefs | |
typedef void * | Fvid2_Handle |
FVID2 Driver handle. More... | |
typedef int32_t(* | Fvid2_CbFxn) (Fvid2_Handle handle, void *appData) |
FVID2 driver callback function prototype. More... | |
typedef int32_t(* | Fvid2_ErrCbFxn) (Fvid2_Handle handle, void *appData, void *errList) |
FVID2 error callback function prototype. More... | |
typedef int32_t(* | Fvid2_SubFrameCbFxn) (Fvid2_Handle handle, Fvid2_Frame *subFrame) |
FVID2 callback that is called by subframe mode Capture driver. More... | |
typedef uint64_t(* | Fvid2_TimeStampFxn) (void *args) |
Function prototype, to determine the time stamp. More... | |
typedef void(* | Fvid2_PrintFxn) (const char *format,...) |
FVID2 info/debug print function prototype. More... | |
Functions | |
int32_t | Fvid2_init (const Fvid2_InitPrms *initPrms) |
FVID2 init function. More... | |
int32_t | Fvid2_deInit (void *args) |
FVID2 deinit function. More... | |
const char * | Fvid2_getVersionString (void) |
Get the version string for FVID2 interface. More... | |
uint32_t | Fvid2_getVersionNumber (void) |
Same as Fvid2_getVersionString() except it returns the version in uint32_t form. More... | |
Fvid2_Handle | Fvid2_create (uint32_t drvId, uint32_t instanceId, void *createArgs, void *createStatusArgs, const Fvid2_CbParams *cbParams) |
Creates the driver identified by the driver ID. More... | |
int32_t | Fvid2_delete (Fvid2_Handle handle, void *deleteArgs) |
Deletes a previously created FVID2 driver handle. More... | |
int32_t | Fvid2_control (Fvid2_Handle handle, uint32_t cmd, void *cmdArgs, void *cmdStatusArgs) |
Send control commands (IOCTLs) to the driver. More... | |
int32_t | Fvid2_queue (Fvid2_Handle handle, Fvid2_FrameList *frameList, uint32_t streamId) |
An application calls Fvid2_queue to submit a video buffer to the video device driver. More... | |
int32_t | Fvid2_dequeue (Fvid2_Handle handle, Fvid2_FrameList *frameList, uint32_t streamId, uint32_t timeout) |
An application calls Fvid2_dequeue to request the video device driver to give ownership of a video buffer. More... | |
int32_t | Fvid2_processRequest (Fvid2_Handle handle, Fvid2_FrameList *inFrameList, Fvid2_FrameList *outFrameList, uint32_t timeout) |
An application calls Fvid2_processRequest to submit a video buffer to the video device driver. More... | |
int32_t | Fvid2_getProcessedRequest (Fvid2_Handle handle, Fvid2_FrameList *inFrameList, Fvid2_FrameList *outFrameList, uint32_t timeout) |
An application calls Fvid2_getProcessedRequest to get the processed request back from the driver and thus to get the ownership of request back from the driver. More... | |
static int32_t | Fvid2_start (Fvid2_Handle handle, void *cmdArgs) |
An application calls Fvid2_start to request the video device driver to start the video display or capture operation. This function should be called from task context only and should not be called from ISR context. More... | |
static int32_t | Fvid2_stop (Fvid2_Handle handle, void *cmdArgs) |
An application calls Fvid2_stop to request the video device driver to stop the video display or capture operation. This function should be called from task context only and should not be called from ISR context. More... | |
static int32_t | Fvid2_setFormat (Fvid2_Handle handle, Fvid2_Format *fmt) |
An application calls Fvid2_setFormat to request the video device driver to set the format for a given channel. This function should be called from task context only and should not be called from ISR context. More... | |
static int32_t | Fvid2_getFormat (Fvid2_Handle handle, Fvid2_Format *fmt) |
An application calls Fvid2_getFormat to request the video device driver to get the current format for a given channel. This function should be called from task context only and should not be called from ISR context. More... | |
static void | Fvid2InitPrms_init (Fvid2_InitPrms *initPrms) |
Fvid2_InitPrms structure init function. More... | |
static void | Fvid2CbParams_init (Fvid2_CbParams *cbPrms) |
Fvid2_CbParams structure init function. More... | |