Dewobble
Video motion stabilization with awareness of lens projection
Typedefs | Functions
filter.h File Reference
#include <CL/cl.h>
#include "filter_config.h"

Go to the source code of this file.

Typedefs

typedef struct _DewobbleFilter * DewobbleFilter
 

Functions

DewobbleFilter dewobble_filter_create_sync (DewobbleFilterConfig config)
 
DewobbleFilter dewobble_filter_create_threaded (DewobbleFilterConfig config)
 
void dewobble_filter_destroy (DewobbleFilter *filter)
 
int dewobble_filter_end_input (DewobbleFilter c_filter)
 
int dewobble_filter_frame_ready (DewobbleFilter c_filter)
 
cl_mem dewobble_filter_get_input_frame_buffer (DewobbleFilter c_filter, cl_int *errcode_ret)
 
int dewobble_filter_pull_frame (DewobbleFilter c_filter, cl_mem *output_buffer, cl_mem *input_buffer, void **extra)
 
int dewobble_filter_push_frame (DewobbleFilter c_filter, cl_mem input_buffer, void *extra)
 
void dewobble_filter_release_input_frame_buffer (DewobbleFilter c_filter, cl_mem *input_buffer)
 
void dewobble_filter_release_output_frame_buffer (DewobbleFilter c_filter, cl_mem *output_buffer)
 

Typedef Documentation

◆ DewobbleFilter

typedef struct _DewobbleFilter* DewobbleFilter

Abstract base class for filters. A filter is an object which consumes input frames and produces output frames, optionally applying projection changes and/or motion stabilisation.

Function Documentation

◆ dewobble_filter_create_threaded()

DewobbleFilter dewobble_filter_create_threaded ( DewobbleFilterConfig  config)

Create a filter which isolates OpenCV in a separate thread. See also dewobble::FilterThreaded.

◆ dewobble_filter_create_sync()

DewobbleFilter dewobble_filter_create_sync ( DewobbleFilterConfig  config)

Create a filter which runs in the callers thread. See also dewobble::FilterSync.

◆ dewobble_filter_destroy()

void dewobble_filter_destroy ( DewobbleFilter filter)

Destroy a filter

◆ dewobble_filter_get_input_frame_buffer()

cl_mem dewobble_filter_get_input_frame_buffer ( DewobbleFilter  c_filter,
cl_int *  errcode_ret 
)

Get an OpenCL buffer to be used for an input frame. As much as possible, the buffers previously released by dewobble_filter_release_output_frame_buffer are used instead of allocating new buffers.

Returns
the buffer

◆ dewobble_filter_release_input_frame_buffer()

void dewobble_filter_release_input_frame_buffer ( DewobbleFilter  c_filter,
cl_mem *  input_buffer 
)

Release an output frame buffer previously returned from dewobble_filter_get_input_frame_buffer. The buffer may not necessarily be released immediately, and may be reused for subsequent frames with dewobble_filter_get_input_frame_buffer.

Parameters
input_bufferpointer to the buffer to release. Will be set to NULL.

◆ dewobble_filter_push_frame()

int dewobble_filter_push_frame ( DewobbleFilter  c_filter,
cl_mem  input_buffer,
void *  extra 
)

Push an input frame into the filter

Parameters
input_bufferOpenCL buffer containing input frame in NV12 format. The buffer should not be released until after the output frame is consumed.
extraOpaque pointer to extra data for this frame

◆ dewobble_filter_end_input()

int dewobble_filter_end_input ( DewobbleFilter  c_filter)

Notify the filter that there will not be more input frames (and therefore that any buffered frames should become available for output)

◆ dewobble_filter_frame_ready()

int dewobble_filter_frame_ready ( DewobbleFilter  c_filter)

Determine if there is at least one output frame ready (i.e. if a call to pull_frame would succeed)

◆ dewobble_filter_pull_frame()

int dewobble_filter_pull_frame ( DewobbleFilter  c_filter,
cl_mem *  output_buffer,
cl_mem *  input_buffer,
void **  extra 
)

Pull an output frame from the filter

Parameters
output_bufferPointer to an OpenCL buffer which will be set to point to the output frame
output_bufferPointer to an OpenCL buffer which will be set to the buffer passed as the input frame
extrawill be set to the opaque pointer to extra data about this frame

◆ dewobble_filter_release_output_frame_buffer()

void dewobble_filter_release_output_frame_buffer ( DewobbleFilter  c_filter,
cl_mem *  output_buffer 
)

Release an output frame buffer previously returned from dewobble_filter_pull_frame. The buffer may not necessarily be released immediately, and may be reused for subsequent frames with get_input_frame_buffer

Parameters
output_bufferpointer to the buffer to release. Will be set to NULL.