SourceForge RSS feed   

Overview

Documentation

Examples

VideoJack Plugin

Download

Compatibility

 

Project
Supporters:

The Imaging Source logo

 

 

 

Impressum

 

 

 

Previous:
Video Devices
  Next:
Device Properties

List and Set Video Formats

After aquiring the handle, you can set a video format. The video format describes the layout of the video image data coming from the device. In unicap, a video format is defined by a unicap_video_format_t struct:

A video format consists of a description of the color format, information on the dimensions and some flags. The fields bpp and fourcc describe the color format and the bit depth.

A video device may allow different dimensions for the same color format. The size field contains the actual size used. min_size and max_size contain the minimum and maxmium allowed dimensions. On some devices, you can set any dimension between min_size and max_size, in this case h_stepping and v_stepping will have a value greater than 0, ie. you can set dimensions that are a multiple of h_stepping horizontaly and a multiple of v_stepping vertically.

Many capture devices have different dimensions for a color format but allow only a limited number of standard resolutions. In this case, the sizes array contains a list of allowed dimensions. The array contains size_count ellements.

The buffer_size field tells the size of a data buffer for this format in bytes. If an application is going to allocate the buffer for itself, this is the amount of data need to be allocated.

The following code will ask the user for a video format and set it using the supplied handle. It will also handle the case that a video format contains an array of allowed sizes.

Download example file 'tut_2_2.c'

Remarks:

  1. Use unicap_enumerate_formats to get the supported video formats, one after another. The function will return STATUS_NO_MATCH when you reached the end of the list of supported formats.

  2. If format.size_count is not 0, the device has set a list of allowed dimensions.

  3. Use unicap_set_format to set the new video format on the capture device.

Previous:
Video Devices
  Next:
Device Properties
  SourceForge.net Logo