Allocate driver-controlled memory for video capture
#include <vcapture/capture.h>
int capture_create_buffers(capture_context_t context, uint32_t property)
This function allocates memory for video capture. Allocation of memory for driver allocated buffer memory differs based on whether your hardware supports dynamic buffer allocation. If your hardware doesn't support dynamically-allocated memory, calling capture_create_buffer() will fail if CAPTURE_PROPERTY_FRAME_BUFFERS is set to anything other than NULL. Refer to Buffers from the Video Capture Developer's Guide for more information.
Calls to capture_create_buffers() are synchronous. The function frees old buffers and creates the new buffers.
... capture_set_property_i( context, CAPTURE_PROPERTY_DST_NBYTES, 320 * 240 * 4 ); capture_set_property_i( context, CAPTURE_PROPERTY_FRAME_NBUFFERS, 5 ); // Create 5 frame buffers with 320x240x4 bytes each. capture_create_buffers( context, CAPTURE_PROPERTY_FRAME_BUFFERS ); // Get the buffers. void **frame_buffers; capture_get_property_p( context, CAPTURE_PROPERTY_FRAME_BUFFERS, (void**)&frame_buffers ); ...
Call this function only when video capture is not in progress.
0 if successful; or -1 if an error occurred (errno is set; refer to errno.h for more details). The return value and the value that's observed for errno may vary as they are dependent on the implementation by the library that handles your hardware. For example, most drivers return an errno value of ENOTSUP if they do not support this function.