Video Driver API functions. More...
Typedefs | |
typedef void(* | VideoDrv_Event_t) (uint32_t channel, uint32_t event) |
Video Events callback function type. | |
Functions | |
int32_t | VideoDrv_Initialize (VideoDrv_Event_t cb_event) |
Initialize Video Interface. | |
int32_t | VideoDrv_Uninitialize (void) |
De-initialize Video Interface. | |
int32_t | VideoDrv_SetFile (uint32_t channel, const char *name) |
Set Video channel file. | |
int32_t | VideoDrv_Configure (uint32_t channel, uint32_t frame_width, uint32_t frame_height, uint32_t color_format, uint32_t frame_rate) |
Configure Video channel. | |
int32_t | VideoDrv_SetBuf (uint32_t channel, void *buf, uint32_t buf_size) |
Set Video channel buffer. | |
int32_t | VideoDrv_FlushBuf (uint32_t channel) |
Flush Video channel buffer. | |
int32_t | VideoDrv_StreamStart (uint32_t channel, uint32_t mode) |
Start Video channel stream. | |
int32_t | VideoDrv_StreamStop (uint32_t channel) |
Stop Video channel stream. | |
void * | VideoDrv_GetFrameBuf (uint32_t channel) |
Get Video channel Frame buffer. | |
int32_t | VideoDrv_ReleaseFrame (uint32_t channel) |
Release Video channel Frame. | |
VideoDrv_Status_t | VideoDrv_GetStatus (uint32_t channel) |
Get Video channel status. | |
Video Driver API functions.
VideoDrv_Event_t |
Video Events callback function type.
[in] | channel | channel number |
[in] | event | events notification mask |
Provides the typedef for the event callback function VideoDrv_Event (uint32_t event) to be registered with VideoDrv_Initialize.
The parameter event indicates the reported event(s) that occurred during driver operation. Each event is encoded in a separate bit so it is possible to signal multiple events within the same call. VIDEO_DRV_EVENT_... definitions list the events that can be reported.
Parameter for:
int32_t VideoDrv_Initialize | ( | VideoDrv_Event_t | cb_event | ) |
Initialize Video Interface.
[in] | cb_event | pointer to VideoDrv_Event_t |
The function VideoDrv_Initialize initializes the Video interface over VSI peripheral. It is called when the middleware component starts operation.
The function performs the following operations:
The parameter cb_event is a pointer to the VideoDrv_Event_t callback function; use a NULL pointer when no callback signals are required.
Possible return values:
int32_t VideoDrv_Uninitialize | ( | void | ) |
De-initialize Video Interface.
The function VideoDrv_Uninitialize de-initializes the resources of Video interface.
It is called when the middleware component stops operation and releases the software resources used by the interface.
Possible return values:
int32_t VideoDrv_SetFile | ( | uint32_t | channel, |
const char * | name | ||
) |
Set Video channel file.
[in] | channel | channel number |
[in] | name | video filename (pointer to NULL terminated string) |
The function VideoDrv_SetFile sets file for specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
name specifies filename with extension of video or image.
Possible return values:
int32_t VideoDrv_Configure | ( | uint32_t | channel, |
uint32_t | frame_width, | ||
uint32_t | frame_height, | ||
uint32_t | color_format, | ||
uint32_t | frame_rate | ||
) |
Configure Video channel.
[in] | channel | channel number |
[in] | frame_width | frame width in pixels |
[in] | frame_height | frame height in pixels |
[in] | color_format | pixel color format |
[in] | frame_rate | frame rate (frames per second) |
The function VideoDrv_Configure configures specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
frame_width configures frame width in pixels.
frame_height configures frame height in pixels.
color_format configures frame pixel color format:
frame_rate configures frame rate (frames per second).
Possible return values:
int32_t VideoDrv_SetBuf | ( | uint32_t | channel, |
void * | buf, | ||
uint32_t | buf_size | ||
) |
Set Video channel buffer.
[in] | channel | channel number |
[in] | buf | pointer to buffer for video stream |
[in] | buf_size | video stream buffer size in bytes |
The function VideoDrv_SetBuf sets the buffer for specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
buf points to the video memory buffer provided by the user.
buf_size defines the size of user provided video memory buffer.
User provided memory is used as a circular buffer for storing video frames.
Possible return values:
int32_t VideoDrv_FlushBuf | ( | uint32_t | channel | ) |
Flush Video channel buffer.
[in] | channel | channel number |
The function VideoDrv_FlushBuf flushes buffer of specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
Possible return values:
int32_t VideoDrv_StreamStart | ( | uint32_t | channel, |
uint32_t | mode | ||
) |
Start Video channel stream.
[in] | channel | channel number |
[in] | mode | stream mode |
The function VideoDrv_StreamStart starts streaming on specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
mode specifies whether the stream will be continuous (VIDEO_DRV_MODE_CONTINUOS) or single frame (VIDEO_DRV_MODE_SINGLE) which will automatically stop after a single frame.
For video input channels, frames received from video input will be stored in the video buffer.
When a frame is received:
Frame buffer is retrieved by calling VideoDrv_GetFrameBuf. Once the frame data is consumed it needs to be released by calling VideoDrv_ReleaseFrame.
For video output channels, frames stored in the video buffer will be sent to the video output.
Frame buffer is retrieved by calling VideoDrv_GetFrameBuf. Once the frame data is produced it needs to be released by calling VideoDrv_ReleaseFrame.
When a frame is sent:
Possible return values:
int32_t VideoDrv_StreamStop | ( | uint32_t | channel | ) |
Stop Video channel stream.
[in] | channel | channel number |
The function VideoDrv_StreamStop stops streaming on specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
Possible return values:
void * VideoDrv_GetFrameBuf | ( | uint32_t | channel | ) |
Get Video channel Frame buffer.
[in] | channel | channel number |
The function VideoDrv_GetFrameBuf gets frame buffer from specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
For video input channels, the application gets the pointer to the frame buffer, consumes frame data and releases the frame by calling VideoDrv_ReleaseFrame.
For video output channels, the application gets the pointer to the frame buffer, produces frame data and releases the frame by calling VideoDrv_ReleaseFrame.
Possible return values:
int32_t VideoDrv_ReleaseFrame | ( | uint32_t | channel | ) |
Release Video channel Frame.
[in] | channel | channel number |
The function VideoDrv_ReleaseFrame releases a frame from specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).
Possible return values:
VideoDrv_Status_t VideoDrv_GetStatus | ( | uint32_t | channel | ) |
Get Video channel status.
[in] | channel | channel number |
The function VideoDrv_GetStatus retrieves the current status of specified video channel.
channel specifies the video channel (VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1).