Table of video capture functions
#include <vid.h> typedef struct disp_vcapfuncs { int (*init) (…); void (*fini) (…); void (*module_info) (…); int (*set_props)) (…); int (*set_adjustments) (…); int (*bind_layer) (…); int (*set_enabled) (…); void (*wait_vsync) (…); } disp_vcapfuncs_t;
The disp_vcapfuncs_t structure is a table that your driver uses to define the video capture functions that it provides to the graphics framework. Your driver's devg_get_vcapfuncs() entry point must fill in this structure.
The graphics framework calls this function to initialize the video capture unit. The prototype is:
int (*init) (disp_adapter_t *adapter, char *optstring)
This function should return the number of capture units available.
The graphics framework calls this function to free resources and disable all scalers (making them invisible). The prototype is:
void (*fini) (disp_adapter_t *adapter)
This function must free any offscreen memory that was allocated for frame data.
The graphics framework calls this function to get information about the module. The prototype is:
void (*module_info) (disp_adapter_t *adapter, disp_module_info_t *info)
This function must fill the given disp_module_info_t structure.
The graphics framework calls this function to set various properties of a video capture unit. The prototype is:
int (*set_props) ( disp_adapter_t *adapter, int unit, disp_vcap_props_t *props );
Properties are defined by the disp_vcap_props_t structure . If possible, setting should be made to take effect immediately (without waiting for a vertical synchronization event).
The graphics framework calls this function to set various picture adjustment attributes on a video capture unit. The prototype is:
int (*set_adjustments) ( disp_adapter_t *adapter, int unit, disp_vcap_adjust_t *adjustments);
Settings are defined by a disp_vcap_adjust_t, with these members:
The graphics framework calls this function to bind a video capture unit to a layer, such that the captured content is automatically displayed on that layer. Automatic double buffering should be performed by the device, if possible. The driver is responsible for internally allocating any memory needed to buffer the frame data. The prototype is:
int (*bind_layer) ( disp_adapter_t *adapter, int unit, int dispno, int layer_idx);
If the specified layer_idx is -1, then the driver should unbind from the layer it is currently bound to (if any).
The graphics framework calls this function to enable or disable the capturing of video data. This is used to initiate, halt, or pause/resume capturing. If enabled is specified as 0, then capturing should be disabled, otherwise it should be enabled. The prototype is:
int (*set_enabled) ( disp_adapter_t *adapter, int unit, int enabled);
The graphics framework calls this function to block until the frame currently being capture has completed. The prototype is:
void (*wait_vsync) ( disp_adapter_t *adapter, int unit );
The driver should not attempt to use the unlock/relock mechanism from within any entry points other than this one or the wait_vsync entry point from disp_modefuncs_t. |
Neutrino
devg_get_vcapfuncs(), disp_adapter_t, disp_module_info_t, disp_surface_t, disp_vcap_props_t