style(libvideo2x): improved resource cleaning and error handling

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
k4yt3x
2024-10-29 00:00:00 +00:00
parent 613b75ffec
commit d50cf54f2a
8 changed files with 147 additions and 156 deletions

View File

@@ -21,7 +21,7 @@ int init_encoder(
int **stream_map
);
int encode_and_write_frame(
int write_frame(
AVFrame *frame,
AVCodecContext *enc_ctx,
AVFormatContext *ofmt_ctx,

View File

@@ -15,7 +15,7 @@ class Filter {
virtual ~Filter() = default;
virtual int init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVBufferRef *hw_ctx) = 0;
virtual int process_frame(AVFrame *in_frame, AVFrame **out_frame) = 0;
virtual int flush(std::vector<AVFrame *> &flushed_frames) { return 0; }
virtual int flush(std::vector<AVFrame *> &_) { return 0; }
};
#endif // FILTER_H