camera_start_video_viewfinder()
Start the video viewfinder on the camera.
Synopsis:
#include <camera/camera_api.h>
camera_error_t camera_start_video_viewfinder(camera_handle_t handle, void(*viewfinder_callback)(camera_handle_t, camera_buffer_t *, void *), void(*status_callback)(camera_handle_t, camera_devstatus_t, uint16_t, void *), void *arg)
Arguments:
- handle
-
The handle returned by a call to the camera_open() function.
- viewfinder_callback
-
A function pointer to a function with the following signature: void function_name( camera_handle_t, camera_buffer_t*, void*). The function is a callback that gets invoked when a raw viewfinder buffer becomes available. Set the argument to NULL if no function needs to be called. For information about the callback arguments, see About callback-mode.
- status_callback
-
A function pointer to a function with the following signature: void function_name( camera_handle_t, camera_devstatus_t, uint16_t, void*). The function is a callback that gets invoked when status events occur. Set the argument to NULL if no function needs to be called. For information about the callback arguments, see About callback-mode.
- arg
-
The argument passed to all callback functions, which is the last argument in the callback functions.
Library:
libcamapiDescription:
This function can only be called if the CAMERA_FEATURE_VIDEO is available. You can determine whether the feature is available by calling the camera_can_feature() function.
Before you call this function, ensure you:
- Use the camera_set_videovf_property() function to configure the video viewfinder.
- Use the camera_set_video_property() function to set any video properties.
- Create a screen window to hold the video viewfinder buffers.
Once the video viewfinder is running, the user can encode video and configure scene modes. In addition, the you can reposition or resize their viewfinder window using the Screen and Windowing API. In order to retrieve a window handle to the viewfinder window that is created, you must listen for the appropriate screen event. After receiving the window handle, you can then use the screen API to manipulate the window.
Returns:
CAMERA_OK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.