External source

Updated: April 19, 2023

The video capture API includes constants that specify the video capture external source properties.

Definitions:

#define CAPTURE_FLAG_EXTERNAL_SOURCE UINT32_C(0x0002)

Bit to set if the context to create is for an external source, instead of a captured source.

The video capture API includes constants for managing the retrieval and deinterlacing of frames brought in from an external source, such as a USB memory stick. When you've set this constant, the following properties are relevant:
#define CAPTURE_FLAG_FREE_BUFFER UINT32_C(0x0002)

Request a free buffer in which to put a frame from an external source.

#define CAPTURE_BUFFER_USAGE_RDONLY 0x001

Mark the buffer as read-only.

#define CAPTURE_PROPERTY_BUFFER_USAGE CAPTURE_PROPERTY( 'Q', 'B', 'U', 'S' )

An array of buffer usage flags.

Element i indicates if the capture driver has read-only or read/write permission for buffer i. The default is read/write permission.

Read/Write [] uint32_t

#define CAPTURE_PROPERTY_BUFFER_INDEX CAPTURE_PROPERTY( 'Q', 'B', 'I', 'X' )

Index of the buffer to be injected by capture_put_buffer()

Write uint32_t

#define CAPTURE_PROPERTY_BUFFER_NFIELDS CAPTURE_PROPERTY( 'Q', 'B', 'N', 'F' )

Number of fields contained in the buffer to be injected by capture_put_buffer()

Write uint32_t

#define CAPTURE_PROPERTY_BUFFER_PLANAR_OFFSETS CAPTURE_PROPERTY( 'Q', 'B', 'P', 'O' )

A per-buffer array.

The array has one row per field. Each row indicates the offset, in bytes, from base address for each of the Y, U and V components of planar YUV formats.

This property is used for external sources. The library than handles your hardware copies the data for the current frame rather than storing a pointer to the array.

Write [] [3] int32_t

#define CAPTURE_PROPERTY_BUFFER_FLAGS CAPTURE_PROPERTY( 'Q', 'B', 'F', 'L' )

A per-buffer array of the following buffer flags:

This property is used for external sources. The library than handles your hardware copies the data for the current frame rather than storing a pointer to the array.

Write [] uint32_t

#define CAPTURE_PROPERTY_BUFFER_SEQNO CAPTURE_PROPERTY( 'Q', 'B', 'S', 'N' )

A per-buffer array of sequence numbers.

Each element indicates the sequence number of the field contained in the buffer.

This property is used for external sources. The library than handles your hardware copies the data for the current frame rather than storing a pointer to the array.

Write [] uint32_t