avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
filtergraph.h
Go to the documentation of this file.
1 #ifndef AV_FILTERGRAPH_H
2 #define AV_FILTERGRAPH_H
3 
4 #include <map>
5 #include <memory>
6 
7 #include "ffmpeg.h"
8 #include "filtercontext.h"
9 #include "buffersink.h"
10 #include "buffersrc.h"
11 
12 #include "averror.h"
13 
14 namespace av {
15 
16 class FilterGraph : FFWrapperPtr<AVFilterGraph>
17 {
18  friend class FilterInOut;
19 
20 public:
21  FilterGraph();
22  FilterGraph(decltype(nullptr));
23  ~FilterGraph();
24 
25  FilterGraph(const FilterGraph&) = delete;
26  void operator=(const FilterGraph&) = delete;
27 
28  // Context getters/setters
29  bool isValid();
30  //void setScaleSwsOptions(const std::string& opts);
31  int filtersCount() const;
32  void setAutoConvert(unsigned flags);
33 
34  // Public API
35 
36  FilterContext filter(const std::string& name, OptionalErrorCode ec = throws());
37  FilterContext filter(unsigned idx, OptionalErrorCode ec = throws());
38 
39  FilterContext allocFilter(const Filter &filter, const std::string &name, OptionalErrorCode ec = throws());
41  const std::string& filterName,
42  const std::string& filterArgs,
43  OptionalErrorCode ec = throws());
44 
45  void parse(const std::string &graphDescription,
46  FilterContext &srcFilterCtx,
47  FilterContext &sinkFilterCtx,
48  OptionalErrorCode ec = throws());
49 
50  void parse(const std::string &graphDescription, OptionalErrorCode ec = throws());
51 
52  void config(OptionalErrorCode ec = throws());
53 
54  std::string dump(bool doPrint = true, const std::string& options = std::string());
55 
58 
59 
60 private:
61 
62 private:
63 
64  BufferSrcFilterContext m_bufferSrc;
65  bool m_bufferSrcSearchDone = false;
66  BufferSinkFilterContext m_bufferSink;
67  bool m_bufferSinkSearchDone = false;
68 
69  bool m_configured = false;
70 };
71 
72 
73 } // namespace av
74 
75 #endif // AV_FILTERGRAPH_H
av::FilterGraph::createFilter
FilterContext createFilter(const Filter &filter, const std::string &filterName, const std::string &filterArgs, OptionalErrorCode ec=throws())
Definition: filtergraph.cpp:106
av::BufferSinkFilterContext
Definition: buffersink.h:16
av::FilterGraph::allocFilter
FilterContext allocFilter(const Filter &filter, const std::string &name, OptionalErrorCode ec=throws())
Definition: filtergraph.cpp:88
averror.h
av::Filter
Definition: filter.h:23
av::FilterGraph::FilterGraph
FilterGraph()
Definition: filtergraph.cpp:16
ffmpeg.h
av::FilterGraph::~FilterGraph
~FilterGraph()
Definition: filtergraph.cpp:25
FFWrapperPtr
Definition: ffmpeg.h:68
av::FilterGraph::parse
void parse(const std::string &graphDescription, FilterContext &srcFilterCtx, FilterContext &sinkFilterCtx, OptionalErrorCode ec=throws())
av::FilterGraph::filtersCount
int filtersCount() const
Definition: filtergraph.cpp:35
av::OptionalErrorCode
Definition: averror.h:63
av::FilterGraph::setAutoConvert
void setAutoConvert(unsigned flags)
Definition: filtergraph.cpp:40
filtercontext.h
av::FilterGraph::FilterInOut
friend class FilterInOut
Definition: filtergraph.h:18
av::FilterGraph::bufferSinkFilter
BufferSinkFilterContext bufferSinkFilter(OptionalErrorCode ec=throws())
Definition: filtergraph.cpp:274
av::FilterGraph::filter
FilterContext filter(const std::string &name, OptionalErrorCode ec=throws())
av::FilterGraph::config
void config(OptionalErrorCode ec=throws())
Definition: filtergraph.cpp:226
av::FilterGraph
Definition: filtergraph.h:16
av::FilterGraph::operator=
void operator=(const FilterGraph &)=delete
av::FilterGraph::dump
std::string dump(bool doPrint=true, const std::string &options=std::string())
Definition: filtergraph.cpp:244
av::FilterGraph::isValid
bool isValid()
Definition: filtergraph.cpp:30
buffersink.h
av
Definition: audioresampler.cpp:8
av::FilterContext
Definition: filtercontext.h:14
av::BufferSrcFilterContext
Definition: buffersrc.h:13
av::FilterGraph::bufferSrcFilter
BufferSrcFilterContext bufferSrcFilter(OptionalErrorCode ec=throws())
Definition: filtergraph.cpp:258
buffersrc.h