Dewobble
Video motion stabilization with awareness of lens projection
Public Member Functions | List of all members
dewobble::FilterSync Class Reference

#include <filter_sync.hpp>

Inheritance diagram for dewobble::FilterSync:
dewobble::FilterBase

Public Member Functions

 FilterSync (FilterConfig config)
 
void end_input ()
 
bool frame_ready ()
 
cl_mem get_output_frame_buffer ()
 
void pull_frame (cl_mem *output_buffer, cl_mem *input_buffer, void **extra)
 
void push_frame (cl_mem input_buffer, void *extra)
 
- Public Member Functions inherited from dewobble::FilterBase
 FilterBase (FilterConfig config)
 
virtual cl_mem get_input_frame_buffer ()
 
virtual void release_input_frame_buffer (cl_mem *input_buffer)
 
virtual void release_output_frame_buffer (cl_mem *output_buffer)
 

Additional Inherited Members

Detailed Description

A filter implentation that operates synchronously within the same thread.

Note
Using this filter will cause OpenCV's global per-thread OpenCL context to be set for the thread where it is used, and the context also must not be set elsewhere in that thread.

Constructor & Destructor Documentation

◆ FilterSync()

dewobble::FilterSync::FilterSync ( FilterConfig  config)

Construct a new filter with the given configuration

Member Function Documentation

◆ push_frame()

void dewobble::FilterSync::push_frame ( cl_mem  input_buffer,
void *  extra 
)
virtual

Push an input frame into the filter

Parameters
input_bufferAn OpenCL buffer containing input frame in NV12 format. The buffer should be readable from within an OpenCL kernel (e.g. CL_MEM_READ_ONLY). The contents will not be modified, but must remain accessible until the same buffer is returned from pull_frame.
extraOpaque pointer to related data for this frame which can be retrieved when the frame is output in push_frame.

Implements dewobble::FilterBase.

◆ end_input()

void dewobble::FilterSync::end_input ( )
virtual

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

Implements dewobble::FilterBase.

◆ frame_ready()

bool dewobble::FilterSync::frame_ready ( )
virtual

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

Implements dewobble::FilterBase.

◆ pull_frame()

void dewobble::FilterSync::pull_frame ( cl_mem *  output_buffer,
cl_mem *  input_buffer,
void **  extra 
)
virtual

Pull an output frame from the filter

Parameters
output_bufferwill be set to point to a buffer containing the output frame
input_bufferWill be set to point to the input buffer for this frame that was passed into push_frame
extrawill be set to the opaque pointer to extra data about this frame

Implements dewobble::FilterBase.

◆ get_output_frame_buffer()

cl_mem dewobble::FilterSync::get_output_frame_buffer ( )
virtual

Get an OpenCL buffer usable with pull_frame. The buffer should be freed using release_output_frame_buffer.

Returns
the buffer

Reimplemented from dewobble::FilterBase.


The documentation for this class was generated from the following file: