MythTV  master
mythvtbcontext.h
Go to the documentation of this file.
1 #ifndef MYTHVTBCONTEXT_H
2 #define MYTHVTBCONTEXT_H
3 
4 // MythTV
5 #include "mythcodecid.h"
6 #include "mythcodeccontext.h"
7 
8 // FFmpeg
9 extern "C" {
10 #include "libavutil/pixfmt.h"
11 #include "libavutil/hwcontext.h"
12 #include "libavcodec/avcodec.h"
13 }
14 
15 using VTBProfiles = QList<MythCodecContext::CodecProfile>;
16 
18 {
19  public:
20  MythVTBContext(DecoderBase *Parent, MythCodecID CodecID);
21  ~MythVTBContext() override;
22 
23  // Shared decode only and direct rendering
24  void InitVideoCodec (AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override;
25  bool RetrieveFrame (AVCodecContext* Context,
27  AVFrame* AvFrame) override;
28  int HwDecoderInit (AVCodecContext *Context) override;
29  static MythCodecID GetSupportedCodec (AVCodecContext **Context,
30  AVCodec **Codec,
31  const QString &Decoder,
32  uint StreamType);
33  static enum AVPixelFormat GetFormat (AVCodecContext *Context,
34  const enum AVPixelFormat *PixFmt);
35  static bool HaveVTB (bool Reinit = false);
36  static void GetDecoderList (QStringList &Decoders);
37 
38  private:
39  static const VTBProfiles& GetProfiles(void);
40  static int InitialiseDecoder (AVCodecContext *Context);
41  void InitFramesContext (AVCodecContext *Context);
42  AVBufferRef* m_framesContext { nullptr };
43 };
44 
45 #endif
MythVTBContext::MythVTBContext
MythVTBContext(DecoderBase *Parent, MythCodecID CodecID)
Definition: mythvtbcontext.cpp:22
MythVTBContext::InitialiseDecoder
static int InitialiseDecoder(AVCodecContext *Context)
Definition: mythvtbcontext.cpp:130
MythVTBContext::m_framesContext
AVBufferRef * m_framesContext
Definition: mythvtbcontext.h:42
Frame
Definition: zmdefines.h:93
MythVTBContext::~MythVTBContext
~MythVTBContext() override
Definition: mythvtbcontext.cpp:27
MythVTBContext::GetDecoderList
static void GetDecoderList(QStringList &Decoders)
Definition: mythvtbcontext.cpp:272
MythVTBContext
Definition: mythvtbcontext.h:17
MythCodecID
MythCodecID
Definition: mythcodecid.h:10
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
Decoder
Definition: decoder.h:70
mythcodecid.h
MythVTBContext::GetFormat
static enum AVPixelFormat GetFormat(AVCodecContext *Context, const enum AVPixelFormat *PixFmt)
Definition: mythvtbcontext.cpp:180
uint
unsigned int uint
Definition: compat.h:140
MythVTBContext::GetSupportedCodec
static MythCodecID GetSupportedCodec(AVCodecContext **Context, AVCodec **Codec, const QString &Decoder, uint StreamType)
Definition: mythvtbcontext.cpp:75
MythVTBContext::GetProfiles
static const VTBProfiles & GetProfiles(void)
Definition: mythvtbcontext.cpp:201
MythVTBContext::InitVideoCodec
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
Definition: mythvtbcontext.cpp:32
MythVTBContext::InitFramesContext
void InitFramesContext(AVCodecContext *Context)
Create a hardware frames context if needed.
Definition: mythvtbcontext.cpp:306
mythcodeccontext.h
MythCodecContext
Definition: mythcodeccontext.h:53
MythVTBContext::HwDecoderInit
int HwDecoderInit(AVCodecContext *Context) override
Definition: mythvtbcontext.cpp:56
MythVideoFrame
Definition: mythframe.h:88
MythVTBContext::RetrieveFrame
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
Definition: mythvtbcontext.cpp:45
VTBProfiles
QList< MythCodecContext::CodecProfile > VTBProfiles
Definition: mythvtbcontext.h:15
DecoderBase
Definition: decoderbase.h:120
MythVTBContext::HaveVTB
static bool HaveVTB(bool Reinit=false)
Definition: mythvtbcontext.cpp:239