|
Ring Daemon
|
Provides access to libavfilter. More...
#include <media_filter.h>

Public Member Functions | |
| int | feedInput (AVFrame *frame, const std::string &inputName) |
| Give the specified source filter an input frame. | |
| void | flush () |
| Flush filter to indicate EOF. | |
| std::string | getFilterDesc () const |
| Returns the current filter graph string. | |
| const MediaStream & | getInputParams (const std::string &inputName) const |
| Returns a MediaStream object describing the input specified by @inputName. | |
| MediaStream | getOutputParams () const |
| Returns a MediaStream struct describing the frames that will be output. | |
| int | initialize (const std::string &filterDesc, const std::vector< MediaStream > &msps) |
| Initializes the filter graph with one or more inputs and one output. | |
| MediaFilter () | |
| bool | needsReinitForNewStream (const std::string &name) const |
| Determines if the media filter needs to be reinitialized for a new stream. | |
| std::unique_ptr< MediaFrame > | readOutput () |
| Pull a frame from the filter graph. | |
| ~MediaFilter () | |
Provides access to libavfilter.
Can be used for filters with unlimited number of inputs. Multiple outputs are not supported. They add complexity for little gain.
For information on how to write a filter graph description, see: https://ffmpeg.org/ffmpeg-filters.html http://trac.ffmpeg.org/wiki/FilteringGuide
It is required to name each filter graph input. These names are used to feed the correct input. It is the same name that will be passed as second argument to feedInput(AVFrame*, std::string).
Examples:
Definition at line 60 of file media_filter.h.
| jami::MediaFilter::MediaFilter | ( | ) |
Definition at line 35 of file media_filter.cpp.
| jami::MediaFilter::~MediaFilter | ( | ) |
Definition at line 37 of file media_filter.cpp.
Give the specified source filter an input frame.
Caller is responsible for freeing the frame.
NOTE Will fail if @inputName is not found in the graph.
Definition at line 159 of file media_filter.cpp.
References jami::emitSignal().

| void jami::MediaFilter::flush | ( | ) |
Flush filter to indicate EOF.
Definition at line 229 of file media_filter.cpp.
References jami::emitSignal(), jami::libav_utils::getError(), and JAMI_ERR.

| std::string jami::MediaFilter::getFilterDesc | ( | ) | const |
Returns the current filter graph string.
Definition at line 43 of file media_filter.cpp.
| const MediaStream & jami::MediaFilter::getInputParams | ( | const std::string & | inputName | ) | const |
Returns a MediaStream object describing the input specified by @inputName.
Definition at line 115 of file media_filter.cpp.
References jami::emitSignal().

| MediaStream jami::MediaFilter::getOutputParams | ( | ) | const |
Returns a MediaStream struct describing the frames that will be output.
When called in an invalid state, the returned format will be invalid (less than 0).
Definition at line 124 of file media_filter.cpp.
References jami::emitSignal().

| int jami::MediaFilter::initialize | ( | const std::string & | filterDesc, |
| const std::vector< MediaStream > & | msps | ||
| ) |
Initializes the filter graph with one or more inputs and one output.
Returns a negative code on error.
Definition at line 49 of file media_filter.cpp.
References jami::emitSignal(), and JAMI_DBG.

Determines if the media filter needs to be reinitialized for a new stream.
Definition at line 106 of file media_filter.cpp.
| std::unique_ptr< MediaFrame > jami::MediaFilter::readOutput | ( | ) |
Pull a frame from the filter graph.
Caller owns the frame reference.
Returns AVERROR(EAGAIN) if filter graph requires more input.
NOTE Frame reference belongs to the caller
Definition at line 195 of file media_filter.cpp.
References jami::emitSignal(), and JAMI_WARN.
