MythTV master
mythvdpauinterop.h
Go to the documentation of this file.
1#ifndef MYTHVDPAUINTEROP_H
2#define MYTHVDPAUINTEROP_H
3
4// Qt
5#include <QObject>
6
7// MythTV
8#include "mythcodecid.h"
10
11// FFmpeg
12extern "C" {
13#include "libavutil/hwcontext_vdpau.h"
14}
15
16class MythVDPAUHelper;
17
18using MythVDPAUSurfaceNV = GLintptr;
19using MYTH_VDPAUINITNV = void (APIENTRY *)(const void*, const void*);
20using MYTH_VDPAUFININV = void (APIENTRY *)(void);
21using MYTH_VDPAUREGOUTSURFNV = MythVDPAUSurfaceNV (APIENTRY *)(const void*, GLenum, GLsizei, const GLuint*);
24
26{
27 Q_OBJECT
28
29 public:
32 std::vector<MythVideoTextureOpenGL*>
33 Acquire(MythRenderOpenGL* Context, MythVideoColourSpace* ColourSpace,
34 MythVideoFrame* Frame, FrameScanType Scan) override;
35 bool IsPreempted(void) const;
36
37 public slots:
38 void UpdateColourSpace(bool PrimariesChanged);
39 void DisplayPreempted(void);
40
41 protected:
43 ~MythVDPAUInterop() override;
44
45 private:
46 bool InitNV(AVVDPAUDeviceContext* DeviceContext);
47 bool InitVDPAU(AVVDPAUDeviceContext* DeviceContext, VdpVideoSurface Surface,
48 MythDeintType Deint, bool DoubleRate);
49 void Cleanup(void);
50 void CleanupDeinterlacer(void);
51 void RotateReferenceFrames(AVBufferRef* Buffer);
52
55 VdpOutputSurface m_outputSurface { 0 };
57 VdpVideoMixer m_mixer { 0 };
58 VdpChromaType m_mixerChroma { VDP_CHROMA_TYPE_420 };
61 QVector<AVBufferRef*> m_referenceFrames;
69 bool m_preempted { false };
70 bool m_preemptedWarning { false };
71 bool m_mapped { false };
72};
73
74#endif
std::map< VideoFrameType, InteropTypes > InteropMap
A simple wrapper around VDPAU functionality.
VdpVideoMixer m_mixer
VdpChromaType m_mixerChroma
MythVDPAUSurfaceNV m_outputSurfaceReg
VdpOutputSurface m_outputSurface
bool InitVDPAU(AVVDPAUDeviceContext *DeviceContext, VdpVideoSurface Surface, MythDeintType Deint, bool DoubleRate)
std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
Map VDPAU video surfaces to an OpenGL texture.
MYTH_VDPAUFININV m_finiNV
static void GetVDPAUTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
MythCodecID m_codec
MythVDPAUHelper * m_helper
MYTH_VDPAUREGOUTSURFNV m_registerNV
void RotateReferenceFrames(AVBufferRef *Buffer)
MYTH_VDPAUMAPSURFNV m_mapNV
MythDeintType m_deinterlacer
QVector< AVBufferRef * > m_referenceFrames
MythVideoColourSpace * m_colourSpace
MYTH_VDPAUSURFACCESSNV m_accessNV
~MythVDPAUInterop() override
void UpdateColourSpace(bool PrimariesChanged)
MYTH_VDPAUINITNV m_initNV
bool InitNV(AVVDPAUDeviceContext *DeviceContext)
bool IsPreempted(void) const
static MythVDPAUInterop * CreateVDPAU(MythPlayerUI *Player, MythRenderOpenGL *Context, MythCodecID CodecId)
void CleanupDeinterlacer(void)
MYTH_VDPAUMAPSURFNV m_unmapNV
void DisplayPreempted(void)
MythVDPAUInterop(MythPlayerUI *Player, MythRenderOpenGL *Context, MythCodecID CodecID)
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
MythCodecID
Definition: mythcodecid.h:14
@ kCodec_NONE
Definition: mythcodecid.h:17
MythDeintType
Definition: mythframe.h:67
@ DEINT_BASIC
Definition: mythframe.h:69
#define APIENTRY
GLintptr MythVDPAUSurfaceNV
MythVDPAUSurfaceNV(APIENTRY *)(const void *, GLenum, GLsizei, const GLuint *) MYTH_VDPAUREGOUTSURFNV
void(APIENTRY *)(void) MYTH_VDPAUFININV
void(APIENTRY *)(GLsizei, MythVDPAUSurfaceNV *) MYTH_VDPAUMAPSURFNV
void(APIENTRY *)(const void *, const void *) MYTH_VDPAUINITNV
void(APIENTRY *)(MythVDPAUSurfaceNV, GLenum) MYTH_VDPAUSURFACCESSNV
Definition: surface.h:4
FrameScanType
Definition: videoouttypes.h:95