MythTV  master
mythvaapidrminterop.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "mythcorecontext.h"
3 #include "mythvideocolourspace.h"
4 #include "fourcc.h"
6 
7 // FFmpeg
8 extern "C" {
9 #include "libavutil/hwcontext_drm.h"
10 }
11 
12 // Std
13 #include <unistd.h>
14 
15 #define LOC QString("VAAPIDRM: ")
16 
18  : MythVAAPIInterop(Player, Context, Type),
19  MythEGLDMABUF(Context)
20 {
21  QString device = gCoreContext->GetSetting("VAAPIDevice");
22  if (device.isEmpty())
23  device = "/dev/dri/renderD128";
24  m_drmFile.setFileName(device);
25  if (m_drmFile.open(QIODevice::ReadWrite))
26  {
27  m_vaDisplay = vaGetDisplayDRM(m_drmFile.handle());
28  if (!m_vaDisplay)
29  {
30  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to create DRM VADisplay");
31  return;
32  }
33  }
34  else
35  {
36  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Failed to open %1").arg(device));
37  return;
38  }
40 
41  // DRM PRIME is preferred as it explicitly sets the fourcc's for each layer -
42  // so we don't have to guess. But it is not available with older libva and
43  // there are reports it does not work with some Radeon drivers
45  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Using %1 for interop")
46  .arg(m_usePrime ? "DRM PRIME" : "VAAPI handle"));
47 }
48 
50 {
51 #ifdef USING_DRM_VIDEO
52  delete m_drm;
53 #endif
59  if (m_drmFile.isOpen())
60  m_drmFile.close();
61 }
62 
64 {
66 
67  if (!m_openglTextures.isEmpty() && m_openglContext->IsEGL())
68  {
69  int count = 0;
70  for (auto it = m_openglTextures.constBegin() ; it != m_openglTextures.constEnd(); ++it)
71  {
72  vector<MythVideoTextureOpenGL*> textures = it.value();
73  for (auto & texture : textures)
74  {
75  if (texture->m_data)
76  {
78  texture->m_data = nullptr;
79  count++;
80  }
81  }
82  }
83  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Deleted %1 EGL images in %2 groups")
84  .arg(count).arg(m_openglTextures.size()));
85  }
86 
88 }
89 
91 {
92  if (m_filterGraph)
93  {
94  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Deleting deinterlacer frame cache");
97  }
99 }
100 
102 {
103  // remove the old, non-deinterlaced frame cache
104  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Deleting progressive frame cache");
105  DeleteTextures();
106  CleanupDRMPRIME();
107 }
108 
110 {
111  while (!m_referenceFrames.isEmpty())
112  {
113  AVBufferRef* ref = m_referenceFrames.takeLast();
114  av_buffer_unref(&ref);
115  }
116 }
117 
119 {
120  if (!Buffer)
121  return;
122 
123  // don't retain twice for double rate
124  if (!m_referenceFrames.empty() &&
125  (static_cast<VASurfaceID>(reinterpret_cast<uintptr_t>(m_referenceFrames[0]->data)) ==
126  static_cast<VASurfaceID>(reinterpret_cast<uintptr_t>(Buffer->data))))
127  {
128  return;
129  }
130 
131  m_referenceFrames.push_front(av_buffer_ref(Buffer));
132 
133  // release old frames
134  while (m_referenceFrames.size() > 3)
135  {
136  AVBufferRef* ref = m_referenceFrames.takeLast();
137  av_buffer_unref(&ref);
138  }
139 }
140 
141 vector<MythVideoTextureOpenGL*> MythVAAPIInteropDRM::GetReferenceFrames()
142 {
143  vector<MythVideoTextureOpenGL*> result;
144  int size = m_referenceFrames.size();
145  if (size < 1)
146  return result;
147 
148  auto next = static_cast<VASurfaceID>(reinterpret_cast<uintptr_t>(m_referenceFrames[0]->data));
149  auto current = static_cast<VASurfaceID>(reinterpret_cast<uintptr_t>(m_referenceFrames[size > 1 ? 1 : 0]->data));
150  auto last = static_cast<VASurfaceID>(reinterpret_cast<uintptr_t>(m_referenceFrames[size > 2 ? 2 : 0]->data));
151 
152  if (!m_openglTextures.contains(next) || !m_openglTextures.contains(current) ||
153  !m_openglTextures.contains(last))
154  {
155  LOG(VB_GENERAL, LOG_ERR, LOC + "Reference frame error");
156  return result;
157  }
158 
159  std::copy(m_openglTextures[last].cbegin(), m_openglTextures[last].cend(), std::back_inserter(result));
160  std::copy(m_openglTextures[current].cbegin(), m_openglTextures[current].cend(), std::back_inserter(result));
161  std::copy(m_openglTextures[next].cbegin(), m_openglTextures[next].cend(), std::back_inserter(result));
162  return result;
163 }
164 
165 vector<MythVideoTextureOpenGL*> MythVAAPIInteropDRM::Acquire(MythRenderOpenGL* Context,
166  MythVideoColourSpace* ColourSpace,
168  FrameScanType Scan)
169 {
170  vector<MythVideoTextureOpenGL*> result;
171  if (!Frame)
172  return result;
173 
174  VASurfaceID id = VerifySurface(Context, Frame);
175  if (!id || !m_vaDisplay)
176  return result;
177 
178  // Update frame colourspace and initialise on first frame
179  if (ColourSpace)
180  {
181  if (m_openglTextures.isEmpty())
183  ColourSpace->UpdateColourSpace(Frame);
184  }
185 
186  // Deinterlacing
187  bool needreferenceframes = false;
188  auto discontinuity = qAbs(Frame->m_frameCounter - m_discontinuityCounter) > 1;
189 
190  if (is_interlaced(Scan))
191  {
192  // allow GLSL deinterlacers
193  Frame->m_deinterlaceAllowed = Frame->m_deinterlaceAllowed | DEINT_SHADER;
194 
195  // is GLSL preferred - and if so do we need reference frames
196  bool glsldeint = false;
197 
198  // we explicitly use a shader if preferred over driver. If CPU only
199  // is preferred, the default will be to use the driver instead and if that
200  // fails we fall back to GLSL
201  MythDeintType shader = Frame->GetDoubleRateOption(DEINT_SHADER);
202  MythDeintType driver = Frame->GetDoubleRateOption(DEINT_DRIVER);
203  if (m_filterError)
204  shader = Frame->GetDoubleRateOption(DEINT_SHADER | DEINT_CPU | DEINT_DRIVER, DEINT_ALL);
205  if (shader && !driver)
206  {
207  glsldeint = true;
208  needreferenceframes = shader == DEINT_HIGH;
209  Frame->m_deinterlaceDouble = Frame->m_deinterlaceDouble | DEINT_SHADER;
210  }
211  else if (!shader && !driver) // singlerate
212  {
213  shader = Frame->GetSingleRateOption(DEINT_SHADER);
214  driver = Frame->GetSingleRateOption(DEINT_DRIVER);
215  if (m_filterError)
216  shader = Frame->GetSingleRateOption(DEINT_SHADER | DEINT_CPU | DEINT_DRIVER, DEINT_ALL);
217  if (shader && !driver)
218  {
219  glsldeint = true;
220  needreferenceframes = shader == DEINT_HIGH;
221  Frame->m_deinterlaceSingle = Frame->m_deinterlaceSingle | DEINT_SHADER;
222  }
223  }
224 
225  // driver deinterlacing
226  if (!glsldeint)
227  {
228  if (discontinuity)
230  id = Deinterlace(Frame, id, Scan);
231  }
232 
233  // fallback to shaders if VAAPI deints fail
234  if (m_filterError)
235  Frame->m_deinterlaceAllowed = Frame->m_deinterlaceAllowed & ~DEINT_DRIVER;
236  }
237  else if (m_deinterlacer)
238  {
240  }
241 
242  if (needreferenceframes)
243  {
244  if (discontinuity)
246  RotateReferenceFrames(reinterpret_cast<AVBufferRef*>(Frame->m_priv[0]));
247  }
248  else
249  {
251  }
252  m_discontinuityCounter = Frame->m_frameCounter;
253 
254 #ifdef USING_DRM_VIDEO
255  if (!m_drmTriedAndFailed)
256  if (HandleDRMVideo(ColourSpace, id, Frame))
257  return result;
258 #endif
259 
260  // return cached texture if available
261  if (m_openglTextures.contains(id))
262  {
263  if (needreferenceframes)
264  return GetReferenceFrames();
265  return m_openglTextures[id];
266  }
267 
269  result = m_usePrime ? AcquirePrime(id, Context, Frame): AcquireVAAPI(id, Context, Frame);
270  m_openglTextures.insert(id, result);
271  if (needreferenceframes)
272  return GetReferenceFrames();
273  return result;
274 }
275 
276 #ifndef DRM_FORMAT_R8
277 #define MKTAG2(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | (static_cast<unsigned>(d) << 24))
278 #define DRM_FORMAT_R8 MKTAG2('R', '8', ' ', ' ')
279 #define DRM_FORMAT_GR88 MKTAG2('G', 'R', '8', '8')
280 #define DRM_FORMAT_R16 MKTAG2('R', '1', '6', ' ')
281 #define DRM_FORMAT_GR1616 MKTAG2('G', 'R', '3', '2')
282 #endif
283 
284 vector<MythVideoTextureOpenGL*> MythVAAPIInteropDRM::AcquireVAAPI(VASurfaceID Id,
285  MythRenderOpenGL* Context,
287 {
288  vector<MythVideoTextureOpenGL*> result;
289 
290  VAImage vaimage;
291  memset(&vaimage, 0, sizeof(vaimage));
292  vaimage.buf = vaimage.image_id = VA_INVALID_ID;
293  INIT_ST;
294  va_status = vaDeriveImage(m_vaDisplay, Id, &vaimage);
295  CHECK_ST;
296  uint numplanes = vaimage.num_planes;
297 
298  VABufferInfo vabufferinfo;
299  memset(&vabufferinfo, 0, sizeof(vabufferinfo));
300  vabufferinfo.mem_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
301  va_status = vaAcquireBufferHandle(m_vaDisplay, vaimage.buf, &vabufferinfo);
302  CHECK_ST;
303 
304  VideoFrameType format = VATypeToMythType(vaimage.format.fourcc);
305  if (format == FMT_NONE)
306  {
307  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Unsupported VA fourcc: %1")
308  .arg(fourcc_str(static_cast<int32_t>(vaimage.format.fourcc))));
309  }
310  else
311  {
312  if (numplanes != MythVideoFrame::GetNumPlanes(format))
313  {
314  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Inconsistent plane count %1 != %2")
315  .arg(numplanes).arg(MythVideoFrame::GetNumPlanes(format)));
316  }
317  else
318  {
319  AVDRMFrameDescriptor drmdesc;
320  memset(&drmdesc, 0, sizeof(drmdesc));
321  drmdesc.nb_objects = 1;
322  drmdesc.nb_layers = static_cast<int>(numplanes);
323  drmdesc.objects[0].fd = static_cast<int>(vabufferinfo.handle);
324  drmdesc.objects[0].size = 0;
325  drmdesc.objects[0].format_modifier = 0;
326 
327  for (uint i = 0; i < numplanes; ++i)
328  {
329  uint32_t fourcc = (format == FMT_P010) ? DRM_FORMAT_R16 : DRM_FORMAT_R8;
330  if (i > 0)
331  fourcc = (format == FMT_P010) ? DRM_FORMAT_GR1616 : DRM_FORMAT_GR88;
332  drmdesc.layers[i].nb_planes = 1;
333  drmdesc.layers[i].format = fourcc;
334  drmdesc.layers[i].planes[0].object_index = 0;
335  drmdesc.layers[i].planes[0].pitch = vaimage.pitches[i];
336  drmdesc.layers[i].planes[0].offset = vaimage.offsets[i];
337  }
338 
339  result = CreateTextures(&drmdesc, Context, Frame, false);
340  }
341  }
342 
343  va_status = vaReleaseBufferHandle(m_vaDisplay, vaimage.buf);
344  CHECK_ST;
345  va_status = vaDestroyImage(m_vaDisplay, vaimage.image_id);
346  CHECK_ST;
347 
348  return result;
349 }
350 
352 {
353  switch (Fourcc)
354  {
355  case VA_FOURCC_IYUV:
356  case VA_FOURCC_I420: return FMT_YV12;
357  case VA_FOURCC_NV12: return FMT_NV12;
358  case VA_FOURCC_YUY2:
359  case VA_FOURCC_UYVY: return FMT_YUY2;
360 #if defined (VA_FOURCC_P010)
361  case VA_FOURCC_P010: return FMT_P010;
362 #endif
363 #if defined (VA_FOURCC_P016)
364  case VA_FOURCC_P016: return FMT_P016;
365 #endif
366  case VA_FOURCC_ARGB: return FMT_ARGB32;
367  case VA_FOURCC_RGBA: return FMT_RGBA32;
368  }
369  return FMT_NONE;
370 }
371 
373 {
374  return HaveDMABuf(Context);
375 }
376 
377 #if VA_CHECK_VERSION(1, 1, 0)
378 static inline void VADRMtoPRIME(VADRMPRIMESurfaceDescriptor* VaDRM, AVDRMFrameDescriptor* Prime)
379 {
380  Prime->nb_objects = static_cast<int>(VaDRM->num_objects);
381  for (uint i = 0; i < VaDRM->num_objects; i++)
382  {
383  Prime->objects[i].fd = VaDRM->objects[i].fd;
384  Prime->objects[i].size = VaDRM->objects[i].size;
385  Prime->objects[i].format_modifier = VaDRM->objects[i].drm_format_modifier;
386  }
387  Prime->nb_layers = static_cast<int>(VaDRM->num_layers);
388  for (uint i = 0; i < VaDRM->num_layers; i++)
389  {
390  Prime->layers[i].format = VaDRM->layers[i].drm_format;
391  Prime->layers[i].nb_planes = static_cast<int>(VaDRM->layers[i].num_planes);
392  for (uint j = 0; j < VaDRM->layers[i].num_planes; j++)
393  {
394  Prime->layers[i].planes[j].object_index = static_cast<int>(VaDRM->layers[i].object_index[j]);
395  Prime->layers[i].planes[j].offset = VaDRM->layers[i].offset[j];
396  Prime->layers[i].planes[j].pitch = VaDRM->layers[i].pitch[j];
397  }
398  }
399 }
400 #endif
401 
407 vector<MythVideoTextureOpenGL*> MythVAAPIInteropDRM::AcquirePrime(VASurfaceID Id,
408  MythRenderOpenGL* Context,
410 {
411  vector<MythVideoTextureOpenGL*> result;
412 
413 #if VA_CHECK_VERSION(1, 1, 0)
414  if (!m_drmFrames.contains(Id))
415  m_drmFrames.insert(Id, GetDRMFrameDescriptor(Id));
416  if (!m_drmFrames.contains(Id))
417  return result;
418  result = CreateTextures(m_drmFrames[Id], Context, Frame, false);
419 #else
420  (void)Id;
421  (void)Context;
422  (void)Frame;
423 #endif
424  return result;
425 }
426 
427 AVDRMFrameDescriptor* MythVAAPIInteropDRM::GetDRMFrameDescriptor(VASurfaceID Id)
428 {
429 #if VA_CHECK_VERSION(1, 1, 0)
430  INIT_ST;
431  uint32_t exportflags = VA_EXPORT_SURFACE_SEPARATE_LAYERS | VA_EXPORT_SURFACE_READ_ONLY;
432  VADRMPRIMESurfaceDescriptor vadesc;
433  va_status = vaExportSurfaceHandle(m_vaDisplay, Id,
434  VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
435  exportflags, &vadesc);
436  CHECK_ST;
437 
438  auto * drmdesc = reinterpret_cast<AVDRMFrameDescriptor*>(av_mallocz(sizeof(AVDRMFrameDescriptor)));
439  VADRMtoPRIME(&vadesc, drmdesc);
440  return drmdesc;
441 #else
442  (void)Id;
443  return nullptr;
444 #endif
445 }
446 
448 {
449  if (m_drmFrames.isEmpty())
450  return;
451 
452  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Releasing %1 DRM descriptors").arg(m_drmFrames.size()));
453  for (auto * frame : qAsConst(m_drmFrames))
454  {
455  for (int i = 0; i < frame->nb_objects; i++)
456  close(frame->objects[i].fd);
457  av_freep(&frame);
458  }
459  m_drmFrames.clear();
460 }
461 
463 {
464 #if VA_CHECK_VERSION(1, 1, 0)
465  static bool s_supported = false;
466  static bool s_checked = false;
467 
468  if (s_checked)
469  return s_supported;
470  s_checked = true;
471 
473 
474  VASurfaceID surface = 0;
475 
476  VASurfaceAttrib attribs = {};
477  attribs.flags = VA_SURFACE_ATTRIB_SETTABLE;
478  attribs.type = VASurfaceAttribPixelFormat;
479  attribs.value.type = VAGenericValueTypeInteger;
480  attribs.value.value.i = VA_FOURCC_NV12;
481 
482  if (vaCreateSurfaces(m_vaDisplay, VA_RT_FORMAT_YUV420, 1920, 1080,
483  &surface, 1, &attribs, 1) == VA_STATUS_SUCCESS)
484  {
485  VADRMPRIMESurfaceDescriptor vadesc;
486  VAStatus status = vaExportSurfaceHandle(m_vaDisplay, surface, VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
487  VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS,
488  &vadesc);
489  if (status == VA_STATUS_SUCCESS)
490  {
491  MythVideoFrame frame(FMT_DRMPRIME, nullptr, 0, 1920, 1080);
492  frame.m_swPixFmt = AV_PIX_FMT_NV12;
493  AVDRMFrameDescriptor drmdesc;
494  memset(&drmdesc, 0, sizeof(drmdesc));
495  VADRMtoPRIME(&vadesc, &drmdesc);
496  vector<MythVideoTextureOpenGL*> textures =
497  CreateTextures(&drmdesc, m_openglContext, &frame, false);
498 
499  if (!textures.empty())
500  {
501  s_supported = true;
502  for (auto & texture : textures)
503  s_supported &= texture->m_data && (texture->m_textureId != 0U);
505  }
506  for (uint32_t i = 0; i < vadesc.num_objects; ++i)
507  close(vadesc.objects[i].fd);
508  }
509  vaDestroySurfaces(m_vaDisplay, &surface, 1);
510  }
511  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("VAAPI DRM PRIME interop is %1supported")
512  .arg(s_supported ? "" : "not "));
513  return s_supported;
514 #else
515  return false;
516 #endif
517 }
518 
519 #ifdef USING_DRM_VIDEO
520 bool MythVAAPIInteropDRM::HandleDRMVideo(MythVideoColourSpace* ColourSpace, VASurfaceID Id, MythVideoFrame* Frame)
521 {
522  if (!((m_type == DRM_DRMPRIME) && m_usePrime && Id && Frame && ColourSpace))
523  return false;
524 
525  if (!m_drm)
526  m_drm = new MythVideoDRM(ColourSpace);
527 
528  if (m_drm)
529  {
530  if (m_drm->IsValid())
531  {
532  if (!m_drmFrames.contains(Id))
533  m_drmFrames.insert(Id, GetDRMFrameDescriptor(Id));
534  if (m_drm->RenderFrame(m_drmFrames[Id], Frame))
535  return true;
536  }
537 
538  // RenderFrame may have decided we should give up
539  if (!m_drm->IsValid())
540  {
541  LOG(VB_GENERAL, LOG_INFO, LOC + "Disabling DRM video");
542  m_drmTriedAndFailed = true;
543  delete m_drm;
544  m_drm = nullptr;
545  }
546  }
547  return false;
548 }
549 #endif
DEINT_DRIVER
@ DEINT_DRIVER
Definition: mythframe.h:75
INIT_ST
#define INIT_ST
Definition: mythvdpauhelper.cpp:12
MythVAAPIInteropDRM::Acquire
vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
Definition: mythvaapidrminterop.cpp:165
copy
long long copy(QFile &dst, QFile &src, uint block_size)
Copies src file to dst file.
Definition: mythmiscutil.cpp:314
MythVAAPIInterop::m_deinterlacer
MythDeintType m_deinterlacer
Definition: mythvaapiinterop.h:72
MythVAAPIInteropDRM::VATypeToMythType
static VideoFrameType VATypeToMythType(uint32_t Fourcc)
Definition: mythvaapidrminterop.cpp:351
MythInteropGPU::m_type
InteropType m_type
Definition: mythinteropgpu.h:68
DEINT_SHADER
@ DEINT_SHADER
Definition: mythframe.h:74
FMT_DRMPRIME
@ FMT_DRMPRIME
Definition: mythframe.h:64
DRM_FORMAT_GR1616
#define DRM_FORMAT_GR1616
Definition: mythvaapidrminterop.cpp:281
MythEGL::GetEGLDisplay
void * GetEGLDisplay(void)
Definition: mythegl.cpp:80
MythVAAPIInteropDRM::PostInitDeinterlacer
void PostInitDeinterlacer() override
Definition: mythvaapidrminterop.cpp:101
Frame
Definition: zmdefines.h:93
FMT_P010
@ FMT_P010
Definition: mythframe.h:54
MythVideoColourSpace::UpdateColourSpace
bool UpdateColourSpace(const MythVideoFrame *Frame)
Set the current colourspace to use.
Definition: mythvideocolourspace.cpp:321
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
MythVAAPIInteropDRM::GetDRMFrameDescriptor
AVDRMFrameDescriptor * GetDRMFrameDescriptor(VASurfaceID Id)
Definition: mythvaapidrminterop.cpp:427
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:23
MythVAAPIInteropDRM::AcquirePrime
vector< MythVideoTextureOpenGL * > AcquirePrime(VASurfaceID Id, MythRenderOpenGL *Context, MythVideoFrame *Frame)
Export the given VideoFrame as a DRM PRIME descriptor.
Definition: mythvaapidrminterop.cpp:407
MythEGLDMABUF
Definition: mythegldmabuf.h:15
DEINT_ALL
@ DEINT_ALL
Definition: mythframe.h:76
MythVAAPIInteropDRM::DestroyDeinterlacer
void DestroyDeinterlacer() override
Definition: mythvaapidrminterop.cpp:90
MythVAAPIInterop::InitaliseDisplay
void InitaliseDisplay(void)
Definition: mythvaapiinterop.cpp:125
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
MythEGLDMABUF::HaveDMABuf
static bool HaveDMABuf(MythRenderOpenGL *Context)
Definition: mythegldmabuf.cpp:25
MythEGL::eglDestroyImageKHR
void eglDestroyImageKHR(void *Disp, void *Image)
Definition: mythegl.cpp:160
MythVAAPIInterop::DestroyDeinterlacer
virtual void DestroyDeinterlacer(void)
Definition: mythvaapiinterop.cpp:145
close
#define close
Definition: compat.h:17
FMT_NONE
@ FMT_NONE
Definition: mythframe.h:22
DEINT_CPU
@ DEINT_CPU
Definition: mythframe.h:73
MythVAAPIInterop
Definition: mythvaapiinterop.h:44
MythPlayerUI
Definition: mythplayerui.h:10
MythVAAPIInteropDRM::m_drmFile
QFile m_drmFile
Definition: mythvaapidrminterop.h:37
mythvideocolourspace.h
CHECK_ST
#define CHECK_ST
Definition: mythvdpauhelper.cpp:16
DRM_FORMAT_R8
#define DRM_FORMAT_R8
Definition: mythvaapidrminterop.cpp:278
MythEGLDMABUF::CreateTextures
std::vector< MythVideoTextureOpenGL * > CreateTextures(AVDRMFrameDescriptor *Desc, MythRenderOpenGL *Context, MythVideoFrame *Frame, bool UseSeparate, FrameScanType Scan=kScan_Progressive)
Definition: mythegldmabuf.cpp:364
MythOpenGLInterop::m_openglTextures
QHash< unsigned long long, vector< MythVideoTextureOpenGL * > > m_openglTextures
Definition: mythopenglinterop.h:39
MythOpenGLInterop::m_openglContext
MythRenderOpenGL * m_openglContext
Definition: mythopenglinterop.h:38
MythVAAPIInteropDRM::m_referenceFrames
QVector< AVBufferRef * > m_referenceFrames
Definition: mythvaapidrminterop.h:38
FMT_YV12
@ FMT_YV12
Definition: mythframe.h:24
MythVAAPIInteropDRM::TestPrimeInterop
bool TestPrimeInterop()
Definition: mythvaapidrminterop.cpp:462
MythVAAPIInteropDRM::DeleteTextures
void DeleteTextures() override
Definition: mythvaapidrminterop.cpp:63
MythVAAPIInteropDRM::GetReferenceFrames
vector< MythVideoTextureOpenGL * > GetReferenceFrames()
Definition: mythvaapidrminterop.cpp:141
MythVideoDRM
Definition: mythvideodrm.h:14
MythEGL::IsEGL
bool IsEGL(void)
Definition: mythegl.cpp:29
VA_FOURCC_I420
#define VA_FOURCC_I420
Definition: mythvaapiinterop.h:30
DRM_FORMAT_R16
#define DRM_FORMAT_R16
Definition: mythvaapidrminterop.cpp:280
MythVAAPIInteropDRM::m_drmFrames
QHash< unsigned long long, AVDRMFrameDescriptor * > m_drmFrames
Definition: mythvaapidrminterop.h:48
uint
unsigned int uint
Definition: compat.h:144
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MythVAAPIInteropDRM::CleanupDRMPRIME
void CleanupDRMPRIME()
Definition: mythvaapidrminterop.cpp:447
mythvaapidrminterop.h
FMT_ARGB32
@ FMT_ARGB32
Definition: mythframe.h:34
ALL_PICTURE_ATTRIBUTES
#define ALL_PICTURE_ATTRIBUTES
Definition: videoouttypes.h:127
MythVAAPIInterop::VerifySurface
VASurfaceID VerifySurface(MythRenderOpenGL *Context, MythVideoFrame *Frame)
Definition: mythvaapiinterop.cpp:161
MythVAAPIInterop::m_filterError
bool m_filterError
Definition: mythvaapiinterop.h:79
DRM_FORMAT_GR88
#define DRM_FORMAT_GR88
Definition: mythvaapidrminterop.cpp:279
MythVAAPIInteropDRM::~MythVAAPIInteropDRM
~MythVAAPIInteropDRM() override
Definition: mythvaapidrminterop.cpp:49
MythVAAPIInterop::m_filterGraph
AVFilterGraph * m_filterGraph
Definition: mythvaapiinterop.h:78
MythRenderOpenGL
Definition: mythrenderopengl.h:99
MythVAAPIInteropDRM::CleanupReferenceFrames
void CleanupReferenceFrames()
Definition: mythvaapidrminterop.cpp:109
MythDeintType
MythDeintType
Definition: mythframe.h:67
Buffer
Definition: MythExternControl.h:36
MythVAAPIInteropDRM::IsSupported
static bool IsSupported(MythRenderOpenGL *Context)
Definition: mythvaapidrminterop.cpp:372
MythVAAPIInteropDRM::m_usePrime
bool m_usePrime
Definition: mythvaapidrminterop.h:47
mythcorecontext.h
FMT_YUY2
@ FMT_YUY2
Definition: mythframe.h:51
MythOpenGLInterop::DeleteTextures
virtual void DeleteTextures()
Definition: mythopenglinterop.cpp:135
MythVideoFrame::m_swPixFmt
int m_swPixFmt
Definition: mythframe.h:145
DEINT_HIGH
@ DEINT_HIGH
Definition: mythframe.h:72
MythEGLDMABUF::ClearDMATextures
static void ClearDMATextures(MythRenderOpenGL *Context, std::vector< MythVideoTextureOpenGL * > &Textures)
Definition: mythegldmabuf.cpp:349
MythInteropGPU::m_discontinuityCounter
uint64_t m_discontinuityCounter
Definition: mythinteropgpu.h:64
fourcc_str
static const char * fourcc_str(int i)
Definition: fourcc.h:26
MythInteropGPU::DRM_DRMPRIME
@ DRM_DRMPRIME
Definition: mythinteropgpu.h:39
MythVideoFrame::GetNumPlanes
static uint GetNumPlanes(VideoFrameType Type)
Definition: mythframe.h:214
MythVAAPIInteropDRM::RotateReferenceFrames
void RotateReferenceFrames(AVBufferRef *Buffer)
Definition: mythvaapidrminterop.cpp:118
VideoFrameType
VideoFrameType
Definition: mythframe.h:20
MythVAAPIInterop::Deinterlace
VASurfaceID Deinterlace(MythVideoFrame *Frame, VASurfaceID Current, FrameScanType Scan)
Definition: mythvaapiinterop.cpp:320
MythVAAPIInteropDRM::AcquireVAAPI
vector< MythVideoTextureOpenGL * > AcquireVAAPI(VASurfaceID Id, MythRenderOpenGL *Context, MythVideoFrame *Frame)
Definition: mythvaapidrminterop.cpp:284
Player
Definition: zmliveplayer.h:34
MythVideoFrame
Definition: mythframe.h:88
FMT_NV12
@ FMT_NV12
Definition: mythframe.h:53
MythInteropGPU::InteropType
InteropType
Definition: mythinteropgpu.h:26
FMT_P016
@ FMT_P016
Definition: mythframe.h:55
MythVAAPIInteropDRM::MythVAAPIInteropDRM
MythVAAPIInteropDRM(MythPlayerUI *Player, MythRenderOpenGL *Context, InteropType Type)
Definition: mythvaapidrminterop.cpp:17
is_interlaced
bool is_interlaced(FrameScanType Scan)
Definition: videoouttypes.h:188
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:69
LOC
#define LOC
Definition: mythvaapidrminterop.cpp:15
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:922
fourcc.h
FMT_RGBA32
@ FMT_RGBA32
Definition: mythframe.h:35
OpenGLLocker
Definition: mythrenderopengl.h:261