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

#include <filter_threaded.hpp>

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

Public Member Functions

 FilterThreaded (FilterConfig filter_config)
 
void end_input ()
 
bool frame_ready ()
 
void pull_frame (cl_mem *output_buffer, cl_mem *input_buffer, void **extra)
 
void push_frame (cl_mem input_buffer, void *extra)
 
void release_output_frame_buffer (cl_mem *output_buffer)
 
- 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)
 

Additional Inherited Members

- Protected Member Functions inherited from dewobble::FilterBase
virtual cl_mem get_output_frame_buffer ()
 

Detailed Description

A filter implementation which delegates all processing to a separate thread. This allows isolating OpenCV's global per-thread execution context from the calling thread. Compared to dewobble::FilterSync, one extra frame is kept in flight to assist with keeping the worker thread busy. Otherwise, the behaviour is the same as dewobble::FilterSync.

Constructor & Destructor Documentation

◆ FilterThreaded()

dewobble::FilterThreaded::FilterThreaded ( FilterConfig  filter_config)

Construct a new filter with the given configuration

Member Function Documentation

◆ push_frame()

void dewobble::FilterThreaded::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::FilterThreaded::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::FilterThreaded::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::FilterThreaded::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.

◆ release_output_frame_buffer()

void dewobble::FilterThreaded::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 from dewobble::FilterBase.


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