|
MythTV master
|
#include <libmythtv/decoders/mythcodeccontext.h>
Public Types | |
| enum | CodecProfile : std::uint8_t { NoProfile = 0 , MPEG1 , MPEG2 , MPEG2Simple , MPEG2Main , MPEG2422 , MPEG2High , MPEG2Spatial , MPEG2SNR , MPEG4 , MPEG4Simple , MPEG4SimpleScaleable , MPEG4Core , MPEG4Main , MPEG4NBit , MPEG4ScaleableTexture , MPEG4SimpleFace , MPEG4BasicAnimated , MPEG4Hybrid , MPEG4AdvancedRT , MPEG4CoreScaleable , MPEG4AdvancedCoding , MPEG4AdvancedCore , MPEG4AdvancedScaleableTexture , MPEG4SimpleStudio , MPEG4AdvancedSimple , H263 , H264 , H264Baseline , H264ConstrainedBaseline , H264Main , H264MainExtended , H264High , H264High10 , H264Extended , H264High422 , H264High444 , H264ConstrainedHigh , HEVC , HEVCMain , HEVCMain10 , HEVCMainStill , HEVCRext , HEVCMain10HDR , HEVCMain10HDRPlus , VC1 , VC1Simple , VC1Main , VC1Complex , VC1Advanced , VP8 , VP9 , VP9_0 , VP9_1 , VP9_2 , VP9_3 , VP9_2HDR , VP9_2HDRPlus , VP9_3HDR , VP9_3HDRPlus , AV1 , AV1Main , AV1High , AV1Professional , MJPEG } |
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 52 of file mythcodeccontext.h.
| enum MythCodecContext::CodecProfile : std::uint8_t |
Definition at line 55 of file mythcodeccontext.h.
|
explicit |
Definition at line 71 of file mythcodeccontext.cpp.
Referenced by CreateContext().
|
virtualdefault |
|
static |
Definition at line 77 of file mythcodeccontext.cpp.
Referenced by AvFormatDecoder::InitVideoCodec().
|
static |
Definition at line 494 of file mythcodeccontext.cpp.
Referenced by InitialiseDecoder(), and InitialiseDecoder2().
|
static |
Definition at line 559 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::GetFormat2(), MythVAAPIContext::GetProfiles(), MythVAAPIContext::HaveVAAPI(), MythNVDECContext::HwDecoderInit(), MythVTBContext::HwDecoderInit(), MythVDPAUContext::InitialiseContext(), MythVAAPIContext::InitialiseContext2(), and MythV4L2M2MContext::InitialiseV4L2RequestContext().
|
inlinevirtual |
Reimplemented in MythVDPAUContext.
Definition at line 160 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::ProcessVideoPacket(), and AvFormatDecoder::SeekReset().
|
inlinevirtual |
Reimplemented in MythVAAPIContext, and MythVDPAUContext.
Definition at line 159 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::H264PreProcessPkt(), and AvFormatDecoder::MpegPreProcessPkt().
|
inlinevirtual |
Reimplemented in MythV4L2M2MContext, MythVAAPIContext, MythDRMPRIMEContext, MythNVDECContext, and MythVDPAUContext.
Definition at line 158 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::SeekReset().
|
staticprotected |
Definition at line 466 of file mythcodeccontext.cpp.
Referenced by DeviceContextFinished(), FramesContextFinished(), MythDRMPRIMEContext::~MythDRMPRIMEContext(), and MythMMALContext::~MythMMALContext().
|
static |
Definition at line 448 of file mythcodeccontext.cpp.
Referenced by CreateDevice(), MythMediaCodecContext::InitialiseDecoder(), MythNVDECContext::InitialiseDecoder(), and MythVTBContext::InitialiseDecoder().
|
static |
Definition at line 686 of file mythcodeccontext.cpp.
Referenced by MythMediaCodecContext::GetBestSupportedCodec(), MythVDPAUContext::GetSupportedCodec(), and MythVAAPIContext::GetSupportedCodec().
|
virtual |
Retrieve and process/filter AVFrame.
Reimplemented in MythVAAPIContext.
Definition at line 623 of file mythcodeccontext.cpp.
Referenced by AvFormatDecoder::ProcessVideoPacket().
|
static |
Definition at line 250 of file mythcodeccontext.cpp.
Referenced by AvFormatDecoder::autoSelectVideoTrack().
|
static |
Definition at line 438 of file mythcodeccontext.cpp.
Referenced by MythNVDECContext::InitFramesContext(), MythVTBContext::InitFramesContext(), MythVAAPIContext::InitialiseContext(), MythVDPAUContext::InitialiseContext(), and MythVAAPIContext::InitialiseContext2().
|
static |
Definition at line 515 of file mythcodeccontext.cpp.
Referenced by MythMediaCodecContext::GetBestSupportedCodec(), MythNVDECContext::GetSupportedCodec(), MythVDPAUContext::GetSupportedCodec(), MythDRMPRIMEContext::GetSupportedCodec(), MythMMALContext::GetSupportedCodec(), MythV4L2M2MContext::GetSupportedCodec(), MythVAAPIContext::GetSupportedCodec(), MythVTBContext::GetSupportedCodec(), MythDRMPRIMEContext::HwDecoderInit(), and MythMMALContext::HwDecoderInit().
|
static |
A generic hardware buffer initialisation method when using AVHWFramesContext.
Definition at line 327 of file mythcodeccontext.cpp.
Referenced by MythVAAPIContext::InitVideoCodec(), and MythVDPAUContext::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 |
Definition at line 119 of file mythcodeccontext.cpp.
Referenced by StatusBox::doDecoderStatus().
|
static |
Definition at line 147 of file mythcodeccontext.cpp.
Referenced by MythVideoProfile::InitStatics().
|
static |
Definition at line 506 of file mythcodeccontext.cpp.
Referenced by FrameTypeIsSupported(), MythDRMPRIMEContext::HwDecoderInit(), MythMMALContext::HwDecoderInit(), MythVAAPIContext::InitialiseContext(), MythVDPAUContext::InitialiseContext(), MythMediaCodecContext::InitialiseDecoder(), MythNVDECContext::InitialiseDecoder(), MythVTBContext::InitialiseDecoder(), InitialiseDecoder(), and InitialiseDecoder2().
|
static |
Definition at line 789 of file mythcodeccontext.cpp.
Referenced by MythMediaCodecContext::GetBestSupportedCodec(), MythMediaCodecContext::GetDecoderList(), MythMMALContext::GetDecoderList(), MythNVDECContext::GetDecoderList(), MythV4L2M2MContext::GetDecoderList(), MythVAAPIContext::GetDecoderList(), MythVDPAUHelper::GetDecoderList(), MythVTBContext::GetDecoderList(), MythV4L2M2MContext::GetProfiles(), MythVDPAUContext::GetSupportedCodec(), MythMediaCodecContext::HaveMediaCodec(), MythMMALContext::HaveMMAL(), MythNVDECContext::HaveNVDEC(), MythV4L2M2MContext::HaveV4L2Codecs(), MythVAAPIContext::HaveVAAPI(), MythVDPAUHelper::HaveVDPAU(), and MythVTBContext::HaveVTB().
|
inlinevirtual |
Reimplemented in MythDRMPRIMEContext, MythMediaCodecContext, MythMMALContext, MythNVDECContext, MythV4L2M2MContext, and MythVTBContext.
Definition at line 151 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::InitVideoCodec().
|
static |
Initialise a hardware decoder that is expected to use AVHWFramesContext.
Definition at line 526 of file mythcodeccontext.cpp.
Referenced by MythVAAPIContext::GetFormat(), and MythVDPAUContext::GetFormat().
|
static |
Initialise a hardware decoder that is NOT expected to use AVHWFramesContext.
Definition at line 543 of file mythcodeccontext.cpp.
Referenced by MythV4L2M2MContext::GetV4L2RequestFormat(), MythMediaCodecContext::HwDecoderInit(), MythNVDECContext::HwDecoderInit(), and MythVTBContext::HwDecoderInit().
|
virtual |
Reimplemented in MythDRMPRIMEContext, MythMediaCodecContext, MythMMALContext, MythNVDECContext, MythV4L2M2MContext, MythVAAPIContext, MythVDPAUContext, and MythVTBContext.
Definition at line 307 of file mythcodeccontext.cpp.
Referenced by MythDRMPRIMEContext::InitVideoCodec(), MythMediaCodecContext::InitVideoCodec(), MythMMALContext::InitVideoCodec(), MythNVDECContext::InitVideoCodec(), MythVAAPIContext::InitVideoCodec(), MythVDPAUContext::InitVideoCodec(), MythVTBContext::InitVideoCodec(), and AvFormatDecoder::InitVideoCodec().
Reimplemented in MythNVDECContext, MythVAAPIContext, and MythMediaCodecContext.
Definition at line 156 of file mythcodeccontext.h.
Referenced by MythDVDPlayer::AutoDeint(), AvFormatDecoder::H264PreProcessPkt(), and AvFormatDecoder::MpegPreProcessPkt().
|
static |
Most hardware decoders do not support these codecs/profiles.
Definition at line 598 of file mythcodeccontext.cpp.
Referenced by MythNVDECContext::GetSupportedCodec(), MythVDPAUContext::GetSupportedCodec(), and MythVTBContext::GetSupportedCodec().
|
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 431 of file mythcodeccontext.cpp.
Referenced by MythVDPAUContext::GetFormat2(), MythNVDECContext::InitFramesContext(), MythVTBContext::InitFramesContext(), MythVAAPIContext::InitialiseContext(), MythVDPAUContext::InitialiseContext(), and MythVAAPIContext::InitialiseContext2().
|
inlinevirtual |
Reimplemented in MythMediaCodecContext, MythNVDECContext, and MythVAAPIContext.
Definition at line 155 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::ProcessVideoFrame().
|
static |
Definition at line 416 of file mythcodeccontext.cpp.
Referenced by MythNVDECContext::GetBuffer(), GetBuffer(), MythMMALContext::GetBuffer2(), GetBuffer2(), and MythDRMPRIMEContext::GetDRMBuffer().
|
inlinevirtual |
Reimplemented in MythDRMPRIMEContext, MythMediaCodecContext, MythMMALContext, MythNVDECContext, MythV4L2M2MContext, MythVAAPIContext, MythVDPAUContext, and MythVTBContext.
Definition at line 152 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::ProcessVideoFrame().
|
protectedvirtual |
Definition at line 628 of file mythcodeccontext.cpp.
Referenced by MythNVDECContext::RetrieveFrame(), MythVAAPIContext::RetrieveFrame(), MythVDPAUContext::RetrieveFrame(), and MythVTBContext::RetrieveFrame().
|
inlinevirtual |
Reimplemented in MythMMALContext, and MythV4L2M2MContext.
Definition at line 157 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::autoSelectVideoTrack().
|
inlinevirtual |
Reimplemented in MythNVDECContext.
Definition at line 154 of file mythcodeccontext.h.
Referenced by AvFormatDecoder::InitVideoCodec().
|
protected |
Definition at line 169 of file mythcodeccontext.h.
Referenced by MythVDPAUContext::DecoderNeedsReset(), MythVAAPIContext::DecoderWillResetOnAspect(), MythVDPAUContext::DecoderWillResetOnAspect(), MythV4L2M2MContext::DecoderWillResetOnFlush(), MythVAAPIContext::DecoderWillResetOnFlush(), MythNVDECContext::DecoderWillResetOnFlush(), MythVDPAUContext::DecoderWillResetOnFlush(), MythMediaCodecContext::HwDecoderInit(), MythMMALContext::HwDecoderInit(), MythNVDECContext::HwDecoderInit(), MythV4L2M2MContext::HwDecoderInit(), MythVTBContext::HwDecoderInit(), MythNVDECContext::InitFramesContext(), MythVTBContext::InitFramesContext(), MythMMALContext::InitVideoCodec(), MythNVDECContext::InitVideoCodec(), MythV4L2M2MContext::InitVideoCodec(), MythVAAPIContext::InitVideoCodec(), MythVDPAUContext::InitVideoCodec(), MythVTBContext::InitVideoCodec(), MythVAAPIContext::PostProcessFrame(), MythMediaCodecContext::RetrieveFrame(), MythMMALContext::RetrieveFrame(), MythNVDECContext::RetrieveFrame(), MythV4L2M2MContext::RetrieveFrame(), MythVAAPIContext::RetrieveFrame(), MythVDPAUContext::RetrieveFrame(), MythVTBContext::RetrieveFrame(), MythMMALContext::SetDecoderOptions(), and MythNVDECContext::SetDeinterlacing().
|
protected |
Definition at line 168 of file mythcodeccontext.h.
Referenced by MythNVDECContext::InitFramesContext(), MythVTBContext::InitFramesContext(), and RetrieveHWFrame().
Definition at line 170 of file mythcodeccontext.h.
Referenced by MythVDPAUContext::DecoderNeedsReset().
|
staticprotected |
Definition at line 166 of file mythcodeccontext.h.
Referenced by FramesContextFinished(), and NewHardwareFramesContext().