2024-10-08 02:29:00 +00:00
|
|
|
#ifndef FILTER_H
|
|
|
|
#define FILTER_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
#include <libavfilter/avfilter.h>
|
2024-10-10 07:23:13 +00:00
|
|
|
#include <libavutil/buffer.h>
|
2024-10-08 02:29:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Abstract base class for filters
|
|
|
|
class Filter {
|
|
|
|
public:
|
|
|
|
virtual ~Filter() {}
|
2024-10-10 07:23:13 +00:00
|
|
|
virtual int init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *hw_ctx) = 0;
|
|
|
|
virtual int process_frame(AVFrame *input_frame, AVFrame **output_frame) = 0;
|
2024-10-08 02:29:00 +00:00
|
|
|
virtual int flush(std::vector<AVFrame *> &processed_frames) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FILTER_H
|