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 (void);
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:21
MythVTBContext::InitialiseDecoder
static int InitialiseDecoder(AVCodecContext *Context)
Definition: mythvtbcontext.cpp:125
MythVTBContext::m_framesContext
AVBufferRef * m_framesContext
Definition: mythvtbcontext.h:42
Frame
Definition: zmdefines.h:93
Context
QHash< QString, Action * > Context
Definition: action.h:77
MythVTBContext::~MythVTBContext
~MythVTBContext() override
Definition: mythvtbcontext.cpp:26
VideoFrame
Definition: mythframe.h:137
MythVTBContext::GetDecoderList
static void GetDecoderList(QStringList &Decoders)
Definition: mythvtbcontext.cpp:269
MythVTBContext
Definition: mythvtbcontext.h:17
MythCodecID
MythCodecID
Definition: mythcodecid.h:10
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
Decoder
Definition: decoder.h:65
MythVTBContext::HaveVTB
static bool HaveVTB(void)
Definition: mythvtbcontext.cpp:240
mythcodecid.h
MythVTBContext::GetFormat
static enum AVPixelFormat GetFormat(AVCodecContext *Context, const enum AVPixelFormat *PixFmt)
Definition: mythvtbcontext.cpp:185
uint
unsigned int uint
Definition: compat.h:140
MythVTBContext::RetrieveFrame
bool RetrieveFrame(AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame) override
Definition: mythvtbcontext.cpp:44
MythVTBContext::GetSupportedCodec
static MythCodecID GetSupportedCodec(AVCodecContext **Context, AVCodec **Codec, const QString &Decoder, uint StreamType)
Definition: mythvtbcontext.cpp:74
MythVTBContext::GetProfiles
static const VTBProfiles & GetProfiles(void)
Definition: mythvtbcontext.cpp:206
MythVTBContext::InitVideoCodec
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
Definition: mythvtbcontext.cpp:31
MythVTBContext::InitFramesContext
void InitFramesContext(AVCodecContext *Context)
Create a hardware frames context if needed.
Definition: mythvtbcontext.cpp:303
mythcodeccontext.h
MythCodecContext
Definition: mythcodeccontext.h:50
MythVTBContext::HwDecoderInit
int HwDecoderInit(AVCodecContext *Context) override
Definition: mythvtbcontext.cpp:55
VTBProfiles
QList< MythCodecContext::CodecProfile > VTBProfiles
Definition: mythvtbcontext.h:15
DecoderBase
Definition: decoderbase.h:119