1#ifndef MYTHNVDECCONTEXT_H
2#define MYTHNVDECCONTEXT_H
14#include "libavutil/pixfmt.h"
15#include "libavutil/hwcontext.h"
16#include "libavcodec/avcodec.h"
17#include "libavutil/pixdesc.h"
18#include <ffnvcodec/dynlink_cuda.h>
19#include <ffnvcodec/dynlink_cuviddec.h>
30 void InitVideoCodec (AVCodecContext *Context,
bool SelectedStream,
bool &DirectRendering)
override;
36 bool IsDeinterlacing (
bool &DoubleRate,
bool StreamChange =
false)
override;
39 const AVCodec **Codec,
43 static enum AVPixelFormat
GetFormat (AVCodecContext *Context,
const AVPixelFormat *PixFmt);
47 static bool HaveNVDEC (
bool Reinit =
false);
55 QSize Minimum, QSize Maximum,
uint MacroBlocks);
57 int Width,
int Height)
const;
61 cudaVideoCodec
m_codec { cudaVideoCodec_NumCodecs };
63 cudaVideoChromaFormat
m_format { cudaVideoChromaFormat_Monochrome };
73 static const std::vector<MythNVDECCaps>&
GetProfiles(
void);
cudaVideoChromaFormat m_format
MythCodecContext::CodecProfile m_profile
MythNVDECCaps(cudaVideoCodec Codec, uint Depth, cudaVideoChromaFormat Format, QSize Minimum, QSize Maximum, uint MacroBlocks)
bool Supports(cudaVideoCodec Codec, cudaVideoChromaFormat Format, uint Depth, int Width, int Height) const
bool IsDeinterlacing(bool &DoubleRate, bool StreamChange=false) override
MythDeintType m_deinterlacer
static int InitialiseDecoder(AVCodecContext *Context)
static enum AVPixelFormat GetFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
static void GetDecoderList(QStringList &Decoders)
static bool GetBuffer(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int Flags)
Convert AVFrame data to MythFrame.
void PostProcessFrame(AVCodecContext *Context, MythVideoFrame *Frame) override
static MythCodecID GetSupportedCodec(AVCodecContext **CodecContext, const AVCodec **Codec, const QString &Decoder, AVStream *Stream, uint StreamType)
Determine whether NVDEC decoding is supported for this codec.
~MythNVDECContext() override
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
AVBufferRef * m_framesContext
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
int HwDecoderInit(AVCodecContext *Context) override
MythNVDECContext(DecoderBase *Parent, MythCodecID CodecID)
void SetDeinterlacing(AVCodecContext *Context, MythVideoProfile *Profile, bool DoubleRate) override
Enable NVDEC/CUDA deinterlacing if necessary.
void InitFramesContext(AVCodecContext *Context)
static bool HaveNVDEC(bool Reinit=false)
bool DecoderWillResetOnFlush(void) override
static const std::vector< MythNVDECCaps > & GetProfiles(void)