FVID2

FVID2 are the interface APIs for the video capture, video display and video processing (Memory to Memory drivers) applications on top of BIOS operating system. Provides the interfaces for the streaming operations like queuing of buffers to the hardware and getting is back from the hardware. Also provides the control interface for the devices like video encoders and video decoders which are actually not the data path devices. Gives same look and feel for the video applications across different SoCs.

Features Supported

Following are the features of the FVID2 APIs:

  • Platform independent and CPU independent APIs.

  • Suitable for multiprocessor communication environment like client-server model.

  • Supports blocking as well as non-blocking APIs.

  • Supports streaming class of devices like video capture and video display.

  • Supports non-steaming class of devices like video encoders and video decoders.

  • Supports sliced based operations like sliced based capture and slice based memory to memory drivers.

  • Support for the multiple buffers representing a single frame.

  • Support for configuring the hardware on per frame basis in synchronous with the frames submitted. AKA Runtime parameters change.

  • Interface supports multiple handle and multiple channel operation. Explained in detail in coming sections.

  • Support for adding the custom controls specific to the device.

Attention

Underlying drivers catering to FVID2 interfaces may decide to expose the sub-set of features supported by FVID2. Please refer to the individual driver userGuide for the features exposed by drivers.

FVID2 APIs

FVID2 Init

This API should be called before calling any of the FVID2 APIs. This API initializes the underlying hardware/software sub-system built on top of FVID2 APIs. This should be called once during the system initialization time in the task context. This function should not be called from the ISR context.

    Int32 Fvid2_init(const Fvid2_InitPrms *initPrms)
  • initPrms - FVID2 Initialization parameters..

FVID2 DeInit

This function should be called during the system de-Initialization. De-Initializes the hardware/software sub-system built on top of FVID2 APIs. This should be called only once from the task context.

    Int32 Fvid2_deInit(void *args)
  • args - Not used

FVID2 Create

This API is used to open the FVID2 driver. drvId and InstanceId pair represents the hardware on which driver operates. It initializes the hardware supported by the driver and configures it according to the parameters provided by open. Some of the FVID2 driver supports multiple creates/open on the same drvId and instanceId. Requests from the different handles of the multiple opens is serialize by the driver and is operated upon the same hardware one by one.

    Fvid2_Handle Fvid2_create(uint32_t drvId,
                              uint32_t instanceId,
                              Ptr createArgs,
                              Ptr createStatusArgs,
                              const Fvid2_CbParams *cbParams);
  • drvId - [IN] Used to find a matching ID in the device driver table

  • instanceId - [IN] Instance ID of the driver to open and is used to differentiate multiple instance support on a single driver.

  • createArgs - [IN] Pointer to the create argument structure. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

  • createStatusArgs - [OUT] Pointer to status argument structure where the driver returns any status information. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

  • cbParams - Application callback parameters Fvid2_CbParams. This parameter could be NULL depending on whether the actual driver forces it or not.

  • return - Returns a non-NULL Fvid2_Handle object on success else returns NULL on error.

FVID2 Set Format

Sets the format information for the already opened driver for a given channel. This function should be called from the task context.

    Int32 Fvid2_setFormat(Fvid2_Handle handle, Fvid2_Format *fmt)
  • handle - [IN] FVID2 handle returned by FVID2 Create call.

  • fmt - [IN] Pointer to the FVID2 Create structure.

  • return - FVID2_SOK on success, else appropriate FVID2 Error Code on failure

FVID2 Get Format

Returns the format already set for the opened driver for a given channel. This function should be called from the task context.

    Int32 Fvid2_getFormat(Fvid2_Handle handle, Fvid2_Format *fmt)
  • handle - [IN] FVID2 handle returned by FVID2 Create call.

  • fmt - [OUT] Pointer to the FVID2 Create structure.

  • return - FVID2_SOK on success, else appropriate FVID2 Error Code on failure.

FVID2 Control

Driver exposes the custom control commands specific to the driver and hardware through this interface. All the FVID2 control commands are blocking. These control commands should be called from the task context unless specified otherwise by the specific drivers. Example of the control commands exposed by different drivers are creation/selection of the different multi window layout in case of display driver, programming of coefficients in case of memory drivers involving scalars.

    Int32 Fvid2_control(Fvid2_Handle handle,
                        UInt32 cmd,
                        Ptr cmdArgs,
                        Ptr cmdStatusArgs);
  • handle - [IN] FVID2 handle returned by FVID2 Create call.

  • cmd - [IN] IOCTL command. The type of command supported is defined by the specific driver.

  • cmdArgs - [IN] Pointer to the command argument structure. The type of the structure is defined by the specific driver for each of the supported IOCTL. This parameter could be NULL depending on whether the actual driver forces it or not.

  • cmdStatusArgs - [OUT]Pointer to status argument structure where the driver returns any status information. The type of the structure is defined by the specific driver for each of the supported IOCTL. This parameter could be NULL depending on whether the actual driver forces it or not.

  • return - FVID2_SOK on success, else appropriate FVID2 Error Code on failure.

FVID2 Start

An application calls FVID2 start to request the video device driver to start the video display or capture operation. Most of the control commands and start FVID2 commands like Fvid2_setFormat,Fvid2_getFormat cannot be called unless specified otherwise by driver. This function should be called from the task context.

    Int32 Fvid2_start(Fvid2_Handle handle, Ptr cmdArgs)
  • handle - [IN] FVID2 handle returned by FVID2 Create call.

  • cmdArgs - [IN] Pointer to the start argument structure. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

  • return - FVID2_SOK on success, else appropriate FVID2 Error Code on failure.

FVID2 Stop

An application calls the FVID2 stop to request the video device driver to stop the video display or capture operation. FVID2 Stop may be called by application to change the setting of the driver like format, encoder/decoder mode etc. After doing the required operation driver can be start again. .. warning:: If driver settings are called after Fvid2_Stop, then remaining buffers in the queue should be de-queued before starting the driver again.

    Int32 Fvid2_stop(Fvid2_Handle handle, Ptr cmdArgs)
  • handle - [IN] FVID2 handle returned by FVID2 Create call.

  • cmdArgs - [IN] Pointer to the start argument structure. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

  • return - FVID2_SOK on success, else appropriate FVID2 Error Code on failure.

FVID2 Queue

This is used to submit a video buffer to the video device driver. This is used in capture/display drivers. This function should be called from task context unless driver specifies that it can be called from the interrupt context as well. This is a non blocking API unless the specific driver specifies otherwise.

    Int32 Fvid2_queue(Fvid2_Handle handle,
                      Fvid2_FrameList *frameList,
                      UInt32 streamId,\
                      UInt32 timeout);
  • handle - [IN] FVID2 handle returned by FVID2 Create call.

  • frameList - [IN] Pointer to the FVID2 FrameList structure containing the information about the FVID2 frames that has to be queued in the driver.

  • streamId - [IN]Stream ID to which the frames should be queued. This is used in drivers where they could support multiple streams for the same handle. Otherwise this should be set to zero.

  • timeout - [IN]This will determine the timeout value till the driver will block for a free or completed buffer is available.

  • return - FVID2_SOK on success, else appropriate FVID2 Error Code on failure.

FVID2 De-Queue

An application calls Fvid2_dequeue to request the video device driver to give ownership of a video buffer. This is used in the capture and display driver. This is a non-blocking API if timeout is FVID2_TIMEOUT_NONE and could be called by task context as well as interrupt context unless specific driver mentions otherwise. This is blocking API if timeout is FVID2_TIMEOUT_FOREVER if supported by specific driver implementation.

    Int32 Fvid2_dequeue(Fvid2_Handle handle,
                        Fvid2_FrameList *frameList,
                        UInt32 streamId,
                        UInt32 timeout);
  • handle - [IN] FVID2 handle returned by FVID2 Create call.

  • frameList - [OUT] Pointer to the FVID2 FrameList structure where the de-queued frame pointers will be stored

  • streamId - [IN]Stream ID to which the frames should be queued. This is used in drivers where they could support multiple streams for the same handle. Otherwise this should be set to zero.

  • timeout - [IN] FVID2 timeout in units of OS ticks. T his will determine the timeout value till the driver will block for a free or completed buffer is available. For non-blocking drivers this parameter might be ignored. return - FVID2_SOK on success, else appropriate FVID2 Error Code on failure.

FVID2 Queue and De-Queue

Single Queue and Single De-Queue

Single queue and corresponding single de-queue of the framelist is used in the display driver. Where the single framelist can contain the single buffer for the whole frame or can contain multiple buffers in case of multiple window configuration. Below figure shows how FVID2 FrameList and FVID2 Frames are initialized in case of multiple window configuration.

FVID2 Single Queue and Single De-Queue

FVID2 Single Queue and Single De-Queue Configuration

As shown in above figure

  • One Fvid2_Frame is pointing to one buffer each.

  • All the FVID2 frames to be display as a part of single video frame is pointed by the FVID2 Frame pointers inside FVID2 FrameList.

Below sequence shows how the FVID2 Frame pointers inside the Fvid2_Frame list are exchanged between the driver and the application in the FVID2 Queue and FVID2 De-Queue calls.

  • FVID2 FrameList contains 4 FVID2 Frames.

  • Its submitted through single FVID2 Queue and will be displayed as single video frame.

  • Driver copies all the content inside the FVID2 FrameList into the driver’s FVID2 FrameList and application can’t touch it till driver returns it back. Now the application FVID2 FrameList is free to load new FVID2 Frames.

  • Driver gives the callback to the application on successfully displaying the video frames inside FVID2 FrameList

  • Application calls the FVID2 De-Queue with the empty FVID2 FrameList. Driver copied back all the FVID2 Frames back.

  • In display case application always queues all the frames required to display one video frame and driver gives it back once it completes displaying that video frame.

  • Hence always single FVID2 Queue call results in single FVID2 De-Queue call.

Single Queue and Single De-Queue

This is used in case of multiple channel case. While priming of the buffers before the capture starts application submits buffers for all the channels using a single FVID2 Queue call. Since the capture is multiplexed input frames from the different sources could complete at different time for each input and application wants to process buffer as soon as its captured. This concept allows buffers to be de-queued as they are complete without waiting for other channels to be completed. This results in single queue where buffers for all the channels are queued in single called and de-queued as the channels are completed capturing.

Below sequence shows the single queue and multiple de-queue used in capture driver:

  • FVID2 FrameList contains 4 FVID2 Frames one for each channel in case of 4 channels multiplexed capture.

  • Capture driver gives callback to the application with two frames completed capturing.

  • Application calls FVID2 De-Queue with empty FVID2 FrameList.

  • Capture driver returns pointers to both completed FVID2 Frames

  • Again capture driver gives callback to application with the rest of the two frames captured.

  • Application calls FVID2 De-Queue with empty FVID2 FrameList.

  • Again capture driver returns pointers to both completed FVID2 Frames

So this results in the singe call to FVID2 Queue to submit frames related to all channels, and driver giving multiple callbacks to the application for the number of frames captured which results in the multiple de-queue calls for a single queue call.

Application can also opt to wait for the multiple callback and call FVID2 Queue which will return all the frames capture till then.

API Reference

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,

  • Blocking API Here the FVID2 API call returns only after completing the request or functionality or if timed out or if some other error occurs. The below APIs are always blocking, unless specified otherwise by specific driver.

  • Non-blocking API Here FVID2 API call queues the request to the driver and returns immediately before the request is processed or completed. Application should use the completion callback to wait for request completion. The below APIs are always non-blocking, unless specified otherwise by specific driver.

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.

FVID2 Max limits

FVID2_STREAM_ID_ANY

Decide the streamid based on channel number.

Defines

FVID2_VERSION_STRING

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.

FVID2_VERSION_NUMBER

FVID2 driver version number.

FVID2_CTRL_BASE

Control command base address.

FVID2_USER_BASE

User command base address.

FVID2_SET_FORMAT

Control command used by Fvid2_setFormat()

Parameters:
  • cmdArgs – [IN] const Fvid2_Format *

  • cmdStatusArgs – [OUT] NULL

Returns:

FVID2_SOK on success, else failure.

FVID2_GET_FORMAT

Control command used by Fvid2_getFormat()

Parameters:
  • cmdArgs – [IN] Fvid2_Format *

  • cmdStatusArgs – [OUT] NULL

Returns:

FVID2_SOK on success, else failure.

FVID2_START

Control command used by Fvid2_start()

Parameters:
  • cmdArgs – [IN] Driver specific

  • cmdStatusArgs – [OUT] NULL

Returns:

FVID2_SOK on success, else failure.

FVID2_STOP

Control command used by Fvid2_stop()

Parameters:
  • cmdArgs – [IN] Driver specific

  • cmdStatusArgs – [OUT] NULL

Returns:

FVID2_SOK on success, else failure.

FVID2_REGISTER_TIMESTAMP_FXN

Register an application function (pointer) for getting the time stamp value used at the frame completion time.

The same IOCTL could be used to un-register the existing time stamp function by passing NULL to the function pointer.

Parameters:
Returns:

FVID2_SOK on success, else failure.

FVID2_DSS_DRV_BASE

Driver ID base for the DSS driver class.

FVID2_CAL_DRV_BASE

Driver ID base for the CAL driver class.

FVID2_CSIRX_DRV_BASE

Driver ID base for the CSIRX driver class.

FVID2_CSITX_DRV_BASE

Driver ID base for the CSITX driver class.

FVID2_VHWA_DRV_BASE

Driver ID base for the VHWA driver class.

FVID2_DSS_DRV_IOCTL_BASE

IOCTL base for the DSS driver class.

FVID2_CAL_DRV_IOCTL_BASE

IOCTL base for the CAL driver class.

FVID2_CSIRX_DRV_IOCTL_BASE

IOCTL base for the CSIRX driver class.

FVID2_CSITX_DRV_IOCTL_BASE

IOCTL base for the CSITX driver class.

FVID2_VHWA_DRV_IOCTL_BASE

IOCTL base for the VHWA driver class.

Typedefs

typedef void *Fvid2_Handle

FVID2 Driver handle.

typedef int32_t (*Fvid2_CbFxn)(Fvid2_Handle handle, void *appData)

FVID2 driver callback function prototype.

This callback is used by the drivers which implement non-blocking FVID2 APIs.

User should assume that callbacks happen in ISR context and hence should apply rules relevant to ISR context when implementing callback functions, i.e blocking APIs should not be called from callback. Users should also assume that interrupts are enabled when in callback context, i.e other interrupt / callbacks can occur when a callback is under execution. User callback implementation should not be very long, since callback execution may block other drivers from executing. Typically it is recommended to set a semaphore or flag when callback happens and do the more involved callback handling in task context.

This callback is typically called by the driver as mentioned below, unless specified otherwise by specific drivers.

In case of display drivers, this callback function will be called when a frame(s) is/are completed displayed. Then the application can dequeue the displayed buffer back from the driver.

In case of capture drivers, this callback function will be called when a frame(s) is/are captured. Then the application can dequeue the captured buffer back from the driver.

In case of M2M drivers, this callback function will be called when a request from the application is completed by the driver. Then the application can dequeue the completed request buffers back from the driver.

In case of control drivers, callbacks are typically not used since mostly FVID2 APIs implemented by control drivers are of blocking nature.

Param handle:

[OUT] FVID2 handle for which the callback has occurred.

Param appData:

[OUT] Application data provided to the driver at the time of Fvid2_create().

Return:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

typedef int32_t (*Fvid2_ErrCbFxn)(Fvid2_Handle handle, void *appData, void *errList)

FVID2 error callback function prototype.

Error callback is called by driver when it encounters a error during processing of frames in its internal queue.

When user submits frames to the driver it does minimal error checks and stores the the frames in its internal queues. In case of any error at this point the FVID2 API will simply return error and error callback will not be called.

The driver will later (depending on how its request queue is full) process these frames submitted by the user. If driver finds any error in either the input frame information or hardware itself then it will call this error callback to notify the user about this error. As part of the callback information it also returns the frames or request for which error happened so that user can take appropriate action.

Users should apply same rules as that of Fvid2_CbFxn when implementing error callbacks.

Param handle:

[OUT] FVID2 handle for which the callback has occurred.

Param appData:

[OUT] Application data provided to the driver at the time of Fvid2_create().

Param errList:

[OUT] Pointer to a valid framelist (Fvid2_FrameList) in case of capture and display drivers or a pointer to a valid processlist (Fvid2_ProcessList) in case of M2M drivers. The driver copies the aborted/error frames in this frame list or process list.

Return:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

typedef int32_t (*Fvid2_SubFrameCbFxn)(Fvid2_Handle handle, Fvid2_Frame *subFrame)

FVID2 callback that is called by subframe mode Capture driver.

This callback is called for every subframe of frame that is captured. This function is used by Capture Driver and not meant for M2M drivers.

Users should apply same rules as that of Fvid2_CbFxn when implementing subframe callbacks.

Param handle:

[OUT] FVID2 handle for which this callback happened.

Param subFrameInfo:

[OUT] SubFrame information.

Return:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

typedef uint64_t (*Fvid2_TimeStampFxn)(void *args)

Function prototype, to determine the time stamp.

Param args:

[IN] Not used as of now.

Return:

An unsigned int 64 value, that represents the current time in usec.

typedef void (*Fvid2_PrintFxn)(const char *format, ...)

FVID2 info/debug print function prototype.

This function is used by the driver to print info/debug messages.

Param format:

[OUT] Info string to print.

Functions

int32_t Fvid2_init(const Fvid2_InitPrms *initPrms)

FVID2 init function.

Initializes the FVID2 layer. This function should be called before calling any of FVID2 API’s and should be called only once.

Parameters:

initPrms – [IN] FVID2 Initialization parameters. If NULL is passed, the default parameters will be assumed - no print will be enabled

Returns:

FVID2_SOK on success else appropriate FVID2 error code on failure.

int32_t Fvid2_deInit(void *args)

FVID2 deinit function.

Uninitializes the FVID2 layer and should be called during system shutdown. Should not be called if Fvid2_init() is not called.

Parameters:

args – [IN] Not used currently. Set to NULL.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

const char *Fvid2_getVersionString(void)

Get the version string for FVID2 interface.

This is the version number for the FVID2 interface. This function can be called prior to Fvid2_init() to get the version number.

Returns:

Pointer to FVID2 version string.

uint32_t Fvid2_getVersionNumber(void)

Same as Fvid2_getVersionString() except it returns the version in uint32_t form.

Example, v1.0.1.17 will be 0x01000117

Returns:

FVID2 version number.

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.

This will allocate HW and/or SW resources and return a Fvid2_Handle for this driver. This handle will be used for subsequent FVID2 API calls

Parameters:
  • drvId – [IN] Driver to open. Driver ID is driver specific.

  • instanceId – [IN] Instance of the driver to open and is used to differentiate multiple instance support on a single driver. Instance ID is driver specific.

  • createArgs – [IN] Pointer to the create argument structure. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

  • createStatusArgs – [OUT] Pointer to status argument structure where the driver returns any status information. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

  • cbParams – [IN] Application callback parameters. This parameter could be NULL depending on whether the actual driver forces it or not.

Returns:

non-NULL Fvid2_Handle object pointer on success else returns NULL on error.

int32_t Fvid2_delete(Fvid2_Handle handle, void *deleteArgs)

Deletes a previously created FVID2 driver handle.

This free’s the HW/SW resources allocated during create

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • deleteArgs – [IN] Pointer to the delete argument structure. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

int32_t Fvid2_control(Fvid2_Handle handle, uint32_t cmd, void *cmdArgs, void *cmdStatusArgs)

Send control commands (IOCTLs) to the driver.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • cmd – [IN] IOCTL command. The type of command supported is defined by the specific driver.

  • cmdArgs – [IN] Pointer to the command argument structure. The type of the structure is defined by the specific driver for each of the supported IOCTL. This parameter could be NULL depending on whether the actual driver forces it or not.

  • cmdStatusArgs – [OUT] Pointer to status argument structure where the driver returns any status information. The type of the structure is defined by the specific driver for each of the supported IOCTL. This parameter could be NULL depending on whether the actual driver forces it or not.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

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.

  • This is used in capture/display drivers.

  • This function could be called from task or ISR context unless the specific driver restricts from doing so.

  • This is a non-blocking API unless the specific driver restricts from doing so.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • frameList – [IN] Pointer to the frame list structure containing the information about the FVID2 frames that has to be queued in the driver.

  • streamId – [IN] Stream ID to which the frames should be queued This is used in drivers where they could support multiple streams for the same handle. Otherwise this should be set to zero.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

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.

  • This is used in capture/display drivers.

  • This is a non-blocking API if timeout is FVID2_TIMEOUT_NONE and could be called by task and ISR context unless the specific driver restricts from doing so.

  • This is blocking API if timeout is FVID2_TIMEOUT_FOREVER if supported by specific driver implementation.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • frameList – [OUT] Pointer to the frame list structure where the dequeued frame pointer will be stored.

  • streamId – [IN] Stream ID from where frames should be dequeued. This is used in drivers where it could support multiple streams for the same handle. Otherwise this should be set to zero.

  • timeout – [IN] FVID2 timeout in units of OS ticks. This will determine the timeout value till the driver will block for a free or completed buffer is available. For non-blocking drivers this parameter might be ignored.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

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.

This API is used for submitting a single channel video processing request to the video device driver. It uses framelist to submit multiple frames of different stream ids of the same request.

  • This function could be called from task or ISR context unless the specific driver restricts from doing so.

  • This is a non-blocking API unless the specific driver restricts from doing so.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • inFrameList – [IN] Pointer to the array of input frames with different stream ids.

  • outFrameList – [IN] Pointer to the array of output frames with different stream ids

  • timeout – [IN] FVID2 timeout. This will determine the timeout value till the driver will block for a free or completed buffer is available. For non-blocking drivers this parameter might be ignored.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

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.

  • This is a non-blocking API if timeout is FVID2_TIMEOUT_NONE and could be called by task and ISR context unless the specific driver restricts from doing so.

  • This is blocking API if timeout is FVID2_TIMEOUT_FOREVER if supported by specific driver implementation.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • inFrameList – [OUT] Pointer to frame list in which input frames with different stream ids will be returned by the driver.

  • outFrameList – [OUT] Pointer to frame list in which output frames with different stream ids will be returned by the driver.

  • timeout – [IN] FVID2 timeout. This will determine the timeout value till the driver will block for a free or completed buffer is available. For non-blocking drivers this parameter might be ignored.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

static inline 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.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • cmdArgs – [IN] Pointer to the start argument structure. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

static inline 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.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • cmdArgs – [IN] Pointer to the stop argument structure. The type of the structure is defined by the specific driver. This parameter could be NULL depending on whether the actual driver forces it or not.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

static inline 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.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • fmt – [IN] Pointer to the FVID2 format structure.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

static inline 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.

Parameters:
  • handle – [IN] FVID2 handle returned by create call.

  • fmt – [OUT] Pointer to the FVID2 format structure.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

static inline void Fvid2InitPrms_init(Fvid2_InitPrms *initPrms)

Fvid2_InitPrms structure init function.

Parameters:

initPrms – [IN] Pointer to Fvid2_InitPrms structure.

static inline void Fvid2CbParams_init(Fvid2_CbParams *cbPrms)

Fvid2_CbParams structure init function.

Parameters:

cbPrms – [IN] Pointer to Fvid2_CbParams structure.

struct Fvid2_CbParams
#include <fvid2_api.h>

FVID2 callback parameters that are setup during Fvid2_create().

FVID2 supports the driver call back. Driver call the application on specific events like, completion of buffer capture, displayed or process. Or in case of error where application needs to take some action. Following is the structure defined by the FVID2 API for the application to pass the callback functions to be invoked by the driver.

Public Members

Fvid2_CbFxn cbFxn

Application callback function used by the driver to intimate any operation has completed or not. This is an optional parameter in case application decides to use polling method and so could be set to NULL.

Fvid2_ErrCbFxn errCbFxn

Application error callback function used by the driver to intimate any error occurs at the time of streaming. This is an optional parameter in case application decides not to get any error callback and so could be set to NULL.

void *errList

Pointer to a valid Fvid2_FrameList in case of capture and display drivers or a pointer to a valid Fvid2_ProcessList in case of M2M drivers where the driver copies the aborted/error packet. The memory of this list should be allocated by the application and provided to the driver at the time of driver creation. When the application gets this callback, it has to empty this list and taken necessary action like freeing up memories etc. The driver will then reuse the same list for future error callback. This could be NULL if errCbFxn is NULL. Otherwise this should be non-NULL.

void *appData

Application specific data which is returned in the callback function as it is. This could be set to NULL if not used.

struct Fvid2_TimeStampParams
#include <fvid2_api.h>

Structure used to configure time stamping of frames.

Public Members

Fvid2_TimeStampFxn timeStampFxn

By default, OSAL (BIOS) API is used to time stamp frames.

Applications could over-ride the same, by providing a function that would return an unsigned int 64 value representing the timestamp in usec. The driver would call this function and update the ‘timeStamp’ and ‘timeStamp64’ member of Fvid2_Frame with the return value of this function.

Note: The 64-bit value / 1000 is used to update the ‘timeStamp’ member.

Passing a value of NULL un-registers the time stamp function.

uint32_t reserved

Not used now. Set to zero.

struct Fvid2_InitPrms
#include <fvid2_api.h>

FVID2 initialization parameters.

Public Members

Fvid2_PrintFxn printFxn

If not NULL, this function will be called to print debug/info message with appropriate string.

FVID2 Datatypes.

FVID2 Error Codes

Error codes returned by FVID2 APIs

FVID2_SOK

FVID2 API call successful.

FVID2_EFAIL

FVID2 API call returned with error as failed. Used for generic error. It may be some hardware failure and/or software failure.

FVID2_EBADARGS

FVID2 API call returned with error as bad arguments. Typically, NULL pointer passed to the FVID2 API where its not expected.

FVID2_EINVALID_PARAMS

FVID2 API call returned with error as invalid parameters. Typically when parameters passed are not valid or out of range.

FVID2_EDEVICE_INUSE

FVID2 API call returned with error as device already in use. Example, tried to open the driver maximum + 1 times. Display and Capture driver supports single open only, while M2M driver supports multiple open.

FVID2_ETIMEOUT

FVID2 API call returned with error as timed out. Typically API is waiting for some condition and returned as condition not happened in the timeout period.

FVID2_EALLOC

FVID2 API call returned with error as allocation failure. Typically memory or resource allocation failure.

FVID2_EOUT_OF_RANGE

FVID2 API call returned with error as out of range. Typically when API is called with some argument that is out of range for that API like array index etc.

FVID2_EAGAIN

FVID2 API call returned with error as try again. Momentarily API is not able to service request because of queue full or any other temporary reason.

FVID2_EUNSUPPORTED_CMD

FVID2 API call returned with unsupported command. Typically when command is not supported by control API.

FVID2_ENO_MORE_BUFFERS

FVID2 API call returned with error as no more buffers available. Typically when no buffers are available.

FVID2_EUNSUPPORTED_OPS

FVID2 API call returned with error as unsupported operation. Typically when the specific operation is not supported by that API such as IOCTL not supporting some specific functions.

FVID2_EDRIVER_INUSE

FVID2 API call returned with error as driver already in use.

FVID2 API call returned with warning for non-recommended parameter settings sent by application. Application may choose to ignore this.

FVID2_ENO_DEVICE

FVID2 API call returned with error as no device present for the given command and API.

FVID2 Max limits

FVID2_MAX_FRAME_PTR

This macro determines the maximum number of FVID2 frame pointers that can be passed per frame list.

FVID2_MAX_FIELDS

Number of fields - top and bottom. Used for allocating address pointers for both the fields.

FVID2_MAX_PLANES_PER_FIELD

This macro determines the maximum number of planes/address used to represent a video buffer per field. Currently this is set to 3 to support the maximum pointers required for YUV/RGB planar format - Y, Cb and Cr or R, G and B.

FVID2_MAX_PLANES

This macro determines the maximum number of planes/address used to represent a video buffer. Currently this is set to 6 to support the maximum pointers required for two fields of YUV/RGB planar format - Y, Cb and Cr or R, G and B.

FVID2 Frame Address Index

Fvid2_Frame.addr structure is array of pointers. The below indices are used to identify the correct buffer address corresponding to the field and buffer formats.

FVID2_YUV_PL_Y_ADDR_IDX

Y Index for YUV444/YUV422/YUV420 planar formats.

FVID2_YUV_PL_CB_ADDR_IDX

CB Index for YUV444/YUV422/YUV420 planar formats.

FVID2_YUV_PL_CR_ADDR_IDX

CR Index for YUV444/YUV422/YUV420 planar formats.

FVID2_YUV_SP_Y_ADDR_IDX

Y Index for YUV semi planar formats.

FVID2_YUV_SP_CBCR_ADDR_IDX

CB Index for semi planar formats.

FVID2_RGB_ADDR_IDX

Index for RGB888/RGB565/ARGB32 formats.

FVID2_YUV_INT_ADDR_IDX

Index for YUV444/YUV422 interleaved formats.

FVID2_YUV_PL_Y_FID2_ADDR_IDX

Y Index for YUV444/YUV422/YUV420 planar formats for field 2.

FVID2_YUV_PL_CB_FID2_ADDR_IDX

CB Index for YUV444/YUV422/YUV420 planar formats for field 2.

FVID2_YUV_PL_CR_FID2_ADDR_IDX

CR Index for YUV444/YUV422/YUV420 planar formats for field 2.

FVID2_YUV_SP_Y_FID2_ADDR_IDX

Y Index for YUV semi planar formats for field 2.

FVID2_YUV_SP_CBCR_FID2_ADDR_IDX

CB Index for semi planar formats for field 2.

FVID2_RGB_FID2_ADDR_IDX

Index for RGB888/RGB565/ARGB32 formats for field 2.

FVID2_YUV_INT_FID2_ADDR_IDX

Index for YUV444/YUV422 interleaved formats for field 2.

Digital Video Format

FVID2_DV_BT656_EMBSYNC

Video format is BT656 with embedded sync.

FVID2_DV_BT1120_EMBSYNC

Video format is BT1120 with embedded sync.

FVID2_DV_GENERIC_DISCSYNC

Video format is for any discrete sync.

typedef uint32_t Fvid2_DVFormat

Video Buffer Flip Type

FVID2_FLIP_TYPE_NONE

Flip Type is None.

FVID2_FLIP_TYPE_H

Flip Type is Horizontal i.e. along Y axis.

FVID2_FLIP_TYPE_V

Flip Type is Vertical i.e. along X axis.

FVID2_FLIP_TYPE_HV

Flip Type is Horizontal + Vertical.

typedef uint32_t Fvid2_FlipType

CSI2 Data formats

Data formats for CSI2 protocol.

FVID2_CSI2_DF_YUV420_8B

YUV 4:2:0 with 8bit for each Y/U/V.

FVID2_CSI2_DF_YUV420_10B

YUV 4:2:0 with 10bit for each Y/U/V.

FVID2_CSI2_DF_YUV420_8B_LEGACY

YUV 4:2:0 with 8bit for each Y/U/V.

FVID2_CSI2_DF_YUV420_8B_CHROMA_SHIFT

YUV 4:2:0 with 8bit for each Y/U/V with with phase shifted chroma.

FVID2_CSI2_DF_YUV420_10B_CHROMA_SHIFT

YUV 4:2:0 with 10bit for each Y/U/V with with phase shifted chroma.

FVID2_CSI2_DF_YUV422_8B

YUV 4:2:2 with 8bit for each Y/U/V.

FVID2_CSI2_DF_YUV422_10B

YUV 4:2:2 with 10bit for each Y/U/V.

FVID2_CSI2_DF_RGB444

RGB444 - 4-bits B); 4-bits G); 4-bits R.

FVID2_CSI2_DF_RGB555

RGB555 - 5-bits B); 5-bits G); 5-bits R.

FVID2_CSI2_DF_RGB565

RGB565 - 5-bits B); 6-bits G); 5-bits R.

FVID2_CSI2_DF_RGB666

RGB666 - 6-bits B); 6-bits G); 6-bits R.

FVID2_CSI2_DF_RGB888

RGB888 - 8-bits B); 8-bits G); 8-bits R.

FVID2_CSI2_DF_RAW6

6 bit raw-data.

FVID2_CSI2_DF_RAW7

7 bit raw-data.

FVID2_CSI2_DF_RAW8

8 bit raw-data.

FVID2_CSI2_DF_RAW10

10 bit raw-data.

FVID2_CSI2_DF_RAW12

12 bit raw-data.

FVID2_CSI2_DF_RAW14

14 bit raw-data.

FVID2_CSI2_DF_RAW16

16 bit raw-data.

FVID2_CSI2_DF_RAW20

20 bit raw-data.

Video Data format

Naming convention followed FVID2_DF_ARGB32_8888 In 8-bit byte memory

B0 B1 B2 B3 B4 B5 B6 B7

| A | R | G | B | A | R | G | B |

FVID2_DF_YUV422I_UYVY

B0 B1 B2 B3 B4 B5 B6 B7

| U | Y | V | Y | U | Y | V | Y |

FVID2_DF_ARGB16_4444

B0 B1 B2 B3 B4 B5 B6 B7

| AR | GB | AR | GB | AR | GB | AR | GB |

FVID2_DF_YUV422I_UYVY

YUV 422 Interleaved format - UYVY.

FVID2_DF_YUV422I_YUYV

YUV 422 Interleaved format - YUYV.

FVID2_DF_YUV422I_YVYU

YUV 422 Interleaved format - YVYU.

FVID2_DF_YUV422I_VYUY

YUV 422 Interleaved format - VYUY.

FVID2_DF_YUV422SP_UV

YUV 422 Semi-Planar - Y separate, UV interleaved.

FVID2_DF_YUV422SP_VU

YUV 422 Semi-Planar - Y separate, VU interleaved.

FVID2_DF_YUV422P

YUV 422 Planar - Y, U and V separate.

FVID2_DF_YUV420SP_UV

YUV 420 Semi-Planar - Y separate, UV interleaved.

FVID2_DF_YUV420SP_VU

YUV 420 Semi-Planar - Y separate, VU interleaved.

FVID2_DF_YUV420P

YUV 420 Planar - Y, U and V separate.

FVID2_DF_YUV444P

YUV 444 Planar - Y, U and V separate.

FVID2_DF_YUV444I

YUV 444 interleaved - YUVYUV…

FVID2_DF_RGB16_565

RGB565 16-bit - 5-bits R, 6-bits G, 5-bits B.

FVID2_DF_ARGB16_1555

ARGB1555 16-bit - 5-bits R, 5-bits G, 5-bits B, 1-bit Alpha .

FVID2_DF_RGBA16_5551

RGBA5551 16-bit - 5-bits R, 5-bits G, 5-bits B, 1-bit Alpha .

FVID2_DF_ARGB16_4444

ARGB4444 16-bit - 4-bits R, 4-bits G, 4-bits B, 4-bit Alpha .

FVID2_DF_RGBA16_4444

RGBA4444 16-bit - 4-bits R, 4-bits G, 4-bits B, 4-bit Alpha .

FVID2_DF_RGBX16_4444

RGBX4444 16-bit - 4-bits R, 4-bits G, 4-bits B, 4-bit Unused .

FVID2_DF_ARGB24_6666

ARGB6666 24-bit - 6-bits R, 6-bits G, 6-bits B, 6-bit Alpha .

FVID2_DF_RGBA24_6666

RGBA6666 24-bit - 6-bits R, 6-bits G, 6-bits B, 6-bit Alpha .

FVID2_DF_RGB24_888

RGB24 24-bit - 8-bits R, 8-bits G, 8-bits B.

FVID2_DF_BGRX_4444

RGBx12-16bit- 4-bits R, 4-bits G, 4-bits B, 4-bits unused .

FVID2_DF_XBGR_4444

xRGB12-16bit- 4-bits R, 4-bits G, 4-bits B, 4-bits unused.

FVID2_DF_ARGB32_8888

ARGB32 32-bit - 8-bits R, 8-bits G, 8-bits B, 8-bit Alpha .

FVID2_DF_XRGB32_8888

XRGB32 32-bit - 8-bits R, 8-bits G, 8-bits B, 8-bit unused .

FVID2_DF_RGBA32_8888

RGBA32 32-bit - 8-bits R, 8-bits G, 8-bits B, 8-bit Alpha .

FVID2_DF_BGR16_565

BGR565 16-bit - 5-bits B, 6-bits G, 5-bits R.

FVID2_DF_ABGR16_1555

ABGR1555 16-bit - 5-bits B, 5-bits G, 5-bits R, 1-bit Alpha .

FVID2_DF_ABGR16_4444

ABGR4444 16-bit - 4-bits B, 4-bits G, 4-bits R, 4-bit Alpha .

FVID2_DF_BGRA16_5551

BGRA5551 16-bit - 5-bits B, 5-bits G, 5-bits R, 1-bit Alpha .

FVID2_DF_BGRA16_4444

BGRA4444 16-bit - 4-bits B, 4-bits G, 4-bits R, 4-bit Alpha .

FVID2_DF_AGBR16_1555

ABGR1555 16-bit - 5-bits G, 5-bits B, 5-bits R, 1-bit Alpha .

FVID2_DF_AGBR16_4444

ABGR4444 16-bit - 4-bits G, 4-bits B, 4-bits R, 4-bit Alpha .

FVID2_DF_XGBR16_1555

XGBR1555 16-bit - 5-bits G, 5-bits B, 5-bits R, 1-bit unused .

FVID2_DF_BGRX16_5551

BGRX5551 16-bit - 5-bits B, 5-bits G, 5-bits R, 1-bit unused .

FVID2_DF_ABGR24_6666

ABGR6666 24-bit - 6-bits B, 6-bits G, 6-bits R, 6-bit Alpha .

FVID2_DF_BGR24_888

BGR888 24-bit - 8-bits B, 8-bits G, 8-bits R.

FVID2_DF_XBGR24_8888

xBGR888 24-bit - 8-bits B, 8-bits G, 8-bits R, 8-bit unused

FVID2_DF_RGBX24_8888

xBGR888 24-bit - 8-bits B, 8-bits G, 8-bits R, 8-bit unused

FVID2_DF_BGRX24_8888

xBGR888 24-bit - 8-bits B, 8-bits G, 8-bits R, 8-bit unused

FVID2_DF_ABGR32_8888

ABGR8888 32-bit - 8-bits B, 8-bits G, 8-bits R, 8-bit Alpha .

FVID2_DF_BGRA24_6666

BGRA6666 24-bit - 6-bits B, 6-bits G, 6-bits R, 6-bit Alpha .

FVID2_DF_BGRA32_8888

BGRA8888 32-bit - 8-bits B, 8-bits G, 8-bits R, 8-bit Alpha .

FVID2_DF_BGRX32_8888

BGRX8888 32-bit - 8-bits B, 8-bits G, 8-bits R, 8-bit unused.

FVID2_DF_BGRA16_1555

BGRA1555 16-bit - 5-bits B, 5-bits G, 5-bits R, 1-bit Alpha.

FVID2_DF_BGRX16_1555

BGRX1555 16-bit - 5-bits B, 5-bits G, 5-bits R, 1-bit unused.

FVID2_DF_BGRA32_1010102

BGRA1010102 32-bit - 10-bits B, 10-bits G, 10-bits R, 2-bit Alpha.

FVID2_DF_BGRX32_1010102

BGRX1010102 32-bit - 10-bits B, 10-bits G, 10-bits R, 2-bit unused.

FVID2_DF_RGBA32_1010102

RGBA1010102 32-bit - 10-bits B, 10-bits G, 10-bits R, 2-bit Alpha.

FVID2_DF_RGBX32_1010102

RGBX1010102 32-bit - 10-bits B, 10-bits G, 10-bits R, 2-bit unused.

FVID2_DF_BGRA64_16161616

RGBA16161616 64-bit - 16-bits B, 16-bits G, 16-bits R, 16-bit Alpha.

FVID2_DF_BGRX64_16161616

BGRX16161616 64-bit - 16-bits B, 16-bits G, 16-bits R, 16-bit unused.

FVID2_DF_ABGR64_16161616

ABGR16161616 64-bit - 16-bits B, 16-bits G, 16-bits R, 16-bit Alpha.

FVID2_DF_XBGR64_16161616

XBGR16161616 64-bit - 16-bits B, 16-bits G, 16-bits R, 16-bit unused.

FVID2_DF_BITMAP8

BITMAP 8bpp.

FVID2_DF_BITMAP4_LOWER

BITMAP 4bpp lower address in CLUT.

FVID2_DF_BITMAP4_UPPER

BITMAP 4bpp upper address in CLUT.

FVID2_DF_BITMAP2_OFFSET0

BITMAP 2bpp offset 0 in CLUT.

FVID2_DF_BITMAP2_OFFSET1

BITMAP 2bpp offset 1 in CLUT.

FVID2_DF_BITMAP2_OFFSET2

BITMAP 2bpp offset 2 in CLUT.

FVID2_DF_BITMAP2_OFFSET3

BITMAP 2bpp offset 3 in CLUT.

FVID2_DF_BITMAP1_OFFSET0

BITMAP 1bpp offset 0 in CLUT.

FVID2_DF_BITMAP1_OFFSET1

BITMAP 1bpp offset 1 in CLUT.

FVID2_DF_BITMAP1_OFFSET2

BITMAP 1bpp offset 2 in CLUT.

FVID2_DF_BITMAP1_OFFSET3

BITMAP 1bpp offset 3 in CLUT.

FVID2_DF_BITMAP1_OFFSET4

BITMAP 1bpp offset 4 in CLUT.

FVID2_DF_BITMAP1_OFFSET5

BITMAP 1bpp offset 5 in CLUT.

FVID2_DF_BITMAP1_OFFSET6

BITMAP 1bpp offset 6 in CLUT.

FVID2_DF_BITMAP1_OFFSET7

BITMAP 1bpp offset 7 in CLUT.

FVID2_DF_BITMAP8_BGRA32

BITMAP 8bpp BGRA32.

FVID2_DF_BITMAP4_BGRA32_LOWER

BITMAP 4bpp BGRA32 lower address in CLUT.

FVID2_DF_BITMAP4_BGRA32_UPPER

BITMAP 4bpp BGRA32 upper address in CLUT.

FVID2_DF_BITMAP2_BGRA32_OFFSET0

BITMAP 2bpp BGRA32 offset 0 in CLUT.

FVID2_DF_BITMAP2_BGRA32_OFFSET1

BITMAP 2bpp BGRA32 offset 1 in CLUT.

FVID2_DF_BITMAP2_BGRA32_OFFSET2

BITMAP 2bpp BGRA32 offset 2 in CLUT.

FVID2_DF_BITMAP2_BGRA32_OFFSET3

BITMAP 2bpp BGRA32 offset 3 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET0

BITMAP 1bpp BGRA32 offset 0 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET1

BITMAP 1bpp BGRA32 offset 1 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET2

BITMAP 1bpp BGRA32 offset 2 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET3

BITMAP 1bpp BGRA32 offset 3 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET4

BITMAP 1bpp BGRA32 offset 4 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET5

BITMAP 1bpp BGRA32 offset 5 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET6

BITMAP 1bpp BGRA32 offset 6 in CLUT.

FVID2_DF_BITMAP1_BGRA32_OFFSET7

BITMAP 1bpp BGRA32 offset 7 in CLUT.

FVID2_DF_BAYER_RAW

Bayer pattern.

FVID2_DF_BAYER_GRBG

Raw bayer data color pattern G R G R … B G B G …

FVID2_DF_BAYER_RGGB

Raw bayer data color pattern R G G R … G B G B …

FVID2_DF_BAYER_BGGR

Raw bayer data color pattern B G B G … G B G B …

FVID2_DF_BAYER_GBRG

Raw bayer data color pattern G B G B … R R R G …

FVID2_DF_RAW_VBI

Raw VBI data.

FVID2_DF_RAW24

24 bit raw-data.

FVID2_DF_RAW16

16 bit raw-data.

FVID2_DF_RAW08

8 bit raw-data.

FVID2_DF_MISC

For future purpose.

FVID2_DF_BITMAP4

BITMAP 4bpp.

FVID2_DF_BITMAP2

BITMAP 2bpp.

FVID2_DF_BITMAP1

BITMAP 1bpp.

FVID2_DF_RAW06

6 bit raw-data.

FVID2_DF_RAW07

7 bit raw-data.

FVID2_DF_RAW10

10 bit raw-data.

FVID2_DF_RAW12

12 bit raw-data.

FVID2_DF_RAW14

14 bit raw-data.

FVID2_DF_JPEG1_INTERCHANGE

JPEG INTERCHANGE data.

FVID2_DF_JPEG2_JFIF

JPEG2 JFIF data.

FVID2_DF_JPEG3_EXIF

JPEG3 EXIF data.

FVID2_DF_DPCM_10_8_10_PRED1

DPCM 10-8-10 PRED1 data.

FVID2_DF_DPCM_10_8_10_PRED2

DPCM 10-8-10 PRED2 data.

FVID2_DF_DPCM_10_7_10_PRED1

DPCM 10-7-10 PRED1 data.

FVID2_DF_DPCM_10_7_10_PRED2

DPCM 10-7-10 PRED2 data.

FVID2_DF_DPCM_10_6_10_PRED1

DPCM 10-6-10 PRED1 data.

FVID2_DF_DPCM_10_6_10_PRED2

DPCM 10-6-10 PRED2 data.

FVID2_DF_DPCM_12_8_10_PRED1

DPCM 12-8-10 PRED1 data.

FVID2_DF_DPCM_12_8_10_PRED2

DPCM 12-8-10 PRED2 data.

FVID2_DF_DPCM_12_7_10_PRED1

DPCM 12-7-10 PRED1 data.

FVID2_DF_DPCM_12_7_10_PRED2

DPCM 12-7-10 PRED2 data.

FVID2_DF_DPCM_12_6_10_PRED1

DPCM 12-6-10 PRED1 data.

FVID2_DF_DPCM_12_6_10_PRED2

DPCM 12-6-10 PRED2 data.

FVID2_DF_BGR16_565_A8

BGR565 16-bit - 5-bits B, 6-bits G, 5-bits R. Alpha 8-bits another plane.

FVID2_DF_RGB16_565_A8

RGB565 16-bit - 5-bits R, 6-bits G, 5-bits B. Alpha 8-bits another plane.

FVID2_DF_LUMA_ONLY

Luma only data for YUV data format.

FVID2_DF_CHROMA_ONLY

Chroma only data for YUV data format.

FVID2_DF_RGB24_888_PLANAR

RGB888 planar format data format.

FVID2_DF_ARGB48_12121212

ARGB48 48-bit - 12-bits R, 12-bits G, 12-bits B, 12-bit Alpha .

FVID2_DF_GREY

Grey only data.

FVID2_DF_SATURATION

Saturation only data.

FVID2_DF_HUE

Hue only data.

FVID2_DF_RAW

RAW data.

FVID2_DF_RED

Red Color Component.

FVID2_DF_GREEN

Green Color Component.

FVID2_DF_BLUE

Blue Color Component.

FVID2_DF_2PLANES

2 plane format, These plane can be YY or any combination of RGB

FVID2_DF_PLANE_1
FVID2_DF_PLANE_2
FVID2_DF_R_GBI

R+GB interleaved.

FVID2_DF_RGI_B

RG+B RG interleaved.

FVID2_DF_RGB

R+G+B.

FVID2_DF_R

R.

FVID2_DF_GBI

GB interleaved.

FVID2_DF_RGI
FVID2_DF_RGBX16_5551

RGBX5551 16-bit - 5-bits B, 5-bits G, 5-bits R, 1-bit unused .

FVID2_DF_INVALID

Invalid data format. Could be used to initialize variables.

typedef uint32_t Fvid2_DataFormat

Scan format

FVID2_SF_INTERLACED

Interlaced mode.

FVID2_SF_PROGRESSIVE

Progressive mode.

FVID2_SF_MAX

Used by driver for validating the input parameters.

typedef uint32_t Fvid2_ScanFormat

Video standards

FVID2_STD_NTSC

720x480 30FPS interlaced NTSC standard.

FVID2_STD_PAL

720x576 30FPS interlaced PAL standard.

FVID2_STD_480I

720x480 30FPS interlaced SD standard.

FVID2_STD_576I

720x576 30FPS interlaced SD standard.

FVID2_STD_CIF

Interlaced, 360x120 per field NTSC, 360x144 per field PAL.

FVID2_STD_HALF_D1

Interlaced, 360x240 per field NTSC, 360x288 per field PAL.

FVID2_STD_D1

Interlaced, 720x240 per field NTSC, 720x288 per field PAL.

FVID2_STD_480P

720x480 60FPS progressive ED standard.

FVID2_STD_576P

720x576 60FPS progressive ED standard.

FVID2_STD_720P_60

1280x720 60FPS progressive HD standard.

FVID2_STD_720P_50

1280x720 50FPS progressive HD standard.

FVID2_STD_1080I_60

1920x1080 30FPS interlaced HD standard.

FVID2_STD_1080I_50

1920x1080 50FPS interlaced HD standard.

FVID2_STD_1080P_60

1920x1080 60FPS progressive HD standard.

FVID2_STD_1080P_50

1920x1080 50FPS progressive HD standard.

FVID2_STD_1080P_24

1920x1080 24FPS progressive HD standard.

FVID2_STD_1080P_30

1920x1080 30FPS progressive HD standard.

FVID2_STD_VGA_60

640x480 60FPS VESA standard.

FVID2_STD_VGA_72

640x480 72FPS VESA standard.

FVID2_STD_VGA_75

640x480 75FPS VESA standard.

FVID2_STD_VGA_85

640x480 85FPS VESA standard.

FVID2_STD_WVGA_60

800x480 60PFS WVGA

FVID2_STD_SVGA_60

800x600 60FPS VESA standard.

FVID2_STD_SVGA_72

800x600 72FPS VESA standard.

FVID2_STD_SVGA_75

800x600 75FPS VESA standard.

FVID2_STD_SVGA_85

800x600 85FPS VESA standard.

FVID2_STD_WSVGA_70

1024x600 70FPS standard.

FVID2_STD_XGA_60

1024x768 60FPS VESA standard.

FVID2_STD_XGA_DSS_TDM_60

1024x768 60FPS VESA standard. Applicable for DSS in 8-bit TDM mode.

FVID2_STD_XGA_70

1024x768 72FPS VESA standard.

FVID2_STD_XGA_75

1024x768 75FPS VESA standard.

FVID2_STD_XGA_85

1024x768 85FPS VESA standard.

FVID2_STD_1368_768_60

1368x768 60 PFS VESA.

FVID2_STD_1366_768_60

1366x768 60 PFS VESA.

FVID2_STD_1360_768_60

1360x768 60 PFS VESA.

FVID2_STD_WXGA_30

1280x800 30FPS VESA standard.

FVID2_STD_WXGA_60

1280x800 60FPS VESA standard.

FVID2_STD_WXGA_75

1280x800 75FPS VESA standard.

FVID2_STD_WXGA_85

1280x800 85FPS VESA standard.

FVID2_STD_1440_900_60

1440x900 60 PFS VESA standard.

FVID2_STD_SXGA_60

1280x1024 60FPS VESA standard.

FVID2_STD_SXGA_75

1280x1024 75FPS VESA standard.

FVID2_STD_SXGA_85

1280x1024 85FPS VESA standard.

FVID2_STD_WSXGAP_60

1680x1050 60 PFS VESA standard.

FVID2_STD_SXGAP_60

1400x1050 60FPS VESA standard.

FVID2_STD_SXGAP_75

1400x1050 75FPS VESA standard.

FVID2_STD_UXGA_60

1600x1200 60FPS VESA standard.

FVID2_STD_MUX_2CH_D1

Interlaced, 2Ch D1, NTSC or PAL.

FVID2_STD_MUX_2CH_HALF_D1

Interlaced, 2ch half D1, NTSC or PAL.

FVID2_STD_MUX_2CH_CIF

Interlaced, 2ch CIF, NTSC or PAL.

FVID2_STD_MUX_4CH_D1

Interlaced, 4Ch D1, NTSC or PAL.

FVID2_STD_MUX_4CH_CIF

Interlaced, 4Ch CIF, NTSC or PAL.

FVID2_STD_MUX_4CH_HALF_D1

Interlaced, 4Ch Half-D1, NTSC or PAL.

FVID2_STD_MUX_8CH_CIF

Interlaced, 8Ch CIF, NTSC or PAL.

FVID2_STD_MUX_8CH_HALF_D1

Interlaced, 8Ch Half-D1, NTSC or PAL.

FVID2_STD_WXGA_5x3_30

WXGA standard (1280x768) with the aspect ratio 5:3 at 30FPS.

FVID2_STD_WXGA_5x3_60

WXGA resolution (1280x768) with the aspect ratio 5:3 at 60FPS.

FVID2_STD_WXGA_5x3_75

WXGA resolution (1280x768) with the aspect ratio 5:3 at 75FPS.

FVID2_STD_AUTO_DETECT

Auto-detect standard. Used in capture mode.

FVID2_STD_CUSTOM

Custom standard used when connecting to external LCD etc… The video timing is provided by the application. Used in display mode.

typedef uint32_t Fvid2_Standard

Field type

FVID2_FID_TOP

Top field.

FVID2_FID_BOTTOM

Bottom field.

FVID2_FID_FRAME

Frame mode - Contains both the fields or a progressive frame.

FVID2_FID_MAX

Used by driver for validating the input parameters.

typedef uint32_t Fvid2_Fid

Polarity type

FVID2_POL_LOW

Low Polarity.

FVID2_POL_HIGH

High Polarity.

FVID2_POL_MAX

Used by driver for validating the input parameters.

typedef uint32_t Fvid2_Polarity

Edge Polarity type

FVID2_EDGE_POL_RISING

Rising Edge.

FVID2_EDGE_POL_FALLING

Falling Edge.

FVID2_EDGE_POL_MAX

Used by driver for validating the input parameters.

typedef uint32_t Fvid2_EdgePolarity

Field ID polarity

FVID2_FIDPOL_NORMAL

FID = 0, top field.

FVID2_FIDPOL_INVERT

FID = 1, bottom field.

typedef uint32_t Fvid2_FidPol

Buffer storage format

FVID2_BUF_FMT_FIELD

Buffers are captured/displayed as fields instead of frames.

FVID2_BUF_FMT_FRAME

Buffers are captured/displayed as frames.

typedef uint32_t Fvid2_BufferFormat

Storage Format for each color component in pixel

FVID2_CCSF_BITS1_PACKED

1 Bits per Pixel packed.

FVID2_CCSF_BITS2_PACKED

2 Bits per Pixel packed.

FVID2_CCSF_BITS4_PACKED

4 Bits per Pixel packed.

FVID2_CCSF_BITS8_PACKED

8 Bits per Pixel packed.

FVID2_CCSF_BITS10_PACKED

12 Bits per Pixel packed.

FVID2_CCSF_BITS12_PACKED

12 Bits per Pixel packed.

FVID2_CCSF_BITS14_PACKED

14 Bits per Pixel packed.

FVID2_CCSF_BITS16_PACKED

16 Bits per Pixel packed.

FVID2_CCSF_BITS24_PACKED

24 Bits per Pixel packed.

FVID2_CCSF_BITS32_PACKED

32 Bits per Pixel packed.

FVID2_CCSF_BITS6_UNPACKED8

6 Bits per Pixel unpacked in 8bit container.

FVID2_CCSF_BITS7_UNPACKED8

7 Bits per Pixel unpacked in 8bit container.

FVID2_CCSF_BITS8_UNPACKED12

8 Bits per Pixel unpacked in 12bit container.

FVID2_CCSF_BITS8_UNPACKED16

8 Bits per Pixel unpacked in 12bit container.

FVID2_CCSF_BITS9_UNPACKED16

9 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS10_UNPACKED16

10 Bits per Pixel unpacked in 16bit container

FVID2_CCSF_BITS11_UNPACKED16

11 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS12_UNPACKED16

12 Bits per Pixel, unpacked in 16bit container

FVID2_CCSF_BITS13_UNPACKED16

13 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS14_UNPACKED16

14 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS15_UNPACKED16

15 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS20_UNPACKED24

20 Bits per Pixel unpacked in 24bit container.

FVID2_CCSF_BITS6_UNPACKED8_MSB_ALIGNED

6 Bits per Pixel unpacked in 8bit container.

FVID2_CCSF_BITS7_UNPACKED8_MSB_ALIGNED

7 Bits per Pixel unpacked in 8bit container.

FVID2_CCSF_BITS8_UNPACKED12_MSB_ALIGNED

8 Bits per Pixel unpacked in 12bit container.

FVID2_CCSF_BITS8_UNPACKED16_MSB_ALIGNED

8 Bits per Pixel unpacked in 12bit container.

FVID2_CCSF_BITS9_UNPACKED16_MSB_ALIGNED

9 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS10_UNPACKED16_MSB_ALIGNED

10 Bits per Pixel unpacked in 16bit container

FVID2_CCSF_BITS11_UNPACKED16_MSB_ALIGNED

11 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS12_UNPACKED16_MSB_ALIGNED

12 Bits per Pixel, unpacked in 16bit container

FVID2_CCSF_BITS13_UNPACKED16_MSB_ALIGNED

13 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS14_UNPACKED16_MSB_ALIGNED

14 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS15_UNPACKED16_MSB_ALIGNED

15 Bits per Pixel unpacked in 16bit container.

FVID2_CCSF_BITS20_UNPACKED24_MSB_ALIGNED

20 Bits per Pixel unpacked in 24bit container.

FVID2_CCSF_MAX

Used by driver for validating the input parameters.

typedef uint32_t Fvid2_ColorCompStorageFmt

Digital video interface width

FVID2_VIFW_8BIT

8-bit interface.

FVID2_VIFW_10BIT

10-bit interface.

FVID2_VIFW_12BIT

12-bit interface.

FVID2_VIFW_14BIT

14-bit interface.

FVID2_VIFW_16BIT

16-bit interface.

FVID2_VIFW_18BIT

18-bit interface.

FVID2_VIFW_20BIT

20-bit interface.

FVID2_VIFW_24BIT

24-bit interface.

FVID2_VIFW_30BIT

30-bit interface.

FVID2_VIFW_36BIT

36-bit interface.

FVID2_VIFW_1LANES

CSI2 specific - 1 data lanes.

FVID2_VIFW_2LANES

CSI2 specific - 2 data lanes.

FVID2_VIFW_3LANES

CSI2 specific - 3 data lanes.

FVID2_VIFW_4LANES

CSI2 / LVDS specific - 4 data lanes.

FVID2_VIFW_MAX

Maximum modes.

typedef uint32_t Fvid2_VideoIfWidth

Fvid2 Video If Mode

FVID2_VIFM_SCH_ES

Single Channel non multiplexed mode.

FVID2_VIFM_MCH_LINE_MUX_ES

Multi-channel line-multiplexed mode.

FVID2_VIFM_MCH_PIXEL_MUX_ES

Multi-channel pixel muxed.

FVID2_VIFM_SCH_DS_HSYNC_VBLK

Single Channel non multiplexed discrete sync mode with HSYNC and VBLK as control signals.

FVID2_VIFM_SCH_DS_HSYNC_VSYNC

Single Channel non multiplexed discrete sync mode with HSYNC and VSYNC as control signals.

FVID2_VIFM_SCH_DS_AVID_VBLK

Single Channel non multiplexed discrete sync mode with AVID and VBLK as control signals.

FVID2_VIFM_SCH_DS_AVID_VSYNC

Single Channel non multiplexed discrete sync mode with AVID and VBLK as control signals.

FVID2_VIFM_MCH_LINE_MUX_SPLIT_LINE_ES

Multi-channel line-multiplexed mode - split line mode.

FVID2_VIFM_SCH_CSI2

Single channel capture via CSI2 interface

FVID2_VIFM_SCH_LVDS

Single channel capture via LVDS interface

FVID2_VIFM_SCH_CPI

Single channel capture via Parallel interface

FVID2_VIFM_MAX

Should be the last value of this enumeration. Will be used by driver for validating the input parameters.

typedef uint32_t Fvid2_VideoIfMode

Video interface mode.

Fvid2 chroma position

FVID2_CHROMA_POS_COSITED

Chroma is cosited

FVID2_CHROMA_POS_CENTERED

Chroma is Centered

typedef uint32_t Fvid2_ChromaPos

Enum for selecting chroma position in chroma up or down sampler.

Fvid2 Bayer Color Component

FVID2_BAYER_COLOR_COMP_R

Red Color Component in Bayer image

FVID2_BAYER_COLOR_COMP_GR

GreenR Color Component in Bayer image

FVID2_BAYER_COLOR_COMP_GB

GreenB Color Component in Bayer image

FVID2_BAYER_COLOR_COMP_B

Blue Color Component in Bayer image

FVID2_BAYER_COLOR_COMP_MAX

This should be the last number, used in specifying array size

typedef uint32_t Fvid2_BayerColorComp

Enum for selecting bayer color components for odd/even pixel position on odd/even lines, Also used for specifying gain and offset in White balance config for each color component.

Fvid2 frame status

FVID2_FRAME_STATUS_INIT

FVID2 Frame is initialized using init function

FVID2_FRAME_STATUS_COMPLETED

Frame processing is completed and can be used in the application

FVID2_FRAME_STATUS_PENDING

Frame processing is still pending, used for the frames which are dequeued before being processed

FVID2_FRAME_STATUS_SUBMITTED

Frame is just submitted to the driver

FVID2_FRAME_STATUS_ERROR

Frame has error

FVID2_FRAME_STATUS_ABORTED

Frame processing is aborted, used for the frames which are force moved to output queue

FVID2_FRAME_STATUS_OVERFLOW

The IP processing this frame experienced and overflow of its internal buffers. Indicates severe error

FVID2_FRAME_STATUS_ECC_CORRECTED

There was 1 bit ECC error, which was corrected. Provided the hardware and/or protocol used to process this frame supports ECC

FVID2_FRAME_STATUS_CRC_ERROR

CRC errors were detected, the integrity of the data is not guaranteed. Provided the hardware and/or protocol used to process this frame supports CRC

FVID2_FRAME_STATUS_ECC_ERROR

There were multiple bit ECC error, which was could not be corrected. Provided the hardware and/or protocol used to process this frame supports ECC

FVID2_FRAME_STATUS_SUBMISSION_ERROR

Frame cannot be submitted to the driver

FVID2_FRAME_STATUS_TRUNCATED

Received a short packet (truncated packet)

FVID2_FRAME_STATUS_ELONGATED

Received a long packet (Elongated packet)

FVID2_FRAME_STATUS_MAX

This should be the last number,

typedef uint32_t Fvid2_FrameStatus

Enum for state of the FVID2 frame. Typically used for marking FVID2_frame as either SUBMITTED, Completed/Done, Errorneous at the time of flush/abort when driver returns back all the frames.

Defines

FVID2_TIMEOUT_NONE

No Timeout.

FVID2_TIMEOUT_FOREVER

Timeout wait forever.

Functions

int32_t Fvid2_getModeInfo(Fvid2_ModeInfo *modeInfo)

Function to get the information about various FVID2 modes/standards.

Parameters:

modeInfo – [OUT] Pointer to Fvid2_ModeInfo structure where the information is filled.

Returns:

FVID2_SOK on success, else appropriate FVID2 error code on failure.

const char *Fvid2_getDataFmtString(uint32_t dataFmt)

Function to get the name of the data format in printable string.

Parameters:

dataFmt – [IN] Data format to get the name. For valid values see Fvid2_DataFormat.

Returns:

Returns a const pointer to the string. If the data format is not known, then it return the string as “UNKNOWN”.

const char *Fvid2_getStandardString(uint32_t standard)

Function to get the name of the standard in printable string.

Parameters:

standard – [IN] Standard to get the name. For valid values see Fvid2_Standard.

Returns:

Returns a const pointer to the string. If the standard is not known, then it return the string as “UNKNOWN”.

static inline int32_t Fvid2_isDataFmtYuv422(uint32_t dataFmt)

Function to check whether a data format is YUV422.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is YUV422, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtYuv420(uint32_t dataFmt)

Function to check whether a data format is YUV420.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is YUV420, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtYuv420Sp(uint32_t dataFmt)

Function to check whether a data format is YUV420SP.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is YUV420SP, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtYuv422Sp(uint32_t dataFmt)

Function to check whether a data format is YUV422SP.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is YUV422SP, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtSemiPlanar(uint32_t dataFmt)

Function to check whether a data format is semi-planar.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is semi-planar, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtYuv422I(uint32_t dataFmt)

Function to check whether a data format is YUV422 interleaved.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is YUV422 interleaved, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtYuv444(uint32_t dataFmt)

Function to check whether a data format is YUV444 .

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is YUV444 , FALSE otherwise.

static inline int32_t Fvid2_isDataFmtYuv(uint32_t dataFmt)

Function to check whether a data format is YUV.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is YUV, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtBayer(uint32_t dataFmt)

Function to check whether a data format is Bayer with MosaicPattern.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is Bayer, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtRgb16bit(uint32_t dataFmt)

Function to check whether a data format is RGB 16-bit.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is RGB 16-bit, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtRgb(uint32_t dataFmt)

Function to check whether a data format is RGB .

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is RGB , FALSE otherwise.

static inline int32_t Fvid2_isDataFmtRgb24bit(uint32_t dataFmt)

Function to check whether a data format is RGB 24-bit.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is RGB 24-bit, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtRgb32bit(uint32_t dataFmt)

Function to check whether a data format is RGB 32-bit.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is RGB 32-bit, FALSE otherwise.

static inline int32_t Fvid2_isDataFmtRgb64bit(uint32_t dataFmt)

Function to check whether a data format is RGB 64 bit.

Parameters:

dataFmt – [IN] Data format to check. For valid values see Fvid2_DataFormat.

Returns:

Returns TRUE if data format is RGB 64-bit, FALSE otherwise.

static inline uint32_t Fvid2_BayerColorIndex(uint32_t dataFmt, uint32_t color)

Function to get the index of the color for bayer data format.

Parameters:
Returns:

Returns index of the color component.

static inline int32_t Fvid2_isStandardVesa(uint32_t standard)

Function to check whether a standard is VESA mode or not.

Parameters:

standard – [IN] Standard to check. For valid values see Fvid2_Standard.

Returns:

Returns TRUE if standard is VESA, FALSE otherwise.

static inline void Fvid2Format_init(Fvid2_Format *fmt)

Fvid2_Format structure init function.

Parameters:

fmt – [IN] Pointer to Fvid2_Format structure.

static inline void Fvid2SubFrameInfo_init(Fvid2_SubFrameInfo *sfInfo)

Fvid2_SubFrameInfo structure init function.

Parameters:

sfInfo – [IN] Pointer to Fvid2_SubFrameInfo structure.

static inline void Fvid2Frame_init(Fvid2_Frame *frm)

Fvid2_Frame structure init function.

Parameters:

frm – [IN] Pointer to Fvid2_Frame structure.

static inline void Fvid2FrameList_init(Fvid2_FrameList *fList)

Fvid2_FrameList structure init function.

Parameters:

fList – [IN] Pointer to Fvid2_FrameList structure.

static inline void Fvid2ModeInfo_init(Fvid2_ModeInfo *modeInfo)

Fvid2_ModeInfo structure init function. This defaults to 1080p60.

Parameters:

modeInfo – [IN] Pointer to Fvid2_ModeInfo structure.

static inline void Fvid2CropConfig_init(Fvid2_CropConfig *cropCfg)

Fvid2_CropConfig structure init function.

Parameters:

cropCfg – [IN] Pointer to Fvid2_CropConfig structure.

static inline void Fvid2EdgeCropConfig_init(Fvid2_EdgeCropConfig *edgeCropCfg)

Fvid2_EdgeCropConfig structure init function.

Parameters:

edgeCropCfg – [IN] Pointer to Fvid2_EdgeCropConfig structure.

static inline void Fvid2PosConfig_init(Fvid2_PosConfig *posCfg)

Fvid2_PosConfig structure init function.

Parameters:

posCfg – [IN] Pointer to Fvid2_PosConfig structure.

struct Fvid2_Format
#include <fvid2_dataTypes.h>

FVID2 video buffer format specification.

Defines the format capabilities of the buffer like dataformat, scanFormat, width, height etc. Used during Fvid2_create() by some drivers. Used as parameter to Fvid2_setFormat(), Fvid2_getFormat() by some drivers.

Public Members

uint32_t chNum

Channel Number to which this format belongs to.

uint32_t width

Width of the video frame or field in pixels.

uint32_t height

Height of the video frame or field in lines.

uint32_t pitch[FVID2_MAX_PLANES]

Pitch in bytes for each of the sub-buffers. This represents the difference between two consecutive line addresses in bytes. This is irrespective of whether the video is interlaced or progressive and whether the fields are merged or separated for interlaced video.

uint32_t fieldMerged[FVID2_MAX_PLANES_PER_FIELD]

This field tells whether both the fields have to be merged, i.e line interleaved or not. Used only for interlaced format. The effective pitch is calculated based on this information along with pitch parameter. If fields are merged, effective pitch = pitch * 2 else effective pitch = pitch.

uint32_t dataFormat

Frame data Format. For valid values see Fvid2_DataFormat.

uint32_t scanFormat

Scan Format. For valid values see Fvid2_ScanFormat.

uint32_t ccsFormat

Color Component Storage format. For valid values see Fvid2_ColorCompStorageFmt.

struct Fvid2_SubFrameInfo
#include <fvid2_dataTypes.h>

Sub-Frame information.

This is used in drivers supporting sub-frame level processing, for application and driver interaction

Public Members

uint32_t subFrameNum

[IN]/[OUT] Current sub-frame number in this frame, range is from 0 to (number of sub-frames in frame - 1). Set by application and used by driver in case of M2M mode. Set by driver and used by application in case of capture mode.

uint32_t numInLines

[IN] Number of lines available in input frame at the end of this sub-frame. Used only in M2M mode. Not used in capture mode.

uint32_t numOutLines

[OUT] Number of lines generated in output buffer after processing current sub-frame. Set by driver and used by application.

struct Fvid2_Frame
#include <fvid2_dataTypes.h>

FVID2 frame buffer structure.

Represents the attribute of one buffer in frame. Attributes like address of each planes and each fields. YUV420 semi-planar buffer with interlaced scan format will have two planes one each for Y data and UV data and odd and even fields.

Public Members

uint64_t addr[FVID2_MAX_PLANES]

FVID2 buffer pointers for supporting multiple addresses like Y, U, V etc for a given frame. The interpretation of these pointers depend on the format configured for the driver. Not all pointers are valid for a given format.

Representation of YUV422 Interlaced Planar Buffer: Field 0 Y -> addr[0], Field 1 Y -> addr[3] Field 0 U -> addr[1], Field 1 U -> addr[4] Field 0 V -> addr[2], Field 1 V -> addr[5] Representation of YUV422 Progressive Planar Buffer: Y -> addr[0] U -> addr[1] V -> addr[2] Other pointers are not valid.

Representation of Interlaced YUV422 Interleaved Buffer: Field 0 YUV -> addr[0], Field 1 YUV -> addr[3] Representation of Progressive YUV422 Interleaved Buffer: YUV -> addr[0] Other pointers are not valid.

Representation of Interlaced YUV420SP or YUV422SP Buffer: Field 0 Y -> addr[0], Field 1 Y -> addr[3] Field 0 UV -> addr[1], Field 1 UV -> addr[4] Representation of Progressive YUV420SP or YUV422SP Buffer: Y -> addr[0] UV -> addr[1] Other pointers are not valid.

Representation of Interlaced RGB888 Buffer Field 0 RGB -> addr[0], Field 1 RGB -> addr[3], Representation of Progressive RGB888 Buffer RGB -> addr[0] Other pointers are not valid.

uint32_t fid

Indicates whether this frame belong to top or bottom field. For valid values see Fvid2_Fid.

uint32_t chNum

Channel number to which this FVID2 frame belongs to.

uint64_t timeStamp64

64-bit Time stamp returned by the driver. The value and the unit is driver implementation dependent. But in general the time stamp stored is in micro-seconds. Refer to each driver implementation for the meaning and unit of the time stamp value. Only valid for frames received using Fvid2_dequeue().

void *appData

Additional application parameter per frame. This is not modified by driver.

void *perFrameCfg

Per frame configuration parameters like scaling ratio, positioning, cropping etc… This should be set to NULL if not used.

This can be used by application to control driver behaviour on a per frame basis, example changing scaling ratio for scaler driver.

This can be used by application to get per frame status, example detected frame width, height from capture driver.

This could be set to NULL if not used. In this case, the driver will use the last supplied configuration.

The exact structure type that is passed is driver specific.

void *drvData

Used by driver. Application should not modify this.

Fvid2_SubFrameInfo *subFrameInfo

Used for SubFrame level processing information exchange between application and driver. This could be set to NULL if sub-frame level processing is not used.

uint32_t status

Status of the Frame, see Fvid2_FrameStatus for the valid values Updated by the driver

struct Fvid2_FrameList
#include <fvid2_dataTypes.h>

FVID2 frame buffer list used to exchange multiple FVID2 frames in a single driver call.

Framelist represents N frames. For display N frames represent buffer address of each window in a multi-window mode. For capture it represents different channel buffers for the multiplexed channels. Currently Fvid2_Framelist can handle maximum of FVID2_MAX_FRAME_PTR frame pointers.

Unless specified otherwise, all fields in this structure are

[IN] for Fvid2_queue(), Fvid2_processRequest() operation. [OUT] for Fvid2_dequeue(), Fvid2_getProcessedRequest() operation.

Public Members

Fvid2_Frame *frames[FVID2_MAX_FRAME_PTR]

Array of Fvid2_Frame pointers that are to given or received from the driver.

uint32_t numFrames

Number of frames that are given or received from the driver i.e number of valid pointers in the array containing Fvid2_Frame pointers.

void *drvData

Used by driver. Application should not modify this.

void *appData

Additional application parameter per frame. This is not modified by driver.

void *perListCfg

Per list configuration parameters like scaling ratio, positioning, cropping etc which are applicable for the frames together.

This could be set to NULL if not used. In this case, the driver will use the last supplied configuration.

The exact structure type that is passed is driver specific.

struct Fvid2_ModeInfo
#include <fvid2_dataTypes.h>

FVID2 Mode information structure.

Public Members

uint32_t standard

[IN] Standard for which to get the info. For valid values see Fvid2_Standard.

uint32_t width

Active video frame width in pixels.

uint32_t height

Active video frame height in lines.

uint32_t scanFormat

Scan format of standard. For valid values see Fvid2_ScanFormat.

uint32_t pixelClock

Pixel clock of standard in KHz. This assumes 8-bit interface for NTSC/PAL/480I/576I resolutions and 16/24-bit interface for other resolutions including 480P and 576P.

uint32_t fps

Frames per second.

uint32_t hFrontPorch

Horizontal front porch. Same for both fields in case of interlaced display.

uint32_t hBackPorch

Horizontal back porch.

uint32_t hSyncLen

Horizontal sync length. Same for both fields in case of interlaced display.

uint32_t vFrontPorch

Vertical front porch for each field or frame.

uint32_t vBackPorch

Vertical back porch for each field or frame.

uint32_t vSyncLen

Vertical sync length for each field.

struct Fvid2_CropConfig
#include <fvid2_dataTypes.h>

Structure containing crop configuration - used in Scaler and VCOMP.

struct Fvid2_CropConfig

Public Members

uint32_t cropStartX

Horizontal offset from which picture needs to be cropped.

uint32_t cropStartY

Vertical offset from which picture needs to be cropped.

uint32_t cropWidth

Width of the picture to be cropped.

uint32_t cropHeight

Height of the picture to be cropped.

struct Fvid2_EdgeCropConfig
#include <fvid2_dataTypes.h>

Structure containing edge crop configuration - used in DSS.

struct Fvid2_EdgeCropConfig

A frame has four edges: top, bottom, left and right. User can decide to crop in any direction. cropTop will be used to remove the particular number of lines from the top of the frame. Similarly other fields will be used.

Public Members

uint32_t cropTop

Crop Top Edge in Lines

uint32_t cropBottom

Crop Bottom Edge in Lines

uint32_t cropLeft

Crop Left Edge in Pixels

uint32_t cropRight

Crop Right Edge in Pixels

struct Fvid2_PosConfig
#include <fvid2_dataTypes.h>

Structure containing position configuration - used in VCOMP and CIG.

struct Fvid2_PosConfig

Public Members

uint32_t startX

Horizontal offset from which picture needs to be positioned.

uint32_t startY

Vertical offset from which picture needs to be positioned.

struct Fvid2_SizeConfig
#include <fvid2_dataTypes.h>

Structure containing size configuration.

struct Fvid2_SizeConfig

Public Members

UInt32 width

Width of the picture.

UInt32 height

Height of the picture.