To integrate and use the Video Processing Subsystem driver in a user application, the following steps must be followed:
- Include the subsystem header file
xvprocss.h
that defines the subsystem object. - Declare an instance of the subsystem object in the application
code:
XVprocSs VprocInst;
- Initialize system peripherals (timer, interrupt controller, UART, etc.) in the application.
- If delay routine is defined at application level using a timer, this must be
registered with the
subsystem:
void XVprocSs_SetUserTimerHandler(XVprocSs *InstancePtr, XVidC_DelayHandler CallbackFunc, void *CallbackRef);
If the application is not using the timing peripheral to implement the timeouts, skip this step. The Subsystem driver internally uses the platform-specific delay handler.
- Initialize Video Processing Subsystem at
Power-On:
int XVprocSs_CfgInitialize(XVprocSs *InstancePtr, XVprocSs_Confg *CfgPtr, UINTPTR EffectiveAddr);
Accesses the HW configuration determines the included subcores and initializes them to the power on default. The input and output stream resolution is set to 1080p at 60 Hz, RGB, and color depth is 10-bit. Finally all the cores are reset and the subsystem Ready flag is set.
- Configure
subsystem:
int XVprocSs_SetSubsystemConfig(XVprocss *InstancePtr);
This API is the entry point and trigger mechanism for the subsystem processing control flow. It examines the input and output stream properties and validates them against the supported feature set. If the use case is supported, the driver determines the subcores required to implement the use case, builds a data flow network, configures cores in the network, and starts the video pipe.
Now, the subsystem is ready for use and the application software monitors changes in the system input or output and communicates those changes to the video subsystem.