SourceForge RSS feed   

Overview

Documentation

Examples

VideoJack Plugin

Download

Compatibility

 

Project
Supporters:

The Imaging Source logo

 

 

 

Impressum

 

 

 

Previous:
System Buffers
  Next:
UnicapGTK

Capturing Images Using User Buffers

The following code example uses user buffers to capture image data:

Download example file 'tut_2_5.c'

Remarks:

  1. To activate user buffers, set the buffer_type field of the video format to UNICAP_BUFFER_TYPE_USER.

  2. The application needs to allocate the memory for each data buffer. The buffer_size field of the unicap_format_t struct contains the number of bytes required for one buffer.

  3. unicap_start_capture activates the video device.

  4. The buffer needs to be placed in the queue using unicap_queue_buffer. The buffer should not be accessed by the application until it is returned by a call to either unicap_wait_buffer or unicap_dequeue_buffer.

  5. After a buffer is returned by unicap_wait_buffer, image processing algorithms can access the image data pointed to in the buffer.data field. When the application is done with the buffer, it can be placed back in the queue using unicap_queue_buffer.

  6. unicap_stop_capture deactivates the video capture device.

Previous:
System Buffers
  Next:
UnicapGTK
  SourceForge.net Logo