3 #include <Media/Libav.hpp>
6 #include <Video/FrameQueue.hpp>
7 #include <Video/VideoInterface.hpp>
11 #include <libavcodec/avcodec.h>
12 #include <libavformat/avformat.h>
17 #include <score_plugin_media_export.h>
23 operator bool()
const noexcept {
return m_rescale; }
31 SwsContext* m_rescale{};
32 AVPixelFormat m_rescaleFormat{};
37 AVPixelFormat hardwareAcceleration{AV_PIX_FMT_NONE};
40 bool useAVCodec{
true};
41 bool ignorePTS{
false};
46 ReadFrame enqueue_frame(
const AVPacket* pkt) noexcept;
47 std::pair<AVBufferRef*, const AVCodec*> open_hwdec(
const AVCodec&) noexcept;
49 int init_codec_context(
50 const AVCodec* codec, AVBufferRef* hw_dev_ctx,
const AVStream* stream,
51 std::function<
void(AVCodecContext&)> setup);
52 bool open_codec_context(
54 std::function<
void(AVCodecContext&)> setup);
56 void load_packet_in_frame(
const AVPacket& packet, AVFrame& frame);
58 ReadFrame read_one_frame(AVPacket& packet);
59 ReadFrame read_one_frame_raw(AVPacket& packet);
60 ReadFrame read_one_frame_avcodec(AVPacket& packet);
64 AVFormatContext* m_formatContext{};
65 AVStream* m_avstream{};
66 const AVCodec* m_codec{};
67 AVCodecContext* m_codecContext{};
Definition: Rescale.hpp:21
Definition: Rescale.hpp:36
Definition: FrameQueue.hpp:53
Definition: Rescale.hpp:45
Definition: VideoInterface.hpp:38
Definition: VideoInterface.hpp:31