Dewobble
Video motion stabilization with awareness of lens projection
Public Member Functions | Protected Member Functions | List of all members
dewobble::FilterBase Class Referenceabstract

#include <filter_base.hpp>

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

Public Member Functions

 FilterBase (FilterConfig config)
 
virtual void end_input ()=0
 
virtual bool frame_ready ()=0
 
virtual cl_mem get_input_frame_buffer ()
 
virtual void pull_frame (cl_mem *output_buffer, cl_mem *input_buffer, void **extra)=0
 
virtual void push_frame (cl_mem input_buffer, void *extra)=0
 
virtual void release_input_frame_buffer (cl_mem *input_buffer)
 
virtual void release_output_frame_buffer (cl_mem *output_buffer)
 

Protected Member Functions

virtual cl_mem get_output_frame_buffer ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FilterBase()

dewobble::FilterBase::FilterBase ( FilterConfig  config)

Construct a new filter with the given configuration

Member Function Documentation

◆ get_output_frame_buffer()

virtual cl_mem dewobble::FilterBase::get_output_frame_buffer ( )
protectedvirtual

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

Returns
the buffer

Reimplemented in dewobble::FilterSync.

◆ get_input_frame_buffer()

virtual cl_mem dewobble::FilterBase::get_input_frame_buffer ( )
virtual

Get an OpenCL buffer usable by input_frame. The buffer should be freed using release_input_frame_buffer

Returns
the buffer

◆ release_input_frame_buffer()

virtual void dewobble::FilterBase::release_input_frame_buffer ( cl_mem *  input_buffer)
virtual

Release an OpenCL buffer that is usable with input_frame. As a performance optimization, the same buffer may be returned again by get_input_frame_buffer

Parameters
input_buffera pointer to the buffer, which will be set to NULL

◆ push_frame()

virtual void dewobble::FilterBase::push_frame ( cl_mem  input_buffer,
void *  extra 
)
pure 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.

Implemented in dewobble::FilterThreaded, and dewobble::FilterSync.

◆ end_input()

virtual void dewobble::FilterBase::end_input ( )
pure virtual

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

Implemented in dewobble::FilterThreaded, and dewobble::FilterSync.

◆ frame_ready()

virtual bool dewobble::FilterBase::frame_ready ( )
pure virtual

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

Implemented in dewobble::FilterThreaded, and dewobble::FilterSync.

◆ release_output_frame_buffer()

virtual void dewobble::FilterBase::release_output_frame_buffer ( cl_mem *  output_buffer)
virtual

Release an output frame buffer previously returned from pull_frame. The buffer may not necessarily be freed immediately, and may be later returned again from pull_frame

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

Reimplemented in dewobble::FilterThreaded.

◆ pull_frame()

virtual void dewobble::FilterBase::pull_frame ( cl_mem *  output_buffer,
cl_mem *  input_buffer,
void **  extra 
)
pure 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

Implemented in dewobble::FilterThreaded, and dewobble::FilterSync.


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