Arm Virtual Hardware  Version 2.1.0
AVH FVP Models
 
Loading...
Searching...
No Matches

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.
 

Description

Video Driver API functions.

Typedef Documentation

◆ VideoDrv_Event_t

VideoDrv_Event_t

Video Events callback function type.

Parameters
[in]channelchannel number
[in]eventevents notification mask
Returns
none

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:

Function Documentation

◆ VideoDrv_Initialize()

int32_t VideoDrv_Initialize ( VideoDrv_Event_t  cb_event)

Initialize Video Interface.

Parameters
[in]cb_eventpointer to VideoDrv_Event_t
Returns
return code

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:

  • Initializes the required resources of the video interface.
  • Registers the VideoDrv_Event_t callback function.

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:

  • VIDEO_DRV_OK : video interface is successfully initialized.

◆ VideoDrv_Uninitialize()

int32_t VideoDrv_Uninitialize ( void  )

De-initialize Video Interface.

Returns
return code

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:

  • VIDEO_DRV_OK : video interface is successfully de-initialized.

◆ VideoDrv_SetFile()

int32_t VideoDrv_SetFile ( uint32_t  channel,
const char *  name 
)

Set Video channel file.

Parameters
[in]channelchannel number
[in]namevideo filename (pointer to NULL terminated string)
Returns
return code

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:

◆ VideoDrv_Configure()

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.

Parameters
[in]channelchannel number
[in]frame_widthframe width in pixels
[in]frame_heightframe height in pixels
[in]color_formatpixel color format
[in]frame_rateframe rate (frames per second)
Returns
return code

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:

◆ VideoDrv_SetBuf()

int32_t VideoDrv_SetBuf ( uint32_t  channel,
void *  buf,
uint32_t  buf_size 
)

Set Video channel buffer.

Parameters
[in]channelchannel number
[in]bufpointer to buffer for video stream
[in]buf_sizevideo stream buffer size in bytes
Returns
return code

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:

◆ VideoDrv_FlushBuf()

int32_t VideoDrv_FlushBuf ( uint32_t  channel)

Flush Video channel buffer.

Parameters
[in]channelchannel number
Returns
return code

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:

◆ VideoDrv_StreamStart()

int32_t VideoDrv_StreamStart ( uint32_t  channel,
uint32_t  mode 
)

Start Video channel stream.

Parameters
[in]channelchannel number
[in]modestream mode
Returns
return code

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:

◆ VideoDrv_StreamStop()

int32_t VideoDrv_StreamStop ( uint32_t  channel)

Stop Video channel stream.

Parameters
[in]channelchannel number
Returns
return code

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:

◆ VideoDrv_GetFrameBuf()

void * VideoDrv_GetFrameBuf ( uint32_t  channel)

Get Video channel Frame buffer.

Parameters
[in]channelchannel number
Returns
pointer to frame buffer

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:

  • pointer to frame buffer,
  • NULL : invalid argument values. Returned in the following case:
    • channel is not VIDEO_DRV_IN0..1 or VIDEO_DRV_OUT0..1.
    • video interface is not initialized.
    • video channel is not configured.
    • buffer is empty (input channel)
    • buffer is full (output channel)

◆ VideoDrv_ReleaseFrame()

int32_t VideoDrv_ReleaseFrame ( uint32_t  channel)

Release Video channel Frame.

Parameters
[in]channelchannel number
Returns
return code

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_GetStatus()

VideoDrv_Status_t VideoDrv_GetStatus ( uint32_t  channel)

Get Video channel status.

Parameters
[in]channelchannel number
Returns
VideoDrv_Status_t

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).