|
libvdo
|
The VdoMap is commonly used in the vdo library API. It is a hash map with a variant value type, and provides a flexible way of setting and getting properties on vdo objects. Example:
For an explanation of g_autoptr above, read here.
All objects have an info map, which is a read only map. The info map contains information about the object and is populated by the vdo server. The content can be different, depending on SoC.
Most objects also have a settings map, which can be used to update object settings. The updated state is often, but not always, reflected in the info map. A client can also receive the settings map, to see what was previously configured.
The same key can potentially have different values in the settings and info maps. One typical example is the width and height keys for a VdoStream, when the video input is rotated clockwise (90 or 270 degrees). In that case, the settings map will contain the unrotated values set by the user, while the info map has the width and height swapped, to reflect the actual output resolution of the stream.
Values set in the settings map can also be clamped to be within a valid range. For example, setting the stream buffer count to a value outside the valid range, will lower it to the maximum allowed value. This will then be reflected in the info map.