avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
av::FilterContext Class Reference

One filter instance inside a graph. More...

#include <filtercontext.h>

Inheritance diagram for av::FilterContext:

Public Member Functions

 FilterContext (AVFilterContext *ctx)
 Wrap an FFmpeg filter context.
Filter filter () const
 Descriptor of the filter this context instantiates.
std::string name () const
 Name of this instance inside the graph.
size_t inputsCount () const
 Number of input pads.
size_t outputsCount () const
 Number of output pads.
void init (const std::string &args, OptionalErrorCode ec=throws())
 Initialise the filter with its arguments.
void free ()
 Release the filter instance.
void link (unsigned srcPad, FilterContext &dstFilter, unsigned dstPad, OptionalErrorCode ec=throws())
 Connect one of this context's outputs to an input of another.
 operator bool () const
 Whether the context refers to a filter instance.
Public Member Functions inherited from FFWrapperPtr< AVFilterContext >
 FFWrapperPtr ()=default
 Create an empty wrapper; isNull() is true.
const AVFilterContext * raw () const
 Read access to the wrapped object.
void reset (AVFilterContext *raw=nullptr)
 Replace the stored pointer.
bool isNull () const
 Whether the wrapper is empty.
void _log (int level, const char *fmt) const
 Log through the FFmpeg log system, using this wrapper as the context.

Friends

class FilterGraph

Additional Inherited Members

Protected Attributes inherited from FFWrapperPtr< AVFilterContext >
AVFilterContext * m_raw
 The wrapped pointer; owned by the derived class, not by this template.

Detailed Description

The context holds the filter, its pads and its private options. It is created by FilterGraph, initialised with init() and attached to other contexts with link(); its lifetime is tied to the graph.

Examples
api2-decode-filter-encode.cpp.

Constructor & Destructor Documentation

◆ FilterContext()

av::FilterContext::FilterContext ( AVFilterContext * ctx)
Parameters
ctxthe context; the graph owns it

Member Function Documentation

◆ filter()

Filter av::FilterContext::filter ( ) const
Returns
the filter, or an empty one when the context is invalid

◆ free()

void av::FilterContext::free ( )

The graph owns the context, so this is only needed before the graph itself is destroyed.

◆ init()

void av::FilterContext::init ( const std::string & args,
OptionalErrorCode ec = throws() )
Parameters
argsthe filter-specific argument string, for example "320:240:flags=lanczos" for scale
echolder for the error code

◆ inputsCount()

size_t av::FilterContext::inputsCount ( ) const
Returns
the input count

◆ link()

void av::FilterContext::link ( unsigned srcPad,
FilterContext & dstFilter,
unsigned dstPad,
OptionalErrorCode ec = throws() )
Parameters
srcPadoutput pad index on this context
dstFilterthe context to connect to
dstPadinput pad index on the destination
echolder for the error code

◆ name()

std::string av::FilterContext::name ( ) const
Returns
the name given when the context was created

◆ operator bool()

av::FilterContext::operator bool ( ) const
Returns
true when the underlying AVFilterContext exists

◆ outputsCount()

size_t av::FilterContext::outputsCount ( ) const
Returns
the output count

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