camera_set_vf_property()
Configure one or more settings of the viewfinder
Synopsis:
#include <camera/camera_api.h>#define camera_set_vf_property(handle,
args...)Arguments:
- handle
- The handle returned by a call to the camera_open() function.
- args
- A series of comma-delimited property-value pairs where each value must be a pointer to a variable of the expected type.
Library:
libcamapiDescription:
This function configures the viewfinder settings. Ensure that you call this function before you start using the viewfinder.
args argument, you can provide one or more property-value pairs using camera_imgprop_t for the property and int or double for the value. The function can use the following properties:- CAMERA_IMGPROP_WIN_GROUPID
- CAMERA_IMGPROP_WIN_ID
- CAMERA_IMGPROP_CREATEWINDOW
- CAMERA_IMGPROP_RENDERTOWINDOW
- CAMERA_IMGPROP_FORMAT
- CAMERA_IMGPROP_WIDTH
- CAMERA_IMGPROP_HEIGHT
- CAMERA_IMGPROP_FRAMERATE
- CAMERA_IMGPROP_ROTATION
- CAMERA_IMGPROP_HWOVERLAY
- CAMERA_IMGPROP_ZOOMFACTOR
- CAMERA_IMGPROP_NUMUSERBUFFERS
Other than the following three exceptions, all properties listed above require write permissions; if you try to change them while in read-only mode, the call fails.
To set write permissions for the viewfinder properties when you call the camera_open() function, use a pertinent camera access mode flag: CAMERA_MODE_RW (read-and-write) or CAMERA_MODE_RO (read-only), depending on the property.
The compiler performs no type-checking. Therefore, the value you provide for each property must match the expected data type. Mismatches can cause undefined behavior and application crashes.
camera_set_vf_property( camera_handle,
CAMERA_IMGPROP_WIN_GROUPID, "mygroup",
CAMERA_IMGPROP_WIN_ID, "vfwindow",
CAMERA_IMGPROP_WIDTH, 720,
CAMERA_IMGPROP_HEIGHT, 1280,
CAMERA_IMGPROP_ROTATION, 270,
CAMERA_IMGPROP_FRAMERATE, (double)15.0 );
Returns:
CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason why the call failed.
