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
9extern "C" {
10#include "libavutil/pixfmt.h"
11#include "libavutil/hwcontext.h"
12#include "libavcodec/avcodec.h"
13}
14
15using 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 const 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
AVFrame AVFrame
static enum AVPixelFormat GetFormat(AVCodecContext *Context, const enum AVPixelFormat *PixFmt)
int HwDecoderInit(AVCodecContext *Context) override
MythVTBContext(DecoderBase *Parent, MythCodecID CodecID)
static bool HaveVTB(bool Reinit=false)
void InitFramesContext(AVCodecContext *Context)
Create a hardware frames context if needed.
static MythCodecID GetSupportedCodec(AVCodecContext **Context, const AVCodec **Codec, const QString &Decoder, uint StreamType)
AVBufferRef * m_framesContext
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
static const VTBProfiles & GetProfiles(void)
static void GetDecoderList(QStringList &Decoders)
~MythVTBContext() override
static int InitialiseDecoder(AVCodecContext *Context)
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
unsigned int uint
Definition: freesurround.h:24
MythCodecID
Definition: mythcodecid.h:14
QList< MythCodecContext::CodecProfile > VTBProfiles