capture_put_buffer()

Updated: April 19, 2023

Pass a buffer to the driver for deinterlacing a frame when bringing in video from an external source

Synopsis:

#include <vcapture/capture.h>
int capture_put_buffer(capture_context_t ctx,
                       uint32_t idx,
                       uint32_t flags)

Arguments:

ctx
The pointer to the video capture context.
idx
The index to the frame buffer to inject into the capture driver.
flags
Flag specifying how to process the deinterlaced frame.

Library:

libcapture

Description:

This function passes a buffer to the driver for deinterlacing frames brought in from a video on an external source, such as a USB memory stick. It should be used only when the CAPTURE_FLAG_EXTERNAL_SOURCE flag is set.

Interlaced video frames (typical of analog video) contain two sequential fields, which doubles the perceived frame rate and improves the video quality. To display interlaced video in a system using a progressive display, the interlaced frames need to be separated into two fields in the correct sequence. Thus, displaying an interlaced video correctly on a progressive display requires at least two buffers for every interlaced frame. The capture_put_buffer() function passes a buffer to the driver, which it can use for the second frame extracted from the interlaced frame.

Returns:

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.