MythTV  master
mythvaapidrminterop.cpp
Go to the documentation of this file.
1 // MythTV
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  std::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 std::vector<MythVideoTextureOpenGL*> MythVAAPIInteropDRM::GetReferenceFrames()
142 {
143  std::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 std::vector<MythVideoTextureOpenGL*>
167  MythVideoColourSpace* ColourSpace,
169  FrameScanType Scan)
170 {
171  std::vector<MythVideoTextureOpenGL*> result;
172  if (!Frame)
173  return result;
174 
175  VASurfaceID id = VerifySurface(Context, Frame);
176  if (!id || !m_vaDisplay)
177  return result;
178 
179  // Update frame colourspace and initialise on first frame
180  if (ColourSpace)
181  {
182  if (m_openglTextures.isEmpty())
184  ColourSpace->UpdateColourSpace(Frame);
185  }
186 
187  // Deinterlacing
188  bool needreferenceframes = false;
189  auto discontinuity = qAbs(Frame->m_frameCounter - m_discontinuityCounter) > 1;
190 
191  if (is_interlaced(Scan))
192  {
193  // allow GLSL deinterlacers
194  Frame->m_deinterlaceAllowed = Frame->m_deinterlaceAllowed | DEINT_SHADER;
195 
196  // is GLSL preferred - and if so do we need reference frames
197  bool glsldeint = false;
198 
199  // we explicitly use a shader if preferred over driver. If CPU only
200  // is preferred, the default will be to use the driver instead and if that
201  // fails we fall back to GLSL
202  MythDeintType shader = Frame->GetDoubleRateOption(DEINT_SHADER);
203  MythDeintType driver = Frame->GetDoubleRateOption(DEINT_DRIVER);
204  if (m_filterError)
205  shader = Frame->GetDoubleRateOption(DEINT_SHADER | DEINT_CPU | DEINT_DRIVER, DEINT_ALL);
206  if (shader && !driver)
207  {
208  glsldeint = true;
209  needreferenceframes = shader == DEINT_HIGH;
210  Frame->m_deinterlaceDouble = Frame->m_deinterlaceDouble | DEINT_SHADER;
211  }
212  else if (!shader && !driver) // singlerate
213  {
214  shader = Frame->GetSingleRateOption(DEINT_SHADER);
215  driver = Frame->GetSingleRateOption(DEINT_DRIVER);
216  if (m_filterError)
217  shader = Frame->GetSingleRateOption(DEINT_SHADER | DEINT_CPU | DEINT_DRIVER, DEINT_ALL);
218  if (shader && !driver)
219  {
220  glsldeint = true;
221  needreferenceframes = shader == DEINT_HIGH;
222  Frame->m_deinterlaceSingle = Frame->m_deinterlaceSingle | DEINT_SHADER;
223  }
224  }
225 
226  // driver deinterlacing
227  if (!glsldeint)
228  {
229  if (discontinuity)
231  id = Deinterlace(Frame, id, Scan);
232  }
233 
234  // fallback to shaders if VAAPI deints fail
235  if (m_filterError)
236  Frame->m_deinterlaceAllowed = Frame->m_deinterlaceAllowed & ~DEINT_DRIVER;
237  }
238  else if (m_deinterlacer)
239  {
241  }
242 
243  if (needreferenceframes)
244  {
245  if (discontinuity)
247  RotateReferenceFrames(reinterpret_cast<AVBufferRef*>(Frame->m_priv[0]));
248  }
249  else
250  {
252  }
253  m_discontinuityCounter = Frame->m_frameCounter;
254 
255 #ifdef USING_DRM_VIDEO
256  if (!m_drmTriedAndFailed)
257  if (HandleDRMVideo(ColourSpace, id, Frame))
258  return result;
259 #endif
260 
261  // return cached texture if available
262  if (m_openglTextures.contains(id))
263  {
264  if (needreferenceframes)
265  return GetReferenceFrames();
266  return m_openglTextures[id];
267  }
268 
270  result = m_usePrime ? AcquirePrime(id, Context, Frame): AcquireVAAPI(id, Context, Frame);
271  m_openglTextures.insert(id, result);
272  if (needreferenceframes)
273  return GetReferenceFrames();
274  return result;
275 }
276 
277 #ifndef DRM_FORMAT_R8
278 #define MKTAG2(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | (static_cast<unsigned>(d) << 24))
279 #define DRM_FORMAT_R8 MKTAG2('R', '8', ' ', ' ')
280 #define DRM_FORMAT_GR88 MKTAG2('G', 'R', '8', '8')
281 #define DRM_FORMAT_R16 MKTAG2('R', '1', '6', ' ')
282 #define DRM_FORMAT_GR1616 MKTAG2('G', 'R', '3', '2')
283 #endif
284 
285 std::vector<MythVideoTextureOpenGL*>
287  MythRenderOpenGL* Context,
289 {
290  std::vector<MythVideoTextureOpenGL*> result;
291 
292  VAImage vaimage;
293  memset(&vaimage, 0, sizeof(vaimage));
294  vaimage.buf = vaimage.image_id = VA_INVALID_ID;
295  INIT_ST;
296  va_status = vaDeriveImage(m_vaDisplay, Id, &vaimage);
297  CHECK_ST;
298  uint numplanes = vaimage.num_planes;
299 
300  VABufferInfo vabufferinfo;
301  memset(&vabufferinfo, 0, sizeof(vabufferinfo));
302  vabufferinfo.mem_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
303  va_status = vaAcquireBufferHandle(m_vaDisplay, vaimage.buf, &vabufferinfo);
304  CHECK_ST;
305 
306  VideoFrameType format = VATypeToMythType(vaimage.format.fourcc);
307  if (format == FMT_NONE)
308  {
309  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Unsupported VA fourcc: %1")
310  .arg(fourcc_str(static_cast<int32_t>(vaimage.format.fourcc))));
311  }
312  else
313  {
314  if (numplanes != MythVideoFrame::GetNumPlanes(format))
315  {
316  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Inconsistent plane count %1 != %2")
317  .arg(numplanes).arg(MythVideoFrame::GetNumPlanes(format)));
318  }
319  else
320  {
321  AVDRMFrameDescriptor drmdesc;
322  memset(&drmdesc, 0, sizeof(drmdesc));
323  drmdesc.nb_objects = 1;
324  drmdesc.nb_layers = static_cast<int>(numplanes);
325  drmdesc.objects[0].fd = static_cast<int>(vabufferinfo.handle);
326  drmdesc.objects[0].size = 0;
327  drmdesc.objects[0].format_modifier = 0;
328 
329  for (uint i = 0; i < numplanes; ++i)
330  {
331  uint32_t fourcc = (format == FMT_P010) ? DRM_FORMAT_R16 : DRM_FORMAT_R8;
332  if (i > 0)
333  fourcc = (format == FMT_P010) ? DRM_FORMAT_GR1616 : DRM_FORMAT_GR88;
334  drmdesc.layers[i].nb_planes = 1;
335  drmdesc.layers[i].format = fourcc;
336  drmdesc.layers[i].planes[0].object_index = 0;
337  drmdesc.layers[i].planes[0].pitch = vaimage.pitches[i];
338  drmdesc.layers[i].planes[0].offset = vaimage.offsets[i];
339  }
340 
341  result = CreateTextures(&drmdesc, Context, Frame, false);
342  }
343  }
344 
345  va_status = vaReleaseBufferHandle(m_vaDisplay, vaimage.buf);
346  CHECK_ST;
347  va_status = vaDestroyImage(m_vaDisplay, vaimage.image_id);
348  CHECK_ST;
349 
350  return result;
351 }
352 
354 {
355  switch (Fourcc)
356  {
357  case VA_FOURCC_IYUV:
358  case VA_FOURCC_I420: return FMT_YV12;
359  case VA_FOURCC_NV12: return FMT_NV12;
360  case VA_FOURCC_YUY2:
361  case VA_FOURCC_UYVY: return FMT_YUY2;
362 #if defined (VA_FOURCC_P010)
363  case VA_FOURCC_P010: return FMT_P010;
364 #endif
365 #if defined (VA_FOURCC_P016)
366  case VA_FOURCC_P016: return FMT_P016;
367 #endif
368  case VA_FOURCC_ARGB: return FMT_ARGB32;
369  case VA_FOURCC_RGBA: return FMT_RGBA32;
370  }
371  return FMT_NONE;
372 }
373 
375 {
376  return HaveDMABuf(Context);
377 }
378 
379 #if VA_CHECK_VERSION(1, 1, 0)
380 static inline void VADRMtoPRIME(VADRMPRIMESurfaceDescriptor* VaDRM, AVDRMFrameDescriptor* Prime)
381 {
382  Prime->nb_objects = static_cast<int>(VaDRM->num_objects);
383  for (uint i = 0; i < VaDRM->num_objects; i++)
384  {
385  Prime->objects[i].fd = VaDRM->objects[i].fd;
386  Prime->objects[i].size = VaDRM->objects[i].size;
387  Prime->objects[i].format_modifier = VaDRM->objects[i].drm_format_modifier;
388  }
389  Prime->nb_layers = static_cast<int>(VaDRM->num_layers);
390  for (uint i = 0; i < VaDRM->num_layers; i++)
391  {
392  Prime->layers[i].format = VaDRM->layers[i].drm_format;
393  Prime->layers[i].nb_planes = static_cast<int>(VaDRM->layers[i].num_planes);
394  for (uint j = 0; j < VaDRM->layers[i].num_planes; j++)
395  {
396  Prime->layers[i].planes[j].object_index = static_cast<int>(VaDRM->layers[i].object_index[j]);
397  Prime->layers[i].planes[j].offset = VaDRM->layers[i].offset[j];
398  Prime->layers[i].planes[j].pitch = VaDRM->layers[i].pitch[j];
399  }
400  }
401 }
402 #endif
403 
409 std::vector<MythVideoTextureOpenGL*>
411  MythRenderOpenGL* Context,
413 {
414  std::vector<MythVideoTextureOpenGL*> result;
415 
416 #if VA_CHECK_VERSION(1, 1, 0)
417  if (!m_drmFrames.contains(Id))
418  m_drmFrames.insert(Id, GetDRMFrameDescriptor(Id));
419  if (!m_drmFrames.contains(Id))
420  return result;
421  result = CreateTextures(m_drmFrames[Id], Context, Frame, false);
422 #else
423  (void)Id;
424  (void)Context;
425  (void)Frame;
426 #endif
427  return result;
428 }
429 
430 AVDRMFrameDescriptor* MythVAAPIInteropDRM::GetDRMFrameDescriptor(VASurfaceID Id)
431 {
432 #if VA_CHECK_VERSION(1, 1, 0)
433  INIT_ST;
434  uint32_t exportflags = VA_EXPORT_SURFACE_SEPARATE_LAYERS | VA_EXPORT_SURFACE_READ_ONLY;
435  VADRMPRIMESurfaceDescriptor vadesc;
436  va_status = vaExportSurfaceHandle(m_vaDisplay, Id,
437  VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
438  exportflags, &vadesc);
439  CHECK_ST;
440 
441  auto * drmdesc = reinterpret_cast<AVDRMFrameDescriptor*>(av_mallocz(sizeof(AVDRMFrameDescriptor)));
442  VADRMtoPRIME(&vadesc, drmdesc);
443  return drmdesc;
444 #else
445  (void)Id;
446  return nullptr;
447 #endif
448 }
449 
451 {
452  if (m_drmFrames.isEmpty())
453  return;
454 
455  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Releasing %1 DRM descriptors").arg(m_drmFrames.size()));
456  for (auto * frame : qAsConst(m_drmFrames))
457  {
458  for (int i = 0; i < frame->nb_objects; i++)
459  close(frame->objects[i].fd);
460  av_freep(&frame);
461  }
462  m_drmFrames.clear();
463 }
464 
466 {
467 #if VA_CHECK_VERSION(1, 1, 0)
468  static bool s_supported = false;
469  static bool s_checked = false;
470 
471  if (s_checked)
472  return s_supported;
473  s_checked = true;
474 
476 
477  VASurfaceID surface = 0;
478 
479  VASurfaceAttrib attribs = {};
480  attribs.flags = VA_SURFACE_ATTRIB_SETTABLE;
481  attribs.type = VASurfaceAttribPixelFormat;
482  attribs.value.type = VAGenericValueTypeInteger;
483  attribs.value.value.i = VA_FOURCC_NV12;
484 
485  if (vaCreateSurfaces(m_vaDisplay, VA_RT_FORMAT_YUV420, 1920, 1080,
486  &surface, 1, &attribs, 1) == VA_STATUS_SUCCESS)
487  {
488  VADRMPRIMESurfaceDescriptor vadesc;
489  VAStatus status = vaExportSurfaceHandle(m_vaDisplay, surface, VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
490  VA_EXPORT_SURFACE_READ_ONLY | VA_EXPORT_SURFACE_SEPARATE_LAYERS,
491  &vadesc);
492  if (status == VA_STATUS_SUCCESS)
493  {
494  MythVideoFrame frame(FMT_DRMPRIME, nullptr, 0, 1920, 1080);
495  frame.m_swPixFmt = AV_PIX_FMT_NV12;
496  AVDRMFrameDescriptor drmdesc;
497  memset(&drmdesc, 0, sizeof(drmdesc));
498  VADRMtoPRIME(&vadesc, &drmdesc);
499  std::vector<MythVideoTextureOpenGL*> textures =
500  CreateTextures(&drmdesc, m_openglContext, &frame, false);
501 
502  if (!textures.empty())
503  {
504  s_supported = true;
505  for (auto & texture : textures)
506  s_supported &= texture->m_data && (texture->m_textureId != 0U);
508  }
509  for (uint32_t i = 0; i < vadesc.num_objects; ++i)
510  close(vadesc.objects[i].fd);
511  }
512  vaDestroySurfaces(m_vaDisplay, &surface, 1);
513  }
514  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("VAAPI DRM PRIME interop is %1supported")
515  .arg(s_supported ? "" : "not "));
516  return s_supported;
517 #else
518  return false;
519 #endif
520 }
521 
522 #ifdef USING_DRM_VIDEO
523 bool MythVAAPIInteropDRM::HandleDRMVideo(MythVideoColourSpace* ColourSpace, VASurfaceID Id, MythVideoFrame* Frame)
524 {
525  if (!((m_type == DRM_DRMPRIME) && m_usePrime && Id && Frame && ColourSpace))
526  return false;
527 
528  if (!m_drm)
529  m_drm = new MythVideoDRM(ColourSpace);
530 
531  if (m_drm)
532  {
533  if (m_drm->IsValid())
534  {
535  if (!m_drmFrames.contains(Id))
536  m_drmFrames.insert(Id, GetDRMFrameDescriptor(Id));
537  if (m_drm->RenderFrame(m_drmFrames[Id], Frame))
538  return true;
539  }
540 
541  // RenderFrame may have decided we should give up
542  if (!m_drm->IsValid())
543  {
544  LOG(VB_GENERAL, LOG_INFO, LOC + "Disabling DRM video");
545  m_drmTriedAndFailed = true;
546  delete m_drm;
547  m_drm = nullptr;
548  }
549  }
550  return false;
551 }
552 #endif
DEINT_DRIVER
@ DEINT_DRIVER
Definition: mythframe.h:75
INIT_ST
#define INIT_ST
Definition: mythvdpauhelper.cpp:12
MythVAAPIInterop::m_deinterlacer
MythDeintType m_deinterlacer
Definition: mythvaapiinterop.h:76
MythVAAPIInteropDRM::VATypeToMythType
static VideoFrameType VATypeToMythType(uint32_t Fourcc)
Definition: mythvaapidrminterop.cpp:353
MythInteropGPU::m_type
InteropType m_type
Definition: mythinteropgpu.h:67
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:282
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:430
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
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:14
MythEGLDMABUF::HaveDMABuf
static bool HaveDMABuf(MythRenderOpenGL *Context)
Definition: mythegldmabuf.cpp:26
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:43
FMT_NONE
@ FMT_NONE
Definition: mythframe.h:22
DEINT_CPU
@ DEINT_CPU
Definition: mythframe.h:73
MythVAAPIInterop
Definition: mythvaapiinterop.h:48
MythPlayerUI
Definition: mythplayerui.h:10
MythVAAPIInteropDRM::m_drmFile
QFile m_drmFile
Definition: mythvaapidrminterop.h:38
mythvideocolourspace.h
CHECK_ST
#define CHECK_ST
Definition: mythvdpauhelper.cpp:17
DRM_FORMAT_R8
#define DRM_FORMAT_R8
Definition: mythvaapidrminterop.cpp:279
MythEGLDMABUF::CreateTextures
std::vector< MythVideoTextureOpenGL * > CreateTextures(AVDRMFrameDescriptor *Desc, MythRenderOpenGL *Context, MythVideoFrame *Frame, bool UseSeparate, FrameScanType Scan=kScan_Progressive)
Definition: mythegldmabuf.cpp:372
MythOpenGLInterop::m_openglContext
MythRenderOpenGL * m_openglContext
Definition: mythopenglinterop.h:41
MythFile::copy
MBASE_PUBLIC long long copy(QFile &dst, QFile &src, uint block_size=0)
Copies src file to dst file.
Definition: mythmiscutil.cpp:264
MythVAAPIInteropDRM::m_referenceFrames
QVector< AVBufferRef * > m_referenceFrames
Definition: mythvaapidrminterop.h:39
FMT_YV12
@ FMT_YV12
Definition: mythframe.h:24
MythVAAPIInteropDRM::TestPrimeInterop
bool TestPrimeInterop()
Definition: mythvaapidrminterop.cpp:465
MythVAAPIInteropDRM::DeleteTextures
void DeleteTextures() override
Definition: mythvaapidrminterop.cpp:63
MythVideoDRM
Definition: mythvideodrm.h:14
MythEGL::IsEGL
bool IsEGL(void)
Definition: mythegl.cpp:29
VA_FOURCC_I420
#define VA_FOURCC_I420
Definition: mythvaapiinterop.h:34
DRM_FORMAT_R16
#define DRM_FORMAT_R16
Definition: mythvaapidrminterop.cpp:281
MythVAAPIInteropDRM::m_drmFrames
QHash< unsigned long long, AVDRMFrameDescriptor * > m_drmFrames
Definition: mythvaapidrminterop.h:52
uint
unsigned int uint
Definition: compat.h:79
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:54
MythVAAPIInteropDRM::CleanupDRMPRIME
void CleanupDRMPRIME()
Definition: mythvaapidrminterop.cpp:450
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
MythOpenGLInterop::m_openglTextures
QHash< unsigned long long, std::vector< MythVideoTextureOpenGL * > > m_openglTextures
Definition: mythopenglinterop.h:42
MythVAAPIInterop::m_filterError
bool m_filterError
Definition: mythvaapiinterop.h:83
DRM_FORMAT_GR88
#define DRM_FORMAT_GR88
Definition: mythvaapidrminterop.cpp:280
MythVAAPIInteropDRM::~MythVAAPIInteropDRM
~MythVAAPIInteropDRM() override
Definition: mythvaapidrminterop.cpp:49
MythVAAPIInterop::m_filterGraph
AVFilterGraph * m_filterGraph
Definition: mythvaapiinterop.h:82
MythRenderOpenGL
Definition: mythrenderopengl.h:100
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:374
MythVAAPIInteropDRM::m_usePrime
bool m_usePrime
Definition: mythvaapidrminterop.h:51
mythcorecontext.h
FMT_YUY2
@ FMT_YUY2
Definition: mythframe.h:51
MythVAAPIInteropDRM::AcquirePrime
std::vector< MythVideoTextureOpenGL * > AcquirePrime(VASurfaceID Id, MythRenderOpenGL *Context, MythVideoFrame *Frame)
Export the given VideoFrame as a DRM PRIME descriptor.
Definition: mythvaapidrminterop.cpp:410
MythOpenGLInterop::DeleteTextures
virtual void DeleteTextures()
Definition: mythopenglinterop.cpp:138
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:357
MythInteropGPU::m_discontinuityCounter
uint64_t m_discontinuityCounter
Definition: mythinteropgpu.h:63
fourcc_str
static const char * fourcc_str(int i)
Definition: fourcc.h:26
MythInteropGPU::DRM_DRMPRIME
@ DRM_DRMPRIME
Definition: mythinteropgpu.h:38
MythVideoFrame::GetNumPlanes
static uint GetNumPlanes(VideoFrameType Type)
Definition: mythframe.h:214
MythVAAPIInteropDRM::AcquireVAAPI
std::vector< MythVideoTextureOpenGL * > AcquireVAAPI(VASurfaceID Id, MythRenderOpenGL *Context, MythVideoFrame *Frame)
Definition: mythvaapidrminterop.cpp:286
MythVAAPIInteropDRM::RotateReferenceFrames
void RotateReferenceFrames(AVBufferRef *Buffer)
Definition: mythvaapidrminterop.cpp:118
MythVAAPIInteropDRM::Acquire
std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
Definition: mythvaapidrminterop.cpp:166
VideoFrameType
VideoFrameType
Definition: mythframe.h:20
MythVAAPIInterop::Deinterlace
VASurfaceID Deinterlace(MythVideoFrame *Frame, VASurfaceID Current, FrameScanType Scan)
Definition: mythvaapiinterop.cpp:320
Player
Definition: zmliveplayer.h:34
MythVideoFrame
Definition: mythframe.h:88
FMT_NV12
@ FMT_NV12
Definition: mythframe.h:53
MythInteropGPU::InteropType
InteropType
Definition: mythinteropgpu.h:25
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:73
LOC
#define LOC
Definition: mythvaapidrminterop.cpp:15
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:896
fourcc.h
FMT_RGBA32
@ FMT_RGBA32
Definition: mythframe.h:35
MythVAAPIInteropDRM::GetReferenceFrames
std::vector< MythVideoTextureOpenGL * > GetReferenceFrames()
Definition: mythvaapidrminterop.cpp:141
OpenGLLocker
Definition: mythrenderopengl.h:263