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