MythTV  master
mythvaapiglxinterop.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "mythvideoout.h"
4 
5 #define LOC QString("VAAPIGLX: ")
6 
8  : MythVAAPIInterop(Player, Context, Type)
9 {
10 }
11 
13 {
14  delete [] m_vaapiPictureAttributes;
15 }
16 
18 {
19  uint flags = VA_FRAME_PICTURE;
20  if (!Frame)
21  return flags;
22 
23  // Set deinterlacing flags if VPP is not available
24  if (m_deinterlacer)
25  {
26  flags = VA_FRAME_PICTURE;
27  }
28  else if (is_interlaced(Scan))
29  {
30  // As for VDPAU, only VAAPI can deinterlace these frames - so accept any deinterlacer
31  bool doublerate = true;
32  MythDeintType driverdeint = Frame->GetDoubleRateOption(DEINT_DRIVER | DEINT_CPU | DEINT_SHADER);
33  if (!driverdeint)
34  {
35  doublerate = false;
36  driverdeint = Frame->GetSingleRateOption(DEINT_DRIVER | DEINT_CPU | DEINT_SHADER);
37  }
38 
39  if (driverdeint)
40  {
41  driverdeint = DEINT_BASIC;
42  if (m_basicDeinterlacer != driverdeint)
43  {
44  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Enabled deinterlacer '%1'")
45  .arg(MythVideoFrame::DeinterlacerName(driverdeint | DEINT_DRIVER, doublerate, FMT_VAAPI)));
46  }
47 
48  bool top = Frame->m_interlacedReverse ? !Frame->m_topFieldFirst : Frame->m_topFieldFirst;
49  if (Scan == kScan_Interlaced)
50  {
51  Frame->m_deinterlaceInuse = driverdeint | DEINT_DRIVER;
52  Frame->m_deinterlaceInuse2x = doublerate;
53  flags = top ? VA_TOP_FIELD : VA_BOTTOM_FIELD;
54  }
55  else if (Scan == kScan_Intr2ndField)
56  {
57  Frame->m_deinterlaceInuse = driverdeint | DEINT_DRIVER;
58  Frame->m_deinterlaceInuse2x = doublerate;
59  flags = top ? VA_BOTTOM_FIELD : VA_TOP_FIELD;
60  }
61  m_basicDeinterlacer = driverdeint;
62  }
63  else if (m_basicDeinterlacer)
64  {
65  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Disabled basic VAAPI deinterlacer");
67  }
68  }
69 
70  // Update colourspace
71  if (!m_vaapiColourSpace)
72  {
73  switch (Frame->m_colorspace)
74  {
75  case AVCOL_SPC_BT709: m_vaapiColourSpace = VA_SRC_BT709; break;
76  case AVCOL_SPC_SMPTE170M:
77  case AVCOL_SPC_BT470BG: m_vaapiColourSpace = VA_SRC_BT601; break;
78  case AVCOL_SPC_SMPTE240M: m_vaapiColourSpace = VA_SRC_SMPTE_240; break;
79  default:
80  m_vaapiColourSpace = ((Frame->m_width < 1280) ? VA_SRC_BT601 : VA_SRC_BT709); break;
81  }
82  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Using '%1' VAAPI colourspace")
83  .arg((m_vaapiColourSpace == VA_SRC_BT709) ? "bt709" : ((m_vaapiColourSpace == VA_SRC_BT601) ? "bt601" : "smpte240")));
84  }
85  flags |= m_vaapiColourSpace;
86  return flags;
87 }
88 
90 {
92  if (!ColourSpace || !m_vaDisplay)
93  return;
94 
96 
97  delete [] m_vaapiPictureAttributes;
99  int supported_controls = kPictureAttributeSupported_None;
100  QVector<VADisplayAttribute> supported;
101  int num = vaMaxNumDisplayAttributes(m_vaDisplay);
102  auto* attribs = new VADisplayAttribute[static_cast<unsigned int>(num)];
103 
104  int actual = 0;
105  INIT_ST;
106  va_status = vaQueryDisplayAttributes(m_vaDisplay, attribs, &actual);
107  CHECK_ST;
108 
109  for (int i = 0; i < actual; i++)
110  {
111  int type = attribs[i].type;
112  if ((attribs[i].flags & VA_DISPLAY_ATTRIB_SETTABLE) &&
113  (type == VADisplayAttribBrightness ||
114  type == VADisplayAttribContrast ||
115  type == VADisplayAttribHue ||
116  type == VADisplayAttribSaturation ||
117  type == VADisplayAttribCSCMatrix))
118  {
119  supported.push_back(attribs[i]);
120  if (type == VADisplayAttribBrightness)
121  supported_controls += kPictureAttributeSupported_Brightness;
122  if (type == VADisplayAttribHue)
123  supported_controls += kPictureAttributeSupported_Hue;
124  if (type == VADisplayAttribContrast)
125  supported_controls += kPictureAttributeSupported_Contrast;
126  if (type == VADisplayAttribSaturation)
127  supported_controls += kPictureAttributeSupported_Colour;
128  }
129  }
130 
131  // Set the supported attributes
132  ColourSpace->SetSupportedAttributes(static_cast<PictureAttributeSupported>(supported_controls));
133  // and listen for changes
135 
136  // create
137  delete [] attribs;
138 
139  if (supported.isEmpty())
140  return;
141 
142  m_vaapiPictureAttributeCount = supported.size();
143  m_vaapiPictureAttributes = new VADisplayAttribute[static_cast<unsigned int>(m_vaapiPictureAttributeCount)];
144  for (int i = 0; i < m_vaapiPictureAttributeCount; i++)
145  m_vaapiPictureAttributes[i] = supported.at(i);
146 
147  if (supported_controls & kPictureAttributeSupported_Brightness)
149  if (supported_controls & kPictureAttributeSupported_Hue)
151  if (supported_controls & kPictureAttributeSupported_Contrast)
153  if (supported_controls & kPictureAttributeSupported_Colour)
155 }
156 
158 {
159  if (!m_vaDisplay)
160  return -1;
161 
162  int adjustment = 0;
163  VADisplayAttribType attrib = VADisplayAttribBrightness;
164  switch (Attribute)
165  {
167  attrib = VADisplayAttribBrightness;
168  break;
170  attrib = VADisplayAttribContrast;
171  break;
173  attrib = VADisplayAttribHue;
174  adjustment = 50;
175  break;
177  attrib = VADisplayAttribSaturation;
178  break;
179  default:
180  return -1;
181  }
182 
183  bool found = false;
184  for (int i = 0; i < m_vaapiPictureAttributeCount; i++)
185  {
186  if (m_vaapiPictureAttributes[i].type == attrib)
187  {
188  Value = std::min(std::max(Value, 0), 100);
189  int newval = Value + adjustment;
190  if (newval > 100) newval -= 100;
191  qreal range = (m_vaapiPictureAttributes[i].max_value - m_vaapiPictureAttributes[i].min_value) / 100.0;
192  int val = m_vaapiPictureAttributes[i].min_value + qRound(newval * range);
193  m_vaapiPictureAttributes[i].value = val;
194  found = true;
195  break;
196  }
197  }
198 
199 
200  if (found)
201  {
203  INIT_ST;
204  va_status = vaSetDisplayAttributes(m_vaDisplay,
207  CHECK_ST;
209  return Value;
210  }
211  return -1;
212 }
213 
215  : MythVAAPIInteropGLX(Player, Context, GL_VAAPIGLXCOPY)
216 {
217  Display *display = glXGetCurrentDisplay();
218  if (!display)
219  {
220  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to open GLX display");
221  return;
222  }
223 
224  m_vaDisplay = vaGetDisplayGLX(display);
225  if (!m_vaDisplay)
226  {
227  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create GLX VADisplay");
228  return;
229  }
231 }
232 
234 {
235  if (m_glxSurface && m_vaDisplay)
236  {
237  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Deleting GLX surface");
239  INIT_ST;
240  va_status = vaDestroySurfaceGLX(m_vaDisplay, m_glxSurface);
241  CHECK_ST;
242  }
243 }
244 
245 std::vector<MythVideoTextureOpenGL*>
247  MythVideoColourSpace* ColourSpace,
249  FrameScanType Scan)
250 {
251  std::vector<MythVideoTextureOpenGL*> result;
252  if (!Frame)
253  return result;
254 
255  // Retrieve the VASurface
256  VASurfaceID id = VerifySurface(Context, Frame);
257  if (!id || !m_vaDisplay)
258  return result;
259 
260  // Initialise colourspace on first frame
261  if (ColourSpace && m_openglTextures.isEmpty())
262  InitPictureAttributes(ColourSpace);
263 
264  // Lock
266 
267  // we only ever use one glx surface which is updated on each call
268  if (m_openglTextures.isEmpty())
269  {
270  // create a texture
271  // N.B. No apparent 10/12/16bit support here. Can't encourage vaCreateSurfaceGLX
272  // to work with a 16bit texture
274  if (!texture)
275  return result;
276 
277  texture->m_plane = 0;
278  texture->m_planeCount = 1;
279  texture->m_frameType = FMT_VAAPI;
280  texture->m_frameFormat = FMT_RGBA32;
281 
282  // create an associated GLX surface
283  INIT_ST;
284  va_status = vaCreateSurfaceGLX(m_vaDisplay, texture->m_texture->target(),
285  texture->m_texture->textureId(), &m_glxSurface);
286  CHECK_ST;
287  if (!m_glxSurface)
288  {
289  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create GLX surface.");
291  return result;
292  }
293 
294  result.push_back(texture);
295  m_openglTextures.insert(DUMMY_INTEROP_ID, result);
296  }
297 
298  if (m_openglTextures.isEmpty() || !m_glxSurface)
299  return result;
301 
302  // VPP deinterlacing
303  id = Deinterlace(Frame, id, Scan);
304 
305  // Copy surface to texture
306  INIT_ST;
307  va_status = vaCopySurfaceGLX(m_vaDisplay, m_glxSurface, id, GetFlagsForFrame(Frame, Scan));
308  CHECK_ST;
309  return result;
310 }
311 
313  : MythVAAPIInteropGLX(Player, Context, GL_VAAPIGLXPIX)
314 {
315  m_vaDisplay = vaGetDisplay(glXGetCurrentDisplay());
316  if (!m_vaDisplay)
317  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create X11 VADisplay");
318  else
320  InitPixmaps();
321 }
322 
324 {
326  Display* display = glXGetCurrentDisplay();
327  if (!InitPixmaps() || !display)
328  return;
329 
330  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Deleting GLX Pixmaps");
331  if (m_glxPixmap)
332  {
333  m_glxReleaseTexImageEXT(display, m_glxPixmap, GLX_FRONT_EXT);
334  XSync(display, False);
335  glXDestroyPixmap(display, m_glxPixmap);
336  }
337 
338  if (m_pixmap)
339  XFreePixmap(display, m_pixmap);
340 }
341 
342 std::vector<MythVideoTextureOpenGL*>
344  MythVideoColourSpace* ColourSpace,
346  FrameScanType Scan)
347 {
348  std::vector<MythVideoTextureOpenGL*> result;
349  if (!Frame)
350  return result;
351 
352  // Retrieve the VASurface
353  VASurfaceID id = VerifySurface(Context, Frame);
354  if (!id || !m_vaDisplay)
355  return result;
356 
357  // Initialise colourspace on first frame
358  if (ColourSpace && m_openglTextures.isEmpty())
359  InitPictureAttributes(ColourSpace);
360 
361  // Lock
363  if (!InitPixmaps())
364  return result;
365 
366  // we only ever use one pixmap which is updated on each call
367  if (m_openglTextures.isEmpty())
368  {
369  // Get display
370  Display* display = glXGetCurrentDisplay();
371  if (!display)
372  return result;
373 
374  // Get a framebuffer config
375  const std::array<const int,23> fbattribs {
376  GLX_RENDER_TYPE, GLX_RGBA_BIT,
377  GLX_X_RENDERABLE, True,
378  GLX_BIND_TO_TEXTURE_RGBA_EXT, True,
379  GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
380  GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
381  GLX_Y_INVERTED_EXT, True,
382  GLX_DOUBLEBUFFER, False,
383  GLX_RED_SIZE, 8,
384  GLX_GREEN_SIZE, 8,
385  GLX_BLUE_SIZE, 8,
386  GLX_ALPHA_SIZE, 8,
387  0 };
388  int fbcount = 0;
389  GLXFBConfig *fbs = glXChooseFBConfig(display, DefaultScreen(display), fbattribs.data(), &fbcount);
390  if (!fbcount)
391  {
392  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to retrieve GLX framebuffer config");
393  return result;
394  }
395 
396  GLXFBConfig fbconfig = fbs[0];
397  XFree(fbs);
398 
399  // create pixmaps
400  uint width = static_cast<uint>(m_textureSize.width());
401  uint height = static_cast<uint>(m_textureSize.height());
402  XWindowAttributes xwattribs;
403  XGetWindowAttributes(display, DefaultRootWindow(display), &xwattribs);
404  m_pixmap = XCreatePixmap(display, DefaultRootWindow(display),
405  width, height, static_cast<uint>(xwattribs.depth));
406  if (!m_pixmap)
407  {
408  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create Pixmap");
409  return result;
410  }
411 
412  const std::array<const int,7> attribs {
413  GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT,
414  GLX_TEXTURE_FORMAT_EXT, xwattribs.depth == 32 ? GLX_TEXTURE_FORMAT_RGBA_EXT : GLX_TEXTURE_FORMAT_RGB_EXT,
415  GLX_MIPMAP_TEXTURE_EXT, False, 0};
416 
417  m_glxPixmap = glXCreatePixmap(display, fbconfig, m_pixmap, attribs.data());
418  if (!m_glxPixmap)
419  {
420  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create GLXPixmap");
421  return result;
422  }
423 
424  // Create a texture
425  // N.B. as for GLX Copy there is no obvious 10/12/16bit support here.
426  // too many unknowns in this pipeline
427  std::vector<QSize> size;
428  size.push_back(m_textureSize);
429  std::vector<MythVideoTextureOpenGL*> textures = MythVideoTextureOpenGL::CreateTextures(m_openglContext, FMT_VAAPI, FMT_RGBA32, size);
430  if (textures.empty())
431  return result;
432  result.push_back(textures[0]);
433  m_openglTextures.insert(DUMMY_INTEROP_ID, result);
434  }
435 
436  if (m_openglTextures.isEmpty() || !m_glxPixmap || !m_pixmap)
437  return result;
439 
440  // VPP deinterlacing
441  id = Deinterlace(Frame, id, Scan);
442 
443  // Copy the surface to the texture
444  INIT_ST;
445  va_status = vaSyncSurface(m_vaDisplay, id);
446  CHECK_ST;
447  auto width = static_cast<unsigned short>(m_textureSize.width());
448  auto height = static_cast<unsigned short>(m_textureSize.height());
449  va_status = vaPutSurface(m_vaDisplay, id, m_pixmap,
450  0, 0, width, height, 0, 0, width, height,
451  nullptr, 0, GetFlagsForFrame(Frame, Scan));
452  CHECK_ST;
453 
454  Display* glxdisplay = glXGetCurrentDisplay();
455  if (glxdisplay)
456  {
457  XSync(glxdisplay, False);
458  m_openglContext->glBindTexture(QOpenGLTexture::Target2D, result[0]->m_textureId);
459  m_glxBindTexImageEXT(glxdisplay, m_glxPixmap, GLX_FRONT_EXT, nullptr);
460  m_openglContext->glBindTexture(QOpenGLTexture::Target2D, 0);
461  }
462  return result;
463 }
464 
466 {
468  return true;
469 
471  m_glxBindTexImageEXT = reinterpret_cast<MYTH_GLXBINDTEXIMAGEEXT>(glXGetProcAddressARB(reinterpret_cast<const GLubyte*>("glXBindTexImageEXT")));
472  m_glxReleaseTexImageEXT = reinterpret_cast<MYTH_GLXRELEASETEXIMAGEEXT>(glXGetProcAddressARB(reinterpret_cast<const GLubyte*>("glXReleaseTexImageEXT")));
474  {
475  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to resolve 'texture_from_pixmap' functions");
476  return false;
477  }
478  return true;
479 }
480 
482 {
483  if (!Context)
484  return false;
485 
486  OpenGLLocker locker(Context);
487  Display* display = glXGetCurrentDisplay();
488  if (!display)
489  return false;
490  int screen = DefaultScreen(display);
491  QByteArray extensions(glXQueryExtensionsString(display, screen));
492  return extensions.contains("GLX_EXT_texture_from_pixmap");
493 }
DUMMY_INTEROP_ID
static constexpr uint64_t DUMMY_INTEROP_ID
Definition: mythinteropgpu.h:18
MythVAAPIInteropGLXPixmap::InitPixmaps
bool InitPixmaps()
Definition: mythvaapiglxinterop.cpp:465
DEINT_DRIVER
@ DEINT_DRIVER
Definition: mythframe.h:75
INIT_ST
#define INIT_ST
Definition: mythvdpauhelper.cpp:12
MythVideoColourSpace::PictureAttributeChanged
void PictureAttributeChanged(PictureAttribute Attribute, int Value)
PictureAttributeSupported
PictureAttributeSupported
Definition: videoouttypes.h:116
MythVAAPIInterop::m_deinterlacer
MythDeintType m_deinterlacer
Definition: mythvaapiinterop.h:76
mythvideoout.h
MythGLTexture::m_texture
QOpenGLTexture * m_texture
Definition: mythrenderopengl.h:66
kPictureAttributeSupported_Colour
@ kPictureAttributeSupported_Colour
Definition: videoouttypes.h:121
DEINT_SHADER
@ DEINT_SHADER
Definition: mythframe.h:74
MythVideoTextureOpenGL
Definition: mythvideotextureopengl.h:21
MythVAAPIInteropGLXPixmap::m_pixmap
Pixmap m_pixmap
Definition: mythvaapiglxinterop.h:65
MythVideoTextureOpenGL::m_planeCount
uint m_planeCount
Definition: mythvideotextureopengl.h:54
MYTH_GLXRELEASETEXIMAGEEXT
void(*)(Display *, GLXDrawable, int) MYTH_GLXRELEASETEXIMAGEEXT
Definition: mythvaapiglxinterop.h:47
MYTH_GLXBINDTEXIMAGEEXT
void(*)(Display *, GLXDrawable, int, int *) MYTH_GLXBINDTEXIMAGEEXT
Definition: mythvaapiglxinterop.h:46
Frame
Definition: zmdefines.h:93
DEINT_NONE
@ DEINT_NONE
Definition: mythframe.h:69
kPictureAttribute_Contrast
@ kPictureAttribute_Contrast
Definition: videoouttypes.h:108
MythVAAPIInteropGLXCopy::MythVAAPIInteropGLXCopy
MythVAAPIInteropGLXCopy(MythPlayerUI *Player, MythRenderOpenGL *Context)
Definition: mythvaapiglxinterop.cpp:214
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
MythVideoColourSpace::SetSupportedAttributes
void SetSupportedAttributes(PictureAttributeSupported Supported)
Enable the given set of picture attributes.
Definition: mythvideocolourspace.cpp:111
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythVideoTextureOpenGL::m_frameFormat
VideoFrameType m_frameFormat
Definition: mythvideotextureopengl.h:52
MythVAAPIInterop::InitaliseDisplay
void InitaliseDisplay(void)
Definition: mythvaapiinterop.cpp:125
kPictureAttributeSupported_None
@ kPictureAttributeSupported_None
Definition: videoouttypes.h:118
MythVAAPIInteropGLXPixmap::Acquire
std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
Definition: mythvaapiglxinterop.cpp:343
MythVAAPIInteropGLXPixmap::m_glxPixmap
GLXPixmap m_glxPixmap
Definition: mythvaapiglxinterop.h:66
kPictureAttributeSupported_Brightness
@ kPictureAttributeSupported_Brightness
Definition: videoouttypes.h:119
DEINT_CPU
@ DEINT_CPU
Definition: mythframe.h:73
MythVAAPIInterop
Definition: mythvaapiinterop.h:48
MythVAAPIInteropGLXPixmap::m_glxReleaseTexImageEXT
MYTH_GLXRELEASETEXIMAGEEXT m_glxReleaseTexImageEXT
Definition: mythvaapiglxinterop.h:68
MythPlayerUI
Definition: mythplayerui.h:10
kPictureAttributeSupported_Contrast
@ kPictureAttributeSupported_Contrast
Definition: videoouttypes.h:120
mythvaapiglxinterop.h
MythVideoColourSpace::GetPictureAttribute
int GetPictureAttribute(PictureAttribute Attribute)
Definition: mythvideocolourspace.cpp:120
kScan_Intr2ndField
@ kScan_Intr2ndField
Definition: videoouttypes.h:99
CHECK_ST
#define CHECK_ST
Definition: mythvdpauhelper.cpp:17
MythOpenGLInterop::m_openglContext
MythRenderOpenGL * m_openglContext
Definition: mythopenglinterop.h:41
MythVAAPIInteropGLXPixmap::MythVAAPIInteropGLXPixmap
MythVAAPIInteropGLXPixmap(MythPlayerUI *Player, MythRenderOpenGL *Context)
Definition: mythvaapiglxinterop.cpp:312
LOC
#define LOC
Definition: mythvaapiglxinterop.cpp:5
MythVAAPIInteropGLXCopy::Acquire
std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
Definition: mythvaapiglxinterop.cpp:246
MythVAAPIInteropGLX::m_vaapiPictureAttributeCount
int m_vaapiPictureAttributeCount
Definition: mythvaapiglxinterop.h:24
MythVAAPIInteropGLX::~MythVAAPIInteropGLX
~MythVAAPIInteropGLX() override
Definition: mythvaapiglxinterop.cpp:12
MythVAAPIInteropGLX::m_vaapiColourSpace
uint m_vaapiColourSpace
Definition: mythvaapiglxinterop.h:25
MythRenderOpenGL::makeCurrent
void makeCurrent()
Definition: mythrenderopengl.cpp:566
MythVAAPIInteropGLXPixmap::m_glxBindTexImageEXT
MYTH_GLXBINDTEXIMAGEEXT m_glxBindTexImageEXT
Definition: mythvaapiglxinterop.h:67
kPictureAttribute_Brightness
@ kPictureAttribute_Brightness
Definition: videoouttypes.h:107
MythVAAPIInteropGLX::m_vaapiPictureAttributes
VADisplayAttribute * m_vaapiPictureAttributes
Definition: mythvaapiglxinterop.h:23
MythVideoTextureOpenGL::DeleteTexture
static void DeleteTexture(MythRenderOpenGL *Context, MythVideoTextureOpenGL *Texture)
Definition: mythvideotextureopengl.cpp:17
uint
unsigned int uint
Definition: compat.h:81
MythVAAPIInteropGLX::InitPictureAttributes
void InitPictureAttributes(MythVideoColourSpace *ColourSpace)
Definition: mythvaapiglxinterop.cpp:89
MythVideoTextureOpenGL::m_plane
uint m_plane
Definition: mythvideotextureopengl.h:53
MythVAAPIInterop::VerifySurface
VASurfaceID VerifySurface(MythRenderOpenGL *Context, MythVideoFrame *Frame)
Definition: mythvaapiinterop.cpp:161
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:103
MythOpenGLInterop::m_openglTextures
QHash< unsigned long long, std::vector< MythVideoTextureOpenGL * > > m_openglTextures
Definition: mythopenglinterop.h:42
MythVAAPIInteropGLXCopy::m_glxSurface
void * m_glxSurface
Definition: mythvaapiglxinterop.h:41
MythRenderOpenGL::doneCurrent
void doneCurrent()
Definition: mythrenderopengl.cpp:574
MythRenderOpenGL
Definition: mythrenderopengl.h:96
MythVAAPIInteropGLXPixmap::~MythVAAPIInteropGLXPixmap
~MythVAAPIInteropGLXPixmap() override
Definition: mythvaapiglxinterop.cpp:323
MythDeintType
MythDeintType
Definition: mythframe.h:67
MythVAAPIInteropGLX::GetFlagsForFrame
uint GetFlagsForFrame(MythVideoFrame *Frame, FrameScanType Scan)
Definition: mythvaapiglxinterop.cpp:17
kScan_Interlaced
@ kScan_Interlaced
Definition: videoouttypes.h:98
MythVAAPIInteropGLXPixmap::IsSupported
static bool IsSupported(MythRenderOpenGL *Context)
Definition: mythvaapiglxinterop.cpp:481
MythVideoFrame::DeinterlacerName
static QString DeinterlacerName(MythDeintType Deint, bool DoubleRate, VideoFrameType Format=FMT_NONE)
Definition: mythframe.cpp:462
kPictureAttributeSupported_Hue
@ kPictureAttributeSupported_Hue
Definition: videoouttypes.h:122
MythVideoTextureOpenGL::m_frameType
VideoFrameType m_frameType
Definition: mythvideotextureopengl.h:51
FMT_VAAPI
@ FMT_VAAPI
Definition: mythframe.h:58
MythVAAPIInterop::Deinterlace
VASurfaceID Deinterlace(MythVideoFrame *Frame, VASurfaceID Current, FrameScanType Scan)
Definition: mythvaapiinterop.cpp:320
MythVAAPIInteropGLX::SetPictureAttribute
int SetPictureAttribute(PictureAttribute Attribute, int Value)
Definition: mythvaapiglxinterop.cpp:157
Player
Definition: zmliveplayer.h:34
MythVideoTextureOpenGL::CreateTexture
static MythVideoTextureOpenGL * CreateTexture(MythRenderOpenGL *Context, QSize Size, GLenum Target=QOpenGLTexture::Target2D, QOpenGLTexture::PixelType PixelType=QOpenGLTexture::UInt8, QOpenGLTexture::PixelFormat PixelFormat=QOpenGLTexture::RGBA, QOpenGLTexture::TextureFormat Format=QOpenGLTexture::NoFormat, QOpenGLTexture::Filter Filter=QOpenGLTexture::Linear, QOpenGLTexture::WrapMode Wrap=QOpenGLTexture::ClampToEdge)
Create and initialise a MythVideoTexture that is backed by a QOpenGLTexture.
Definition: mythvideotextureopengl.cpp:432
MythVideoFrame
Definition: mythframe.h:88
DEINT_BASIC
@ DEINT_BASIC
Definition: mythframe.h:70
MythVAAPIInteropGLX
Definition: mythvaapiglxinterop.h:7
MythInteropGPU::InteropType
InteropType
Definition: mythinteropgpu.h:25
MythInteropGPU::m_textureSize
QSize m_textureSize
Definition: mythinteropgpu.h:62
is_interlaced
bool is_interlaced(FrameScanType Scan)
Definition: videoouttypes.h:188
MythVAAPIInteropGLX::MythVAAPIInteropGLX
MythVAAPIInteropGLX(MythPlayerUI *Player, MythRenderOpenGL *Context, InteropType Type)
Definition: mythvaapiglxinterop.cpp:7
MythVAAPIInteropGLXCopy::~MythVAAPIInteropGLXCopy
~MythVAAPIInteropGLXCopy() override
Definition: mythvaapiglxinterop.cpp:233
kPictureAttribute_Hue
@ kPictureAttribute_Hue
Definition: videoouttypes.h:110
MythVideoColourSpace
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
Definition: mythvideocolourspace.h:18
MythVAAPIInterop::m_vaDisplay
VADisplay m_vaDisplay
Definition: mythvaapiinterop.h:73
MythVideoTextureOpenGL::CreateTextures
static std::vector< MythVideoTextureOpenGL * > CreateTextures(MythRenderOpenGL *Context, VideoFrameType Type, VideoFrameType Format, std::vector< QSize > Sizes, GLenum Target=QOpenGLTexture::Target2D)
Create a set of textures suitable for the given Type and Format.
Definition: mythvideotextureopengl.cpp:57
MythVAAPIInteropGLX::m_basicDeinterlacer
MythDeintType m_basicDeinterlacer
Definition: mythvaapiglxinterop.h:26
FMT_RGBA32
@ FMT_RGBA32
Definition: mythframe.h:35
kPictureAttribute_Colour
@ kPictureAttribute_Colour
Definition: videoouttypes.h:109
OpenGLLocker
Definition: mythrenderopengl.h:255