Take multiple photos in burst mode.
camera_error_t camera_take_burst(camera_handle_t handle, int burst_count, void(*shutter_callback)(camera_handle_t, void *), void(*raw_callback)(camera_handle_t, camera_buffer_t *, void *), void(*postview_callback)(camera_handle_t, camera_buffer_t *, void *), void(*image_callback)(camera_handle_t, camera_buffer_t *, void *), void *arg, bool wait)
The handle returned by a call to the camera_open() function.
The number of frames to take in a single burst.
A function pointer to a function with the following signature: void function_name( camera_handle_t, void*). The function is a callback that gets invoked when the shutter activates. Typically, the callback function plays a shutter sound. You can use NULL if no function needs to be called. For information about the callback arguments, see About callback mode.
Use NULL. Reserved for future use.
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 the postview (review) image data is available. This callback is used to provide a preview-sized copy of the photo. Typically, the preview-sized photo is used to provide visual feedback before the final image is available. You can use NULL if no function needs to be called.
A function pointer to a function with the following signature: void function_name(camera_handle_t, camera_buffer_t*, void*). The function that is called when the final full-resolution image is available. You can use NULL if no function needs to be called. For information about the callback arguments, see About callback mode.
The argument passed to all callback functions, which is the last argument in the callback functions.
A boolean value that indicates whether the function blocks or not. If set to true, this function is blocking and will return once all specified callbacks have returned. If set to false, this function call is non-blocking and returns before all specified callbacks have returned.
Before you take a photo, ensure that you have configured the viewfinder, set the output properties for the photo, and started the viewfinder. This function can only be called if the CAMERA_FEATURE_BURST is available. You can determine whether the feature is available by calling the camera_can_feature() function.
If you want an application to save the photo to a file, then this function should be invoked with the image_callback argument set. When the image_callback is set, the image buffer is provided as the second argument to the callback function. Then, in the invoked image_callback function, you can save the buffer to a file. If an application wants to save burst photos to disk, then the image_callback argument should be set. When this callback is invoked, if the image cannot be saved to disk before the next frame arrives, then the user should buffer frames instead and save the buffers to disk after the entire burst is complete.
While in burst mode, you should not save files in the callback for performance reasons. Instead, you should buffer the images and save them at later time. The callbacks that you set for this function are called for each photo and therefore, are called multiple times.
For example, it is illegal to mute or modify the shutter sound of a camera application in Japan and Korea. Ensure that you comply with the laws and regulations for the countries in which you distribute your application. For more information, see the BlackBerry World Vetting Criteria at https://appworld.blackberry.com/isvportal/home.do.
Since burst mode captures images in rapid succession, you should choose an appropriate moment to play the shutter sound rather than play the shutter sound repeatedly.
A CAMERA_STATUS_CAPTURECOMPLETE status event is emitted once the burst capture is completed.