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
int HwDecoderInit(AVCodecContext *Context) override
QHash< QString, Action * > Context
Definition: action.h:77
MythCodecID
Definition: mythcodecid.h:10
QList< MythCodecContext::CodecProfile > VTBProfiles
bool RetrieveFrame(AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame) override
struct AVFrame AVFrame
static const VTBProfiles & GetProfiles(void)
void InitFramesContext(AVCodecContext *Context)
Create a hardware frames context if needed.
AVBufferRef * m_framesContext
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
~MythVTBContext() override
unsigned int uint
Definition: compat.h:140
MythVTBContext(DecoderBase *Parent, MythCodecID CodecID)
static void GetDecoderList(QStringList &Decoders)
static int InitialiseDecoder(AVCodecContext *Context)
static enum AVPixelFormat GetFormat(AVCodecContext *Context, const enum AVPixelFormat *PixFmt)
static MythCodecID GetSupportedCodec(AVCodecContext **Context, AVCodec **Codec, const QString &Decoder, uint StreamType)
static bool HaveVTB(void)