AvTranscoder  0.9.4
C++APIforLibav/FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
avtranscoder::FilterGraph Class Reference

Manager of filters. More...

#include <FilterGraph.hpp>

Public Member Functions

 FilterGraph (const ICodec &codec)
 
 ~FilterGraph ()
 
FilteraddFilter (const std::string &filterName, const std::string &filterOptions="", const std::string &instanceName="")
 Add a filter. More...
 
void process (Frame &frame)
 Pull filtered data from the filter graph, and put result to the given frame. More...
 

Private Member Functions

 FilterGraph (const FilterGraph &otherFilterGraph)
 
FilterGraphoperator= (const FilterGraph &otherFilterGraph)
 
bool hasFilters () const
 
void init (const Frame &frame)
 Initialize the graph of filters to process. More...
 
void pushFilter (Filter &filter)
 Push the given Filter to the graph. More...
 
void pushInBuffer (const Frame &frame)
 Push the input and output buffer at the beginning and the end of the graph. More...
 
void pushOutBuffer (const Frame &frame)
 

Private Attributes

AVFilterGraph * _graph
 The graph which holds the filters. More...
 
std::vector< Filter * > _filters
 List of filters to process. More...
 
const ICodec_codec
 Codec of the stream on which the filters will be applied. More...
 
bool _isInit
 Is the FilterGraph initialized. More...
 

Detailed Description

Manager of filters.

Warning
Currently, the class manages only filters which has one input and one output.
Note
See 'complex graph' definition in ffmpeg documentation.

Definition at line 21 of file FilterGraph.hpp.

Constructor & Destructor Documentation

avtranscoder::FilterGraph::FilterGraph ( const FilterGraph otherFilterGraph)
private
avtranscoder::FilterGraph::FilterGraph ( const ICodec codec)

Definition at line 19 of file FilterGraph.cpp.

References _graph.

avtranscoder::FilterGraph::~FilterGraph ( )

Definition at line 29 of file FilterGraph.cpp.

References _filters, and _graph.

Member Function Documentation

Filter & avtranscoder::FilterGraph::addFilter ( const std::string &  filterName,
const std::string &  filterOptions = "",
const std::string &  instanceName = "" 
)

Add a filter.

Parameters
filterNamethe method gets the filter definition from this name.
filterArgsoptions to initialize the filter with. This must be a ':'-separated list of options in the 'key=value' form.
instanceNamename of the instance filter in the graph (if empty, same as filterName).
Returns
the filter added
Exceptions
runtimeexception if the filter is not found
Warning
The filter will be added to the filter graph when calling process method.
See also
process

Definition at line 71 of file FilterGraph.cpp.

References _filters, and LOG_INFO.

Referenced by pushOutBuffer().

bool avtranscoder::FilterGraph::hasFilters ( ) const
inlineprivate
Returns
If at least one filter has been added to the filter graph

Definition at line 56 of file FilterGraph.hpp.

Referenced by process().

void avtranscoder::FilterGraph::init ( const Frame frame)
private

Initialize the graph of filters to process.

See also
pushFilterToGraph
pushInBuffer
pushOutBuffer

Definition at line 80 of file FilterGraph.cpp.

References _filters, _graph, _isInit, avtranscoder::getDescriptionFromErrorCode(), LOG_INFO, pushFilter(), pushInBuffer(), and pushOutBuffer().

Referenced by process().

FilterGraph& avtranscoder::FilterGraph::operator= ( const FilterGraph otherFilterGraph)
private
void avtranscoder::FilterGraph::process ( Frame frame)

Pull filtered data from the filter graph, and put result to the given frame.

Parameters
frameboth input and output data of the method.
Note
Do nothing if there was no filter added.

Definition at line 38 of file FilterGraph.cpp.

References _filters, _isInit, avtranscoder::Frame::getAVFrame(), avtranscoder::getDescriptionFromErrorCode(), hasFilters(), init(), and LOG_DEBUG.

Referenced by avtranscoder::StreamTranscoder::processTranscode().

void avtranscoder::FilterGraph::pushOutBuffer ( const Frame frame)
private

Field Documentation

const ICodec& avtranscoder::FilterGraph::_codec
private

Codec of the stream on which the filters will be applied.

Definition at line 80 of file FilterGraph.hpp.

Referenced by pushInBuffer().

std::vector<Filter*> avtranscoder::FilterGraph::_filters
private

List of filters to process.

Definition at line 79 of file FilterGraph.hpp.

Referenced by addFilter(), init(), process(), pushInBuffer(), and ~FilterGraph().

AVFilterGraph* avtranscoder::FilterGraph::_graph
private

The graph which holds the filters.

Definition at line 78 of file FilterGraph.hpp.

Referenced by FilterGraph(), init(), pushFilter(), and ~FilterGraph().

bool avtranscoder::FilterGraph::_isInit
private

Is the FilterGraph initialized.

See also
init

Definition at line 86 of file FilterGraph.hpp.

Referenced by init(), and process().


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