[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

disp_vcapfuncs_t

Table of video capture functions

Synopsis:

#include <vid.h>

typedef struct disp_vcapfuncs {
    int  (*init) (...);
    void (*fini) (...);
    void (*module_info) (...);
    int  (*get_channel_caps) (...);
    int  (*get_channel_status) (...);
    int  (*set_channel_props) (...);
    int  (*close_channel) (...);
} disp_vcapfuncs_t;

Description:

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.

init()

The graphics framework calls this function to initialize the modeswitcher. The prototype is:

int (*init) (disp_adapter_t *adapter,
             char *optstring)

This function should return the number of capture units available.

fini()

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.

module_info()

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.

get_channel_caps()

The graphics framework calls this function to get the scaler capabilities for a given pixel format. The prototype is:

int (*get_channel_caps) (
        disp_adapter_t *adapter,
        int channel,
        int input_fmt_index,
        int output_fmt_index,
        disp_vcap_channel_caps_t *caps)

This function should fill in the disp_vcap_channel_caps_t structure pointed to by caps.

The video capture module is responsible for controlling video capture hardware, which takes a video stream from a source such as a TV tuner, and turns it into a sequence of video frames. Currently, the interface defined here is mainly intended to support devices that stream data into the video frame buffer, especially into buffers whose contents can be displayed by the video scaler.

Currently, viewing of TV or live video in a window can be supported by higher level software, but full video capture (e.g. capture to disk) isn't yet supported.

A hardware device may integrate zero or more video capture units. The channel argument is a zero-based index that represents the device for which the device capabilities should be returned.

A video capture unit captures a video stream of a particular format (e.g. an analog NTSC signal) and converts it to a sequence of video frames that are of a particular format (e.g. packed YUV 422).

A capture unit may support one or more input formats, and one or more output formats. The input_fmt_index and output_fmt_index arguments are zero-based indexes that represent the input and output formats for which to provide information.

If input_fmt_index is greater than or equal to the number of input formats supported, or if output_fmt_index is greater than or equal to the number of output formats supported, this function should return -1, otherwise it should return 0.

get_channel_status()

The graphics framework calls this function to get the channel status. The prototype is:

int (*get_channel_status) (
        disp_adapter_t *adapter,
        int channel,
        disp_vcap_channel_status_t *caps );

This function should fill in the disp_vcap_channel_status_t structure pointed to by caps with status information for the capture unit specified by channel.

The get_channel_status() function should return 0 on success, or -1 on failure.

set_channel_props()

The graphics framework calls this function to set the scaler capabilities. The prototype is:

int (*set_channel_props) (
        disp_adapter_t *adapter,
        int channel,
        disp_vcap_channel_props_t *props,
        disp_surface_t *yplane1,
        disp_surface_t *yplane2,
        disp_surface_t *uplane1,
        disp_surface_t *uplane2,
        disp_surface_t *vplane1,
        disp_surface_t *vplane2)

This function should configure the the capture unit specified by channel, based on the contents of the disp_vcap_channel_props_t structure pointed to by props. The *plane* arguments describe the buffers where the incoming video is to be streamed. Depending on the properties specified by props, set_channel_props() may ignore some of the *plane* structures:

In the case of packed RGB data, yplane1 (and yplane2, if double buffering) specify where the data is to be streamed.

The set_channel_props() function should return 0 on success, or -1 on failure.

close_channel()

The graphics framework calls this function to close a channel. The prototype is:

int (*close_channel) (disp_adapter_t *adapter,
                      int channel)

This function should halt the video capture unit specified by channel, and free any system resources that were associated with it.

Classification:

Photon

See also:

devg_get_vcapfuncs(), disp_adapter_t, disp_module_info_t, disp_surface_t, disp_vcap_channel_caps_t, disp_vcap_channel_props_t, disp_vcap_channel_status_t


[Previous] [Contents] [Index] [Next]