MythTV
master
|
#include <mythcodeccontext.h>
Public Member Functions | |
MythCodecContext (DecoderBase *Parent, MythCodecID CodecID) | |
virtual | ~MythCodecContext ()=default |
virtual void | InitVideoCodec (AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) |
virtual int | HwDecoderInit (AVCodecContext *) |
virtual bool | RetrieveFrame (AVCodecContext *, MythVideoFrame *, AVFrame *) |
virtual int | FilteredReceiveFrame (AVCodecContext *Context, AVFrame *Frame) |
Retrieve and process/filter AVFrame. More... | |
virtual void | SetDeinterlacing (AVCodecContext *, MythVideoProfile *, bool) |
virtual void | PostProcessFrame (AVCodecContext *, MythVideoFrame *) |
virtual bool | IsDeinterlacing (bool &, bool=false) |
virtual void | SetDecoderOptions (AVCodecContext *, const AVCodec *) |
virtual bool | DecoderWillResetOnFlush (void) |
virtual bool | DecoderWillResetOnAspect (void) |
virtual bool | DecoderNeedsReset (AVCodecContext *) |
Static Public Member Functions | |
static MythCodecContext * | CreateContext (DecoderBase *Parent, MythCodecID Codec) |
static void | GetDecoders (RenderOptions &Opts, bool Reinit=false) |
static QStringList | GetDecoderDescription (void) |
static MythCodecID | FindDecoder (const QString &Decoder, AVStream *Stream, AVCodecContext **Context, const AVCodec **Codec) |
static int | GetBuffer (struct AVCodecContext *Context, AVFrame *Frame, int Flags) |
A generic hardware buffer initialisation method when using AVHWFramesContext. More... | |
static bool | GetBuffer2 (struct AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int Flags) |
A generic hardware buffer initialisation method when AVHWFramesContext is NOT used. More... | |
static int | InitialiseDecoder (AVCodecContext *Context, CreateHWDecoder Callback, const QString &Debug) |
Initialise a hardware decoder that is expected to use AVHWFramesContext. More... | |
static int | InitialiseDecoder2 (AVCodecContext *Context, CreateHWDecoder Callback, const QString &Debug) |
Initialise a hardware decoder that is NOT expected to use AVHWFramesContext. More... | |
static void | ReleaseBuffer (void *Opaque, uint8_t *Data) |
static void | FramesContextFinished (AVHWFramesContext *Context) |
static void | DeviceContextFinished (AVHWDeviceContext *Context) |
static void | CreateDecoderCallback (void *Wait, void *Context, void *Callback) |
static MythPlayerUI * | GetPlayerUI (AVCodecContext *Context) |
static bool | FrameTypeIsSupported (AVCodecContext *Context, VideoFrameType Format) |
static AVBufferRef * | CreateDevice (AVHWDeviceType Type, MythInteropGPU *Interop, const QString &Device=QString()) |
static bool | IsUnsupportedProfile (AVCodecContext *Context) |
Most hardware decoders do not support these codecs/profiles. More... | |
static QString | GetProfileDescription (CodecProfile Profile, QSize Size, VideoFrameType Format=FMT_NONE, uint ColorDepth=0) |
static CodecProfile | FFmpegToMythProfile (AVCodecID CodecID, int Profile) |
Protected Member Functions | |
virtual bool | RetrieveHWFrame (MythVideoFrame *Frame, AVFrame *AvFrame) |
Static Protected Member Functions | |
static void | DestroyInterop (MythInteropGPU *Interop) |
static void | NewHardwareFramesContext (void) |
Track the number of concurrent frames contexts. More... | |
Protected Attributes | |
DecoderBase * | m_parent { nullptr } |
MythCodecID | m_codecID { kCodec_NONE } |
bool | m_resetRequired { false } |
Static Protected Attributes | |
static QAtomicInt | s_hwFramesContextCount |
Definition at line 54 of file mythcodeccontext.h.
Definition at line 57 of file mythcodeccontext.h.
|
explicit |
Definition at line 70 of file mythcodeccontext.cpp.
Referenced by CreateContext().
|
virtualdefault |
|
static |
Definition at line 76 of file mythcodeccontext.cpp.
Referenced by AvFormatDecoder::InitVideoCodec().
|
static |
Definition at line 146 of file mythcodeccontext.cpp.
Referenced by MythVideoProfile::InitStatics().
|
static |
Definition at line 118 of file mythcodeccontext.cpp.
Referenced by StatusBox::doDecoderStatus().
|
static |
Definition at line 249 of file mythcodeccontext.cpp.
Referenced by AvFormatDecoder::ScanStreams().
|
static |
A generic hardware buffer initialisation method when using AVHWFramesContext.
Definition at line 326 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::InitVideoCodec(), and MythVAAPIContext::InitVideoCodec().
|
static |
A generic hardware buffer initialisation method when AVHWFramesContext is NOT used.
Definition at line 377 of file mythcodeccontext.cpp.
Referenced by MythMediaCodecContext::RetrieveFrame(), and MythVTBContext::RetrieveFrame().
|
static |
Initialise a hardware decoder that is expected to use AVHWFramesContext.
Definition at line 527 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::GetFormat(), and MythVAAPIContext::GetFormat().
|
static |
Initialise a hardware decoder that is NOT expected to use AVHWFramesContext.
Definition at line 544 of file mythcodeccontext.cpp.
Referenced by MythV4L2M2MContext::GetV4L2RequestFormat(), MythMediaCodecContext::HwDecoderInit(), MythVTBContext::HwDecoderInit(), and MythNVDECContext::HwDecoderInit().
|
static |
Definition at line 417 of file mythcodeccontext.cpp.
Referenced by MythNVDECContext::GetBuffer(), GetBuffer(), MythMMALContext::GetBuffer2(), GetBuffer2(), MythDRMPRIMEContext::GetDRMBuffer(), and MythV4L2M2MContext::GetRequestBuffer().
|
static |
Definition at line 439 of file mythcodeccontext.cpp.
Referenced by MythVTBContext::InitFramesContext(), MythNVDECContext::InitFramesContext(), MythVDPAUContext::InitialiseContext(), MythVAAPIContext::InitialiseContext(), and MythVAAPIContext::InitialiseContext2().
|
static |
Definition at line 449 of file mythcodeccontext.cpp.
Referenced by CreateDevice(), MythMediaCodecContext::InitialiseDecoder(), MythVTBContext::InitialiseDecoder(), and MythNVDECContext::InitialiseDecoder().
|
static |
Definition at line 495 of file mythcodeccontext.cpp.
Referenced by InitialiseDecoder(), and InitialiseDecoder2().
|
static |
Definition at line 507 of file mythcodeccontext.cpp.
Referenced by FrameTypeIsSupported(), MythMMALContext::HwDecoderInit(), MythDRMPRIMEContext::HwDecoderInit(), MythVDPAUContext::InitialiseContext(), MythVAAPIContext::InitialiseContext(), MythMediaCodecContext::InitialiseDecoder(), MythVTBContext::InitialiseDecoder(), MythNVDECContext::InitialiseDecoder(), InitialiseDecoder(), and InitialiseDecoder2().
|
static |
Definition at line 516 of file mythcodeccontext.cpp.
Referenced by MythMediaCodecContext::GetBestSupportedCodec(), MythMMALContext::GetSupportedCodec(), MythV4L2M2MContext::GetSupportedCodec(), MythVDPAUContext::GetSupportedCodec(), MythDRMPRIMEContext::GetSupportedCodec(), MythVTBContext::GetSupportedCodec(), MythVAAPIContext::GetSupportedCodec(), MythNVDECContext::GetSupportedCodec(), MythMMALContext::HwDecoderInit(), and MythDRMPRIMEContext::HwDecoderInit().
|
static |
Definition at line 560 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::GetFormat2(), MythVAAPIContext::GetProfiles(), MythVAAPIContext::HaveVAAPI(), MythVTBContext::HwDecoderInit(), MythNVDECContext::HwDecoderInit(), MythVDPAUContext::InitialiseContext(), MythVAAPIContext::InitialiseContext2(), and MythV4L2M2MContext::InitialiseV4L2RequestContext().
|
static |
Most hardware decoders do not support these codecs/profiles.
Definition at line 599 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::GetSupportedCodec(), MythVTBContext::GetSupportedCodec(), and MythNVDECContext::GetSupportedCodec().
|
static |
Definition at line 787 of file mythcodeccontext.cpp.
Referenced by MythMediaCodecContext::GetBestSupportedCodec(), MythMMALContext::GetDecoderList(), MythV4L2M2MContext::GetDecoderList(), MythMediaCodecContext::GetDecoderList(), MythVTBContext::GetDecoderList(), MythVAAPIContext::GetDecoderList(), MythNVDECContext::GetDecoderList(), MythVDPAUHelper::GetDecoderList(), MythV4L2M2MContext::GetProfiles(), MythVDPAUContext::GetSupportedCodec(), MythMediaCodecContext::HaveMediaCodec(), MythMMALContext::HaveMMAL(), MythNVDECContext::HaveNVDEC(), MythV4L2M2MContext::HaveV4L2Codecs(), MythVAAPIContext::HaveVAAPI(), MythVDPAUHelper::HaveVDPAU(), and MythVTBContext::HaveVTB().
|
static |
Definition at line 684 of file mythcodeccontext.cpp.
Referenced by MythMediaCodecContext::GetBestSupportedCodec(), MythVDPAUContext::GetSupportedCodec(), and MythVAAPIContext::GetSupportedCodec().
|
virtual |
Reimplemented in MythNVDECContext, MythVAAPIContext, MythDRMPRIMEContext, MythVTBContext, MythMediaCodecContext, MythMMALContext, MythV4L2M2MContext, and MythVDPAUContext.
Definition at line 306 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::InitVideoCodec(), MythMMALContext::InitVideoCodec(), MythMediaCodecContext::InitVideoCodec(), MythVTBContext::InitVideoCodec(), MythDRMPRIMEContext::InitVideoCodec(), MythVAAPIContext::InitVideoCodec(), MythNVDECContext::InitVideoCodec(), and AvFormatDecoder::InitVideoCodec().
|
inlinevirtual |
Reimplemented in MythNVDECContext, MythVTBContext, MythDRMPRIMEContext, MythV4L2M2MContext, MythMediaCodecContext, and MythMMALContext.
Definition at line 153 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::InitVideoCodec().
|
inlinevirtual |
Reimplemented in MythNVDECContext, MythVAAPIContext, MythDRMPRIMEContext, MythVTBContext, MythMediaCodecContext, MythMMALContext, MythV4L2M2MContext, and MythVDPAUContext.
Definition at line 154 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::ProcessVideoFrame().
|
virtual |
Retrieve and process/filter AVFrame.
Reimplemented in MythVAAPIContext.
Definition at line 624 of file mythcodeccontext.cpp.
Referenced by AvFormatDecoder::ProcessVideoPacket().
|
inlinevirtual |
Reimplemented in MythNVDECContext.
Definition at line 156 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::InitVideoCodec().
|
inlinevirtual |
Reimplemented in MythNVDECContext, MythVAAPIContext, and MythMediaCodecContext.
Definition at line 157 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::ProcessVideoFrame().
Reimplemented in MythMediaCodecContext, MythNVDECContext, and MythVAAPIContext.
Definition at line 158 of file mythcodeccontext.h.
Referenced by MythDVDPlayer::AutoDeint(), AvFormatDecoder::H264PreProcessPkt(), and AvFormatDecoder::MpegPreProcessPkt().
|
inlinevirtual |
Reimplemented in MythMMALContext, and MythV4L2M2MContext.
Definition at line 159 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::ScanStreams().
|
inlinevirtual |
Reimplemented in MythNVDECContext, MythDRMPRIMEContext, MythVDPAUContext, MythVAAPIContext, and MythV4L2M2MContext.
Definition at line 160 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::SeekReset().
|
inlinevirtual |
Reimplemented in MythVDPAUContext, and MythVAAPIContext.
Definition at line 161 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::H264PreProcessPkt(), and AvFormatDecoder::MpegPreProcessPkt().
|
inlinevirtual |
Reimplemented in MythVDPAUContext.
Definition at line 162 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::ProcessVideoPacket(), and AvFormatDecoder::SeekReset().
|
protectedvirtual |
Definition at line 629 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::RetrieveFrame(), MythVTBContext::RetrieveFrame(), MythVAAPIContext::RetrieveFrame(), and MythNVDECContext::RetrieveFrame().
|
staticprotected |
Definition at line 467 of file mythcodeccontext.cpp.
Referenced by DeviceContextFinished(), FramesContextFinished(), MythDRMPRIMEContext::~MythDRMPRIMEContext(), and MythMMALContext::~MythMMALContext().
|
staticprotected |
Track the number of concurrent frames contexts.
More than one hardware frames context is indicative of wider issues and needs to be avoided.
This currently only applies to VDPAU and VAAPI
Definition at line 432 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::GetFormat2(), MythVTBContext::InitFramesContext(), MythNVDECContext::InitFramesContext(), MythVDPAUContext::InitialiseContext(), MythVAAPIContext::InitialiseContext(), and MythVAAPIContext::InitialiseContext2().
|
staticprotected |
Definition at line 168 of file mythcodeccontext.h.
Referenced by FramesContextFinished(), and NewHardwareFramesContext().
|
protected |
Definition at line 170 of file mythcodeccontext.h.
Referenced by MythVTBContext::InitFramesContext(), MythNVDECContext::InitFramesContext(), and RetrieveHWFrame().
|
protected |
Definition at line 171 of file mythcodeccontext.h.
Referenced by MythVDPAUContext::DecoderNeedsReset(), MythVDPAUContext::DecoderWillResetOnAspect(), MythVAAPIContext::DecoderWillResetOnAspect(), MythVDPAUContext::DecoderWillResetOnFlush(), MythV4L2M2MContext::DecoderWillResetOnFlush(), MythVAAPIContext::DecoderWillResetOnFlush(), MythNVDECContext::DecoderWillResetOnFlush(), MythMediaCodecContext::HwDecoderInit(), MythMMALContext::HwDecoderInit(), MythV4L2M2MContext::HwDecoderInit(), MythVTBContext::HwDecoderInit(), MythNVDECContext::HwDecoderInit(), MythVTBContext::InitFramesContext(), MythNVDECContext::InitFramesContext(), MythVDPAUContext::InitVideoCodec(), MythMMALContext::InitVideoCodec(), MythV4L2M2MContext::InitVideoCodec(), MythVTBContext::InitVideoCodec(), MythVAAPIContext::InitVideoCodec(), MythNVDECContext::InitVideoCodec(), MythVAAPIContext::PostProcessFrame(), MythVDPAUContext::RetrieveFrame(), MythV4L2M2MContext::RetrieveFrame(), MythMMALContext::RetrieveFrame(), MythMediaCodecContext::RetrieveFrame(), MythVTBContext::RetrieveFrame(), MythVAAPIContext::RetrieveFrame(), MythNVDECContext::RetrieveFrame(), MythMMALContext::SetDecoderOptions(), and MythNVDECContext::SetDeinterlacing().
Definition at line 172 of file mythcodeccontext.h.
Referenced by MythVDPAUContext::DecoderNeedsReset().