avcpp  2.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
buffersrc.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "avconfig.h"
4 
5 #if AVCPP_HAS_AVFILTER
6 
7 #include "ffmpeg.h"
8 #include "filtercontext.h"
9 #include "filter.h"
10 #include "rational.h"
11 #include "frame.h"
12 #include "averror.h"
13 
14 namespace av {
15 
16 class BufferSrcFilterContext
17 {
18 public:
19  BufferSrcFilterContext() = default;
20  BufferSrcFilterContext(const FilterContext &ctx, OptionalErrorCode ec = throws());
21 
22  void assign(const FilterContext &ctx, OptionalErrorCode ec = throws());
23  BufferSrcFilterContext& operator=(const FilterContext &ctx);
24 
25  void writeVideoFrame(const VideoFrame &frame, OptionalErrorCode ec = throws());
26  void addVideoFrame(VideoFrame &frame, int flags, OptionalErrorCode ec = throws());
27  void addVideoFrame(VideoFrame &frame, OptionalErrorCode ec = throws());
28 
29  void writeAudioSamples(const AudioSamples &samples, OptionalErrorCode ec = throws());
30  void addAudioSamples(AudioSamples &samples, int flags, OptionalErrorCode ec = throws());
31  void addAudioSamples(AudioSamples &samples, OptionalErrorCode ec = throws());
32 
33  size_t failedRequestsCount();
34 
35  static FilterMediaType checkFilter(const Filter& filter);
36 
37 private:
38  void addFrame(AVFrame *frame, int flags, OptionalErrorCode ec);
39  void writeFrame(const AVFrame *frame, OptionalErrorCode ec);
40 
41 private:
42  FilterContext m_src;
43  FilterMediaType m_type = FilterMediaType::Unknown;
44 };
45 
46 } // namespace av
47 
48 #endif // if AVCPP_HAS_AVFILTER
Definition: audioresampler.cpp:8