List, Get and Set Device Properties
To control the settings of a device, unicap exports so
called device properties. Like devices and video
formats, a device property is identified by its
identifier. Which properties are supported, how they
are called and how exactly they work is determined by the
video capture device or by the driver conrolling the device.
unicap tries to achieve a consistent interface to properties
for all different kinds of video capture devices. However
due to the different nature of many video capture devices (
a frame grabber has totally different settings compared to a
camera ), there is no standard set of properties and they
may behave differently on different devices.
The property is identified by the identifier
field.
The category field contains a string with a
category name which can be used by user interfaces to make
it easier to navigate through the properties.
The relations is an array containing
relations_count elements. Each element contains the
identifier of a property which may also change when changing
this property.
There are different types of properties which behave
slightly different. There are range, value
list, menu, data and flags
properties. The type is determined by the type field.
range properties accept a value of type
double. The value has to be in the range from
property.range.min to property.range.max
value list properties also accept a value of type
double. This value has to be the same as one element
of the property.value_list.values array.
menu properties accept a string in the
menu_item field. The string has to be the same as one
element of the property.menu.menu_items array.
data properties accept an arbitrary amount of data
pointed to in the property_data
field. property_data_size should be set to the size
of the data block in bytes. While all properties may accept
optional data in the property_data field, data
properties will not evaluate the value or
menu_item field.
flags properties only evaluate the flags and
flags_mask field.
The following code example shows how to get a list of all
supported 'range' properties, inquire the current state of a
property and set a new value for a range property: