avcpp 3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
buffersrc.h
Go to the documentation of this file.
1#pragma once
2
9
10#include "avcpp/avconfig.h"
11
12#if AVCPP_HAS_AVFILTER
13
14#include "avcpp/ffmpeg.h"
15#include "avcpp/rational.h"
16#include "avcpp/frame.h"
17#include "avcpp/averror.h"
18#include "filtercontext.h"
19#include "filter.h"
20
21namespace av {
22
30class BufferSrcFilterContext
31{
32public:
33 BufferSrcFilterContext() = default;
41
48 void assign(const FilterContext &ctx, OptionalErrorCode ec = throws());
56 BufferSrcFilterContext& operator=(const FilterContext &ctx);
57
67 void writeVideoFrame(const VideoFrame &frame, OptionalErrorCode ec = throws());
76 void addVideoFrame(VideoFrame &frame, int flags, OptionalErrorCode ec = throws());
83 void addVideoFrame(VideoFrame &frame, OptionalErrorCode ec = throws());
84
91 void writeAudioSamples(const AudioSamples &samples, OptionalErrorCode ec = throws());
99 void addAudioSamples(AudioSamples &samples, int flags, OptionalErrorCode ec = throws());
106 void addAudioSamples(AudioSamples &samples, OptionalErrorCode ec = throws());
107
117
125 static FilterMediaType checkFilter(const Filter& filter);
126
127private:
128 void addFrame(AVFrame *frame, int flags, OptionalErrorCode ec);
129 void writeFrame(const AVFrame *frame, OptionalErrorCode ec);
130
131private:
132 FilterContext m_src;
134};
135
136} // namespace av
137
138#endif // if AVCPP_HAS_AVFILTER
Error codes, error categories and the OptionalErrorCode convention.
One buffer of decoded audio samples.
Definition frame.h:892
void addAudioSamples(AudioSamples &samples, int flags, OptionalErrorCode ec=throws())
Push audio samples with explicit flags.
void addVideoFrame(VideoFrame &frame, OptionalErrorCode ec=throws())
Push a video frame into the graph.
BufferSrcFilterContext(const FilterContext &ctx, OptionalErrorCode ec=throws())
Wrap a source context created by a graph.
void writeAudioSamples(const AudioSamples &samples, OptionalErrorCode ec=throws())
Write audio samples into the graph.
size_t failedRequestsCount()
How many pushes the graph refused.
void assign(const FilterContext &ctx, OptionalErrorCode ec=throws())
Point the wrapper at another source context.
void addVideoFrame(VideoFrame &frame, int flags, OptionalErrorCode ec=throws())
Push a video frame with explicit AV_BUFFERSRC_FLAG_* flags.
static FilterMediaType checkFilter(const Filter &filter)
Media type a filter would produce as a source.
void writeVideoFrame(const VideoFrame &frame, OptionalErrorCode ec=throws())
Write a video frame into the graph.
BufferSrcFilterContext & operator=(const FilterContext &ctx)
Assign from a filter context.
void addAudioSamples(AudioSamples &samples, OptionalErrorCode ec=throws())
Push audio samples into the graph.
One filter instance inside a graph.
Definition filtercontext.h:30
A filter descriptor: the static description of one filter.
Definition filter.h:48
Carries the caller's choice between exceptions and error codes.
Definition averror.h:96
One video frame.
Definition frame.h:578
FFmpeg types re-exported for the public API and small value wrappers.
A single filter instance and its pads.
Source and sink filter contexts.
Video frames, audio samples and their common frame interface.
Root namespace of the library.
Definition audioresampler.h:19
FilterMediaType
Media type a filter works with.
Definition filter.h:30
@ Unknown
The filter did not declare a type, or it was not inspected yet.
Definition filter.h:32
Rational numbers, time bases and arithmetic on them.