1 #ifndef MYTHVAAPICONTEXT_H
2 #define MYTHVAAPICONTEXT_H
12 #include "libavutil/pixfmt.h"
13 #include "libavutil/hwcontext.h"
14 #include "libavcodec/avcodec.h"
15 #include "libavfilter/avfilter.h"
16 #include "libavformat/avformat.h"
17 #include "libavfilter/buffersrc.h"
20 using VAAPIProfile = QPair<MythCodecContext::CodecProfile,QPair<QSize,QSize>>;
29 void InitVideoCodec (AVCodecContext* Context,
bool SelectedStream,
bool& DirectRendering)
override;
33 bool IsDeinterlacing (
bool& DoubleRate,
bool StreamChange =
false)
override;
37 static MythCodecID GetSupportedCodec (AVCodecContext** Context,
const AVCodec** Codec,
39 static enum AVPixelFormat GetFormat (AVCodecContext* Context,
const AVPixelFormat* PixFmt);
40 static enum AVPixelFormat GetFormat2 (AVCodecContext* Context,
const AVPixelFormat* PixFmt);
41 static QString HaveVAAPI (
bool ReCheck =
false);
42 static void GetDecoderList (QStringList& Decoders);
45 static int InitialiseContext (AVCodecContext* Context);
46 static int InitialiseContext2 (AVCodecContext* Context);
47 static VAProfile VAAPIProfileForCodec(
const AVCodecContext* Codec);
48 static AVPixelFormat FramesFormat (AVPixelFormat
Format);
49 void DestroyDeinterlacer ();
53 bool m_deinterlacer2x {
false };
54 int m_lastInterlaced { 0 };
55 bool m_lastTopFieldFirst {
false };
56 AVFilterContext* m_filterSink {
nullptr };
57 AVFilterContext* m_filterSource {
nullptr };
58 AVFilterGraph* m_filterGraph {
nullptr };
59 bool m_filterError {
false };
60 AVBufferRef* m_framesCtx {
nullptr };
61 std::array<int64_t,2> m_filterPriorPTS { 0 };
62 int64_t m_filterPTSUsed { 0 };
63 int m_filterWidth { 0 };
64 int m_filterHeight { 0 };