video2x/include/libvideo2x/decoder.h
K4YT3X 0400cf51b0
Some checks failed
Build / ubuntu (push) Has been cancelled
Build / windows (push) Has been cancelled
Build / container (push) Has been cancelled
refactor(video2x): split the CLI into multiple files; improve CLI args validation (#1247)
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-12-04 08:06:35 +00:00

29 lines
646 B
C++

#pragma once
#include <filesystem>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
class Decoder {
public:
Decoder();
~Decoder();
int init(AVHWDeviceType hw_type, AVBufferRef *hw_ctx, const std::filesystem::path &in_fpath);
AVFormatContext *get_format_context() const;
AVCodecContext *get_codec_context() const;
int get_video_stream_index() const;
private:
static AVPixelFormat hw_pix_fmt_;
static AVPixelFormat get_hw_format(AVCodecContext *ctx, const AVPixelFormat *pix_fmts);
AVFormatContext *fmt_ctx_;
AVCodecContext *dec_ctx_;
int in_vstream_idx_;
};