MythTV master
mythvaapiglxinterop.h
Go to the documentation of this file.
1#ifndef MYTHVAAPIGLXNTEROP_H
2#define MYTHVAAPIGLXNTEROP_H
3
4// MythTV
5#include "libmythbase/mythconfig.h"
6
8
12
13#include "mythvaapiinterop.h"
14
16{
17 Q_OBJECT
18
19 public:
21 ~MythVAAPIInteropGLX() override;
22
23 public slots:
24 int SetPictureAttribute(PictureAttribute Attribute, int Value);
25
26 protected:
29
30 protected:
31 VADisplayAttribute* m_vaapiPictureAttributes { nullptr };
35};
36
38{
39 public:
41 ~MythVAAPIInteropGLXCopy() override;
42
43 std::vector<MythVideoTextureOpenGL*>
45 MythVideoColourSpace* ColourSpace,
46 MythVideoFrame* Frame, FrameScanType Scan) override;
47
48 private:
49 void* m_glxSurface { nullptr };
50};
51
52#if CONFIG_VAAPI_X11
53#define Cursor XCursor // Prevent conflicts with Qt6.
54#define pointer Xpointer // Prevent conflicts with Qt6.
55#if defined(_X11_XLIB_H_) && !defined(Bool)
56#define Bool int
57#endif
58#include <GL/glx.h>
59#include <GL/glxext.h>
60#undef None // X11/X.h defines this. Causes compile failure in Qt6.
61#undef Cursor
62#undef pointer
63#undef Bool // Interferes with cmake moc file compilation
64
65using MYTH_GLXBINDTEXIMAGEEXT = void (*)(Display*, GLXDrawable, int, int*);
66using MYTH_GLXRELEASETEXIMAGEEXT = void (*)(Display*, GLXDrawable, int);
67
68class MythVAAPIInteropGLXPixmap : public MythVAAPIInteropGLX
69{
70 public:
71 MythVAAPIInteropGLXPixmap(MythPlayerUI* Player, MythRenderOpenGL* Context);
72 ~MythVAAPIInteropGLXPixmap() override;
73
74 std::vector<MythVideoTextureOpenGL*>
76 MythVideoColourSpace* ColourSpace,
77 MythVideoFrame* Frame, FrameScanType Scan) override;
78 static bool IsSupported(MythRenderOpenGL* Context);
79
80 private:
81 bool InitPixmaps();
82
83 // Texture from Pixmap
84 Pixmap m_pixmap { 0 };
85 GLXPixmap m_glxPixmap { 0 };
86 MYTH_GLXBINDTEXIMAGEEXT m_glxBindTexImageEXT { nullptr };
87 MYTH_GLXRELEASETEXIMAGEEXT m_glxReleaseTexImageEXT { nullptr };
88};
89#endif // CONFIG_VAAPI_X11
90
91#endif // MYTHVAAPIGLXNTEROP_H
virtual std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan)
std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
MythVAAPIInteropGLXCopy(MythPlayerUI *Player, MythRenderOpenGL *Context)
MythVAAPIInteropGLX(MythPlayerUI *Player, MythRenderOpenGL *Context, InteropType Type)
void InitPictureAttributes(MythVideoColourSpace *ColourSpace)
VADisplayAttribute * m_vaapiPictureAttributes
MythDeintType m_basicDeinterlacer
uint GetFlagsForFrame(MythVideoFrame *Frame, FrameScanType Scan)
int SetPictureAttribute(PictureAttribute Attribute, int Value)
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
unsigned int uint
Definition: freesurround.h:24
MythDeintType
Definition: mythframe.h:67
@ DEINT_NONE
Definition: mythframe.h:68
FrameScanType
Definition: videoouttypes.h:95
PictureAttribute