|
AvTranscoder
0.9.4
C++APIforLibav/FFmpeg
|
Manager of filters. More...
#include <FilterGraph.hpp>
Public Member Functions | |
| FilterGraph (const ICodec &codec) | |
| ~FilterGraph () | |
| Filter & | addFilter (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) | |
| FilterGraph & | operator= (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... | |
Manager of filters.
Definition at line 21 of file FilterGraph.hpp.
|
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.
| Filter & avtranscoder::FilterGraph::addFilter | ( | const std::string & | filterName, |
| const std::string & | filterOptions = "", |
||
| const std::string & | instanceName = "" |
||
| ) |
Add a filter.
| filterName | the method gets the filter definition from this name. |
| filterArgs | options to initialize the filter with. This must be a ':'-separated list of options in the 'key=value' form. |
| instanceName | name of the instance filter in the graph (if empty, same as filterName). |
| runtime | exception if the filter is not found |
Definition at line 71 of file FilterGraph.cpp.
References _filters, and LOG_INFO.
Referenced by pushOutBuffer().
|
inlineprivate |
Definition at line 56 of file FilterGraph.hpp.
Referenced by process().
|
private |
Initialize the graph of filters to process.
Definition at line 80 of file FilterGraph.cpp.
References _filters, _graph, _isInit, avtranscoder::getDescriptionFromErrorCode(), LOG_INFO, pushFilter(), pushInBuffer(), and pushOutBuffer().
Referenced by process().
|
private |
| void avtranscoder::FilterGraph::process | ( | Frame & | frame | ) |
Pull filtered data from the filter graph, and put result to the given frame.
| frame | both input and output data of the method. |
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().
|
private |
Push the given Filter to the graph.
Definition at line 113 of file FilterGraph.cpp.
References _graph, avtranscoder::Filter::getAVFilter(), avtranscoder::getDescriptionFromErrorCode(), avtranscoder::Filter::getInstanceName(), avtranscoder::Filter::getName(), avtranscoder::Filter::getOptions(), and avtranscoder::Filter::setAVFilterContext().
Referenced by init(), pushInBuffer(), and pushOutBuffer().
|
private |
Push the input and output buffer at the beginning and the end of the graph.
Definition at line 131 of file FilterGraph.cpp.
References _codec, _filters, avtranscoder::ICodec::getAVCodecContext(), avtranscoder::AudioFrame::getChannelLayout(), avtranscoder::VideoFrame::getHeight(), avtranscoder::VideoFrame::getPixelFormat(), avtranscoder::getPixelFormatName(), avtranscoder::AudioFrame::getSampleFormat(), avtranscoder::getSampleFormatName(), avtranscoder::AudioFrame::getSampleRate(), avtranscoder::VideoFrame::getWidth(), avtranscoder::Frame::isAudioFrame(), avtranscoder::Frame::isVideoFrame(), LOG_INFO, and pushFilter().
Referenced by init().
|
private |
Definition at line 169 of file FilterGraph.cpp.
References addFilter(), avtranscoder::Frame::isAudioFrame(), avtranscoder::Frame::isVideoFrame(), and pushFilter().
Referenced by init().
|
private |
Codec of the stream on which the filters will be applied.
Definition at line 80 of file FilterGraph.hpp.
Referenced by pushInBuffer().
|
private |
List of filters to process.
Definition at line 79 of file FilterGraph.hpp.
Referenced by addFilter(), init(), process(), pushInBuffer(), and ~FilterGraph().
|
private |
The graph which holds the filters.
Definition at line 78 of file FilterGraph.hpp.
Referenced by FilterGraph(), init(), pushFilter(), and ~FilterGraph().
|
private |