MythTV  master
mythegldmabuf.cpp
Go to the documentation of this file.
1 // MythTV
4 
5 #include "fourcc.h"
6 #include "mythavutil.h"
8 #include "opengl/mythegldmabuf.h"
9 #include "opengl/mythegldefs.h"
10 
11 // FFmpeg
12 extern "C" {
13 #include "libavutil/hwcontext_drm.h"
14 }
15 
16 #define LOC QString("EGLDMABUF: ")
17 
19 {
20  if (Context)
21  {
22  OpenGLLocker locker(Context);
23  m_useModifiers = Context->IsEGL() && Context->HasEGLExtension("EGL_EXT_image_dma_buf_import_modifiers");
24  }
25 }
26 
28 {
29  if (!Context)
30  return false;
31  OpenGLLocker locker(Context);
32  return (Context->IsEGL() && Context->hasExtension("GL_OES_EGL_image") &&
33  Context->HasEGLExtension("EGL_EXT_image_dma_buf_import"));
34 }
35 
36 static void inline DebugDRMFrame(AVDRMFrameDescriptor* Desc)
37 {
38  LOG(VB_PLAYBACK, LOG_DEBUG, LOC + QString("DRM frame: Layers %1 Objects %2")
39  .arg(Desc->nb_layers).arg(Desc->nb_objects));
40  for (int i = 0; i < Desc->nb_layers; ++i)
41  {
42  LOG(VB_PLAYBACK, LOG_DEBUG, LOC + QString("Layer %1: Format %2 Planes %3")
43  .arg(i).arg(fourcc_str(static_cast<int>(Desc->layers[i].format)))
44  .arg(Desc->layers[i].nb_planes));
45  for (int j = 0; j < Desc->layers[i].nb_planes; ++j)
46  {
47  LOG(VB_PLAYBACK, LOG_DEBUG, LOC + QString(" Plane %1: Index %2 Offset %3 Pitch %4")
48  .arg(j).arg(Desc->layers[i].planes[j].object_index)
49  .arg(Desc->layers[i].planes[j].offset).arg(Desc->layers[i].planes[j].pitch));
50  }
51  }
52  for (int i = 0; i < Desc->nb_objects; ++i)
53  LOG(VB_PLAYBACK, LOG_DEBUG, LOC + QString("Object: %1 FD %2 Mods 0x%3")
54  .arg(i).arg(Desc->objects[i].fd).arg(Desc->objects[i].format_modifier, 0 , 16));
55 }
56 
62 inline std::vector<MythVideoTextureOpenGL*> MythEGLDMABUF::CreateComposed(AVDRMFrameDescriptor* Desc,
63  MythRenderOpenGL *Context,
64  MythVideoFrame *Frame, FrameScanType Scan) const
65 {
66  Frame->m_alreadyDeinterlaced = true;
67  std::vector<MythVideoTextureOpenGL*> result;
68  for (int i = 0; i < (Scan == kScan_Progressive ? 1 : 2); ++i)
69  {
70  std::vector<QSize> sizes;
71  int frameheight = Scan == kScan_Progressive ? Frame->m_height : Frame->m_height >> 1;
72  sizes.emplace_back(Frame->m_width, frameheight);
73  std::vector<MythVideoTextureOpenGL*> textures =
76  if (textures.empty())
77  {
78  ClearDMATextures(Context, result);
79  return result;
80  }
81 
82  textures[0]->m_allowGLSLDeint = false;
83 
84  EGLint colourspace = EGL_ITU_REC709_EXT;
85  switch (Frame->m_colorspace)
86  {
87  case AVCOL_SPC_BT470BG:
88  case AVCOL_SPC_SMPTE170M:
89  case AVCOL_SPC_SMPTE240M:
90  colourspace = EGL_ITU_REC601_EXT;
91  break;
92  case AVCOL_SPC_BT2020_CL:
93  case AVCOL_SPC_BT2020_NCL:
94  colourspace = EGL_ITU_REC2020_EXT;
95  break;
96  default:
97  if (Frame->m_width < 1280)
98  colourspace = EGL_ITU_REC601_EXT;
99  break;
100  }
101 
102  static constexpr std::array<EGLint,4> kPlaneFd
105  static constexpr std::array<EGLint,4> kPlaneOffset
108  static constexpr std::array<EGLint,4> kPlanePitch
111  static constexpr std::array<EGLint,4> kPlaneModlo
114  static constexpr std::array<EGLint,4> kPlaneModhi
117 
118  AVDRMLayerDescriptor* layer = &Desc->layers[0];
119 
120  QVector<EGLint> attribs = {
121  EGL_LINUX_DRM_FOURCC_EXT, static_cast<EGLint>(layer->format),
122  EGL_WIDTH, Frame->m_width,
123  EGL_HEIGHT, frameheight,
124  EGL_YUV_COLOR_SPACE_HINT_EXT, colourspace,
128  };
129 
130  for (int plane = 0; plane < layer->nb_planes; ++plane)
131  {
132  AVDRMPlaneDescriptor* drmplane = &layer->planes[plane];
133  ptrdiff_t pitch = drmplane->pitch;
134  ptrdiff_t offset = drmplane->offset;
135  if (Scan != kScan_Progressive)
136  {
137  if (i > 0)
138  offset += pitch;
139  pitch = pitch << 1;
140  }
141  attribs << kPlaneFd[plane] << Desc->objects[drmplane->object_index].fd
142  << kPlaneOffset[plane] << static_cast<EGLint>(offset)
143  << kPlanePitch[plane] << static_cast<EGLint>(pitch);
144  if (m_useModifiers && (Desc->objects[drmplane->object_index].format_modifier != 0 /* DRM_FORMAT_MOD_NONE*/))
145  {
146  attribs << kPlaneModlo[plane]
147  << static_cast<EGLint>(Desc->objects[drmplane->object_index].format_modifier & 0xffffffff)
148  << kPlaneModhi[plane]
149  << static_cast<EGLint>(Desc->objects[drmplane->object_index].format_modifier >> 32);
150  }
151  }
152  attribs << EGL_NONE;
153 
154  EGLImageKHR image = Context->eglCreateImageKHR(Context->GetEGLDisplay(), EGL_NO_CONTEXT,
155  EGL_LINUX_DMA_BUF_EXT, nullptr, attribs.data());
156  if (!image)
157  {
158  LOG(VB_GENERAL, LOG_ERR, LOC + QString("No EGLImage '%1'").arg(Context->GetEGLError()));
159  // Ensure we release anything already created and return nothing
160  ClearDMATextures(Context, result);
161  return result;
162  }
163 
164  MythVideoTextureOpenGL *texture = textures[0];
165  Context->glBindTexture(texture->m_target, texture->m_textureId);
166  Context->eglImageTargetTexture2DOES(texture->m_target, image);
167  Context->glBindTexture(texture->m_target, 0);
168  texture->m_data = static_cast<unsigned char *>(image);
169  result.push_back(texture);
170  }
171 
172  return result;
173 }
174 
179 inline std::vector<MythVideoTextureOpenGL*> MythEGLDMABUF::CreateSeparate(AVDRMFrameDescriptor* Desc,
180  MythRenderOpenGL *Context,
181  MythVideoFrame *Frame) const
182 {
183  // N.B. this works for YV12/NV12/P010 etc but will probably break for YUV422 etc
184  std::vector<QSize> sizes;
185  for (int plane = 0 ; plane < Desc->nb_layers; ++plane)
186  {
187  int width = Frame->m_width >> ((plane > 0) ? 1 : 0);
188  int height = Frame->m_height >> ((plane > 0) ? 1 : 0);
189  sizes.emplace_back(width, height);
190  }
191 
192  VideoFrameType format = MythAVUtil::PixelFormatToFrameType(static_cast<AVPixelFormat>(Frame->m_swPixFmt));
193  std::vector<MythVideoTextureOpenGL*> result =
194  MythVideoTextureOpenGL::CreateTextures(Context, Frame->m_type, format, sizes,
195  QOpenGLTexture::Target2D);
196  if (result.empty())
197  return result;
198 
199  for (uint plane = 0; plane < result.size(); ++plane)
200  {
201  result[plane]->m_allowGLSLDeint = true;
202  AVDRMLayerDescriptor* layer = &Desc->layers[plane];
203  AVDRMPlaneDescriptor* drmplane = &layer->planes[0];
204  QVector<EGLint> attribs = {
205  EGL_LINUX_DRM_FOURCC_EXT, static_cast<EGLint>(layer->format),
206  EGL_WIDTH, result[plane]->m_size.width(),
207  EGL_HEIGHT, result[plane]->m_size.height(),
208  EGL_DMA_BUF_PLANE0_FD_EXT, Desc->objects[drmplane->object_index].fd,
209  EGL_DMA_BUF_PLANE0_OFFSET_EXT, static_cast<EGLint>(drmplane->offset),
210  EGL_DMA_BUF_PLANE0_PITCH_EXT, static_cast<EGLint>(drmplane->pitch)
211  };
212 
213  if (m_useModifiers && (Desc->objects[drmplane->object_index].format_modifier != 0 /* DRM_FORMAT_MOD_NONE*/))
214  {
216  << static_cast<EGLint>(Desc->objects[drmplane->object_index].format_modifier & 0xffffffff)
218  << static_cast<EGLint>(Desc->objects[drmplane->object_index].format_modifier >> 32);
219  }
220 
221  attribs << EGL_NONE;
222 
223  EGLImageKHR image = Context->eglCreateImageKHR(Context->GetEGLDisplay(), EGL_NO_CONTEXT,
224  EGL_LINUX_DMA_BUF_EXT, nullptr, attribs.data());
225  if (!image)
226  {
227  LOG(VB_GENERAL, LOG_ERR, LOC + QString("No EGLImage for plane %1 %2")
228  .arg(plane).arg(Context->GetEGLError()));
229  ClearDMATextures(Context, result);
230  return result;
231  }
232 
233  Context->glBindTexture(result[plane]->m_target, result[plane]->m_textureId);
234  Context->eglImageTargetTexture2DOES(result[plane]->m_target, image);
235  Context->glBindTexture(result[plane]->m_target, 0);
236  result[plane]->m_data = static_cast<unsigned char *>(image);
237  }
238 
239  return result;
240 }
241 
242 #ifndef DRM_FORMAT_R8
243 static constexpr uint32_t MKTAG2(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
244 { return ((static_cast<uint32_t>(a) ) |
245  (static_cast<uint32_t>(b) << 8) |
246  (static_cast<uint32_t>(c) << 16) |
247  (static_cast<uint32_t>(d) << 24)); }
248 static constexpr uint32_t DRM_FORMAT_R8 { MKTAG2('R', '8', ' ', ' ') };
249 static constexpr uint32_t DRM_FORMAT_GR88 { MKTAG2('G', 'R', '8', '8') };
250 static constexpr uint32_t DRM_FORMAT_R16 { MKTAG2('R', '1', '6', ' ') };
251 static constexpr uint32_t DRM_FORMAT_GR32 { MKTAG2('G', 'R', '3', '2') };
252 static constexpr uint32_t DRM_FORMAT_NV12 { MKTAG2('N', 'V', '1', '2') };
253 static constexpr uint32_t DRM_FORMAT_NV21 { MKTAG2('N', 'V', '2', '1') };
254 static constexpr uint32_t DRM_FORMAT_YUV420 { MKTAG2('Y', 'U', '1', '2') };
255 static constexpr uint32_t DRM_FORMAT_YVU420 { MKTAG2('Y', 'V', '1', '2') };
256 static constexpr uint32_t DRM_FORMAT_P010 { MKTAG2('P', '0', '1', '0') };
257 static_assert(DRM_FORMAT_GR88 == 0x38385247);
258 static_assert(DRM_FORMAT_YUV420 == 0x32315559);
259 static_assert(DRM_FORMAT_YVU420 == 0x32315659);
260 #endif
261 
276 inline std::vector<MythVideoTextureOpenGL*> MythEGLDMABUF::CreateSeparate2(AVDRMFrameDescriptor* Desc,
277  MythRenderOpenGL *Context,
278  MythVideoFrame *Frame) const
279 {
280  // As for CreateSeparate - may not work for some formats
281  AVDRMLayerDescriptor* layer = &Desc->layers[0];
282  std::vector<QSize> sizes;
283  for (int plane = 0 ; plane < layer->nb_planes; ++plane)
284  {
285  int width = Frame->m_width >> ((plane > 0) ? 1 : 0);
286  int height = Frame->m_height >> ((plane > 0) ? 1 : 0);
287  sizes.emplace_back(width, height);
288  }
289 
290  // TODO - the v4l2_m2m decoder is not setting the correct sw_fmt - so we
291  // need to deduce the frame format from the fourcc
292  VideoFrameType format = FMT_YV12;
293  EGLint fourcc1 = DRM_FORMAT_R8;
294  EGLint fourcc2 = DRM_FORMAT_R8;
295  if (layer->format == DRM_FORMAT_NV12 || layer->format == DRM_FORMAT_NV21)
296  {
297  format = FMT_NV12;
298  fourcc2 = DRM_FORMAT_GR88;
299  }
300  else if (layer->format == DRM_FORMAT_P010)
301  {
302  format = FMT_P010;
303  fourcc1 = DRM_FORMAT_R16;
304  fourcc2 = DRM_FORMAT_GR32;
305  }
306 
307  std::vector<MythVideoTextureOpenGL*> result =
308  MythVideoTextureOpenGL::CreateTextures(Context, Frame->m_type, format, sizes,
309  QOpenGLTexture::Target2D);
310  if (result.empty())
311  return result;
312 
313  for (uint plane = 0; plane < result.size(); ++plane)
314  {
315  result[plane]->m_allowGLSLDeint = true;
316  EGLint fourcc = fourcc1;
317  if (plane > 0)
318  fourcc = fourcc2;
319  AVDRMPlaneDescriptor* drmplane = &layer->planes[plane];
320  QVector<EGLint> attribs = {
321  EGL_LINUX_DRM_FOURCC_EXT, fourcc,
322  EGL_WIDTH, result[plane]->m_size.width(),
323  EGL_HEIGHT, result[plane]->m_size.height(),
324  EGL_DMA_BUF_PLANE0_FD_EXT, Desc->objects[drmplane->object_index].fd,
325  EGL_DMA_BUF_PLANE0_OFFSET_EXT, static_cast<EGLint>(drmplane->offset),
326  EGL_DMA_BUF_PLANE0_PITCH_EXT, static_cast<EGLint>(drmplane->pitch)
327  };
328 
329  if (m_useModifiers && (Desc->objects[drmplane->object_index].format_modifier != 0 /* DRM_FORMAT_MOD_NONE*/))
330  {
332  << static_cast<EGLint>(Desc->objects[drmplane->object_index].format_modifier & 0xffffffff)
334  << static_cast<EGLint>(Desc->objects[drmplane->object_index].format_modifier >> 32);
335  }
336 
337  attribs << EGL_NONE;
338 
339  EGLImageKHR image = Context->eglCreateImageKHR(Context->GetEGLDisplay(), EGL_NO_CONTEXT,
340  EGL_LINUX_DMA_BUF_EXT, nullptr, attribs.data());
341  if (!image)
342  {
343  LOG(VB_GENERAL, LOG_ERR, LOC + QString("No EGLImage for plane %1 %2")
344  .arg(plane).arg(Context->GetEGLError()));
345  ClearDMATextures(Context, result);
346  return result;
347  }
348 
349  Context->glBindTexture(result[plane]->m_target, result[plane]->m_textureId);
350  Context->eglImageTargetTexture2DOES(result[plane]->m_target, image);
351  Context->glBindTexture(result[plane]->m_target, 0);
352  result[plane]->m_data = static_cast<unsigned char *>(image);
353  }
354 
355  return result;
356 }
357 
359  std::vector<MythVideoTextureOpenGL *> &Textures)
360 {
361  for (auto & texture : Textures)
362  {
363  if (texture->m_data)
364  Context->eglDestroyImageKHR(Context->GetEGLDisplay(), texture->m_data);
365  texture->m_data = nullptr;
366  if (texture->m_textureId)
367  Context->glDeleteTextures(1, &texture->m_textureId);
368  MythVideoTextureOpenGL::DeleteTexture(Context, texture);
369  }
370  Textures.clear();
371 }
372 
373 std::vector<MythVideoTextureOpenGL*> MythEGLDMABUF::CreateTextures(AVDRMFrameDescriptor* Desc,
374  MythRenderOpenGL *Context,
376  bool UseSeparate,
377  FrameScanType Scan)
378 {
379  std::vector<MythVideoTextureOpenGL*> result;
380  if (!Desc || !Context || !Frame)
381  return result;
382 
383  if (VERBOSE_LEVEL_CHECK(VB_PLAYBACK, LOG_DEBUG))
384  DebugDRMFrame(Desc);
385 
386  uint numlayers = static_cast<uint>(Desc->nb_layers);
387  if (numlayers < 1)
388  return result;
389 
390  OpenGLLocker locker(Context);
391 
392  // N.B. If the descriptor has a single layer (RGB, packed YUV), it shouldn't
393  // matter which path is taken here - the resulting calls are identical (with the
394  // exception of the colourspace hints for composed - which should be ignored per the spec for RGB).
395  // This MAY breakdown however for packed YUV formats when the frame format
396  // is not set correctly and/or the 'returned' format does not match
397  // our expectations.
398 
399  // For multiplanar formats (ie. YUV), this essentially assumes the implementation
400  // will supply a descriptor that matches the expectation of the
401  // EGL_EXT_image_dma_buf_import implementation (i.e. if it can cope with
402  // separate layers, it will supply a suitable descriptor).
403 
404  // One layer with X planes
405  if (numlayers == 1)
406  {
407  if (UseSeparate)
408  return CreateSeparate2(Desc, Context, Frame);
409  return CreateComposed(Desc, Context, Frame, Scan);
410  }
411  // X layers with one plane each
412  return CreateSeparate(Desc, Context, Frame);
413 }
DRM_FORMAT_NV12
static constexpr uint32_t DRM_FORMAT_NV12
Definition: mythegldmabuf.cpp:252
MythEGLDMABUF::m_useModifiers
bool m_useModifiers
Definition: mythegldmabuf.h:40
MythVideoTextureOpenGL
Definition: mythvideotextureopengl.h:21
EGL_DMA_BUF_PLANE3_FD_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE3_FD_EXT
Definition: mythegldefs.h:49
MythEGL::GetEGLDisplay
void * GetEGLDisplay(void)
Definition: mythegl.cpp:77
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT
Definition: mythegldefs.h:59
DRM_FORMAT_P010
static constexpr uint32_t DRM_FORMAT_P010
Definition: mythegldmabuf.cpp:256
Frame
Definition: zmdefines.h:102
MythGLTexture::m_data
unsigned char * m_data
Definition: mythrenderopengl.h:62
VERBOSE_LEVEL_CHECK
static bool VERBOSE_LEVEL_CHECK(uint64_t mask, LogLevel_t level)
Definition: mythlogging.h:29
MythEGL::eglImageTargetTexture2DOES
void eglImageTargetTexture2DOES(GLenum Target, void *Image)
Definition: mythegl.cpp:143
EGL_DMA_BUF_PLANE2_PITCH_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE2_PITCH_EXT
Definition: mythegldefs.h:33
DRM_FORMAT_R16
static constexpr uint32_t DRM_FORMAT_R16
Definition: mythegldmabuf.cpp:250
EGL_DMA_BUF_PLANE1_OFFSET_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE1_OFFSET_EXT
Definition: mythegldefs.h:29
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
EGL_DMA_BUF_PLANE2_OFFSET_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE2_OFFSET_EXT
Definition: mythegldefs.h:32
EGL_DMA_BUF_PLANE1_FD_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE1_FD_EXT
Definition: mythegldefs.h:28
mythvideotextureopengl.h
EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT
Definition: mythegldefs.h:55
DRM_FORMAT_NV21
static constexpr uint32_t DRM_FORMAT_NV21
Definition: mythegldmabuf.cpp:253
DRM_FORMAT_YVU420
static constexpr uint32_t DRM_FORMAT_YVU420
Definition: mythegldmabuf.cpp:255
MythEGLDMABUF::HaveDMABuf
static bool HaveDMABuf(MythRenderOpenGL *Context)
Definition: mythegldmabuf.cpp:27
MythEGL::eglDestroyImageKHR
void eglDestroyImageKHR(void *Disp, void *Image)
Definition: mythegl.cpp:157
EGL_ITU_REC2020_EXT
static constexpr uint16_t EGL_ITU_REC2020_EXT
Definition: mythegldefs.h:40
mythegldmabuf.h
GL_TEXTURE_EXTERNAL_OES
#define GL_TEXTURE_EXTERNAL_OES
Definition: mythrenderopengldefs.h:13
mythrenderopengl.h
EGL_DMA_BUF_PLANE0_FD_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE0_FD_EXT
Definition: mythegldefs.h:25
mythlogging.h
MythEGLDMABUF::CreateTextures
std::vector< MythVideoTextureOpenGL * > CreateTextures(AVDRMFrameDescriptor *Desc, MythRenderOpenGL *Context, MythVideoFrame *Frame, bool UseSeparate, FrameScanType Scan=kScan_Progressive)
Definition: mythegldmabuf.cpp:373
FMT_P010
@ FMT_P010
Definition: mythframe.h:53
EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT
Definition: mythegldefs.h:56
EGL_YUV_COLOR_SPACE_HINT_EXT
static constexpr uint16_t EGL_YUV_COLOR_SPACE_HINT_EXT
Definition: mythegldefs.h:34
EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT
Definition: mythegldefs.h:54
FMT_NV12
@ FMT_NV12
Definition: mythframe.h:52
MythEGLDMABUF::CreateSeparate
std::vector< MythVideoTextureOpenGL * > CreateSeparate(AVDRMFrameDescriptor *Desc, MythRenderOpenGL *Context, MythVideoFrame *Frame) const
Create multiple textures that represent the planes for the given AVDRMFrameDescriptor.
Definition: mythegldmabuf.cpp:179
MythEGL::GetEGLError
static qint32 GetEGLError(void)
Definition: mythegl.cpp:134
EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT
static constexpr uint16_t EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT
Definition: mythegldefs.h:36
EGL_YUV_FULL_RANGE_EXT
static constexpr uint16_t EGL_YUV_FULL_RANGE_EXT
Definition: mythegldefs.h:41
EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT
Definition: mythegldefs.h:53
EGL_ITU_REC601_EXT
static constexpr uint16_t EGL_ITU_REC601_EXT
Definition: mythegldefs.h:38
VideoFrameType
VideoFrameType
Definition: mythframe.h:19
DRM_FORMAT_GR32
static constexpr uint32_t DRM_FORMAT_GR32
Definition: mythegldmabuf.cpp:251
EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT
Definition: mythegldefs.h:58
FMT_YV12
@ FMT_YV12
Definition: mythframe.h:23
FMT_RGBA32
@ FMT_RGBA32
Definition: mythframe.h:34
EGL_DMA_BUF_PLANE0_OFFSET_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE0_OFFSET_EXT
Definition: mythegldefs.h:26
MythEGL::IsEGL
bool IsEGL(void)
Definition: mythegl.cpp:30
MythVideoTextureOpenGL::DeleteTexture
static void DeleteTexture(MythRenderOpenGL *Context, MythVideoTextureOpenGL *Texture)
Definition: mythvideotextureopengl.cpp:17
EGL_DMA_BUF_PLANE3_PITCH_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE3_PITCH_EXT
Definition: mythegldefs.h:51
MythAVUtil::PixelFormatToFrameType
static VideoFrameType PixelFormatToFrameType(AVPixelFormat Fmt)
Definition: mythavutil.cpp:72
MythGLTexture::m_target
GLenum m_target
Definition: mythrenderopengl.h:76
EGL_DMA_BUF_PLANE0_PITCH_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE0_PITCH_EXT
Definition: mythegldefs.h:27
EGL_DMA_BUF_PLANE1_PITCH_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE1_PITCH_EXT
Definition: mythegldefs.h:30
mythegldefs.h
MythRenderOpenGL
Definition: mythrenderopengl.h:95
DRM_FORMAT_GR88
static constexpr uint32_t DRM_FORMAT_GR88
Definition: mythegldmabuf.cpp:249
EGL_LINUX_DRM_FOURCC_EXT
static constexpr uint16_t EGL_LINUX_DRM_FOURCC_EXT
Definition: mythegldefs.h:24
MythEGLDMABUF::MythEGLDMABUF
MythEGLDMABUF(MythRenderOpenGL *Context)
Definition: mythegldmabuf.cpp:18
MythEGL::eglCreateImageKHR
void * eglCreateImageKHR(void *Disp, void *Context, unsigned int Target, void *Buffer, const int32_t *Attributes)
Definition: mythegl.cpp:149
MythGLTexture::m_textureId
GLuint m_textureId
Definition: mythrenderopengl.h:64
LOC
#define LOC
Definition: mythegldmabuf.cpp:16
MKTAG2
static constexpr uint32_t MKTAG2(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
Definition: mythegldmabuf.cpp:243
DRM_FORMAT_YUV420
static constexpr uint32_t DRM_FORMAT_YUV420
Definition: mythegldmabuf.cpp:254
MythEGLDMABUF::ClearDMATextures
static void ClearDMATextures(MythRenderOpenGL *Context, std::vector< MythVideoTextureOpenGL * > &Textures)
Definition: mythegldmabuf.cpp:358
mythavutil.h
DRM_FORMAT_R8
static constexpr uint32_t DRM_FORMAT_R8
Definition: mythegldmabuf.cpp:248
EGL_LINUX_DMA_BUF_EXT
static constexpr uint16_t EGL_LINUX_DMA_BUF_EXT
Definition: mythegldefs.h:23
fourcc_str
static const char * fourcc_str(int i)
Definition: fourcc.h:26
MythEGLDMABUF::CreateComposed
std::vector< MythVideoTextureOpenGL * > CreateComposed(AVDRMFrameDescriptor *Desc, MythRenderOpenGL *Context, MythVideoFrame *Frame, FrameScanType Scan) const
Create a single RGBA32 texture using the provided AVDRMFramDescriptor.
Definition: mythegldmabuf.cpp:62
MythEGLDMABUF::CreateSeparate2
std::vector< MythVideoTextureOpenGL * > CreateSeparate2(AVDRMFrameDescriptor *Desc, MythRenderOpenGL *Context, MythVideoFrame *Frame) const
Create multiple textures that represent the planes for the given AVDRMFrameDescriptor.
Definition: mythegldmabuf.cpp:276
EGL_YUV_NARROW_RANGE_EXT
static constexpr uint16_t EGL_YUV_NARROW_RANGE_EXT
Definition: mythegldefs.h:42
EGL_DMA_BUF_PLANE3_OFFSET_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE3_OFFSET_EXT
Definition: mythegldefs.h:50
EGL_ITU_REC709_EXT
static constexpr uint16_t EGL_ITU_REC709_EXT
Definition: mythegldefs.h:39
EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT
static constexpr uint16_t EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT
Definition: mythegldefs.h:37
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
MythVideoFrame
Definition: mythframe.h:87
EGL_YUV_CHROMA_SITING_0_EXT
static constexpr uint16_t EGL_YUV_CHROMA_SITING_0_EXT
Definition: mythegldefs.h:43
EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT
Definition: mythegldefs.h:52
EGL_SAMPLE_RANGE_HINT_EXT
static constexpr uint16_t EGL_SAMPLE_RANGE_HINT_EXT
Definition: mythegldefs.h:35
MythEGL::HasEGLExtension
bool HasEGLExtension(QString Extension)
Definition: mythegl.cpp:64
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
DebugDRMFrame
static void DebugDRMFrame(AVDRMFrameDescriptor *Desc)
Definition: mythegldmabuf.cpp:36
uint
unsigned int uint
Definition: freesurround.h:24
fourcc.h
EGL_DMA_BUF_PLANE2_FD_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE2_FD_EXT
Definition: mythegldefs.h:31
EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT
static constexpr uint16_t EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT
Definition: mythegldefs.h:57
OpenGLLocker
Definition: mythrenderopengl.h:254