-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathVideoFilter.h
More file actions
45 lines (28 loc) · 775 Bytes
/
VideoFilter.h
File metadata and controls
45 lines (28 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "ffmpeg.h"
#include "FrameSinks/VideoFrameSink.h"
namespace ffmpegcpp
{
class VideoFilter : public VideoFrameSink
{
public:
VideoFilter(const char* filterString, VideoFrameSink* target);
virtual ~VideoFilter();
void WriteFrame(AVFrame* frame, AVRational* timeBase);
void Close();
bool IsPrimed();
private:
void InitDelayed(AVFrame* frame, AVRational* timeBase);
void PollFilterGraphForFrames();
VideoFrameSink* target;
const char* filterString;
AVPixelFormat outputFormat;
AVFilterGraph *filter_graph = nullptr;
AVFilterContext *buffersink_ctx = nullptr;
AVFilterContext *buffersrc_ctx = nullptr;
AVFrame* filt_frame = nullptr;
bool initialized = false;
AVRational* timeBase;
void CleanUp();
};
}