2023-09-27 02:02:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "renderer.h"
|
|
|
|
|
|
|
|
#define SDL_USE_BUILTIN_OPENGL_DEFINITIONS 1
|
|
|
|
#include <SDL_egl.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBVA
|
|
|
|
#include <va/va_drmcommon.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class EglImageFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EglImageFactory(IFFmpegRenderer* renderer);
|
|
|
|
bool initializeEGL(EGLDisplay, const EGLExtensions &ext);
|
2023-09-27 03:58:13 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_DRM
|
2023-09-27 02:02:29 +00:00
|
|
|
ssize_t exportDRMImages(AVFrame* frame, AVDRMFrameDescriptor* drmFrame, EGLDisplay dpy, EGLImage images[EGL_MAX_PLANES]);
|
2023-09-27 03:58:13 +00:00
|
|
|
#endif
|
2023-09-27 02:02:29 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBVA
|
|
|
|
ssize_t exportVAImages(AVFrame* frame, VADRMPRIMESurfaceDescriptor* vaFrame, EGLDisplay dpy, EGLImage images[EGL_MAX_PLANES]);
|
|
|
|
#endif
|
|
|
|
|
2023-09-27 03:58:13 +00:00
|
|
|
bool supportsImportingFormat(EGLDisplay dpy, EGLint format);
|
|
|
|
bool supportsImportingModifier(EGLDisplay dpy, EGLint format, EGLuint64KHR modifier);
|
|
|
|
|
2023-09-27 02:02:29 +00:00
|
|
|
void freeEGLImages(EGLDisplay dpy, EGLImage images[EGL_MAX_PLANES]);
|
|
|
|
|
|
|
|
private:
|
|
|
|
IFFmpegRenderer* m_Renderer;
|
|
|
|
bool m_EGLExtDmaBuf;
|
|
|
|
PFNEGLCREATEIMAGEPROC m_eglCreateImage;
|
|
|
|
PFNEGLDESTROYIMAGEPROC m_eglDestroyImage;
|
|
|
|
PFNEGLCREATEIMAGEKHRPROC m_eglCreateImageKHR;
|
|
|
|
PFNEGLDESTROYIMAGEKHRPROC m_eglDestroyImageKHR;
|
2023-09-27 03:58:13 +00:00
|
|
|
PFNEGLQUERYDMABUFFORMATSEXTPROC m_eglQueryDmaBufFormatsEXT;
|
|
|
|
PFNEGLQUERYDMABUFMODIFIERSEXTPROC m_eglQueryDmaBufModifiersEXT;
|
2023-09-27 02:02:29 +00:00
|
|
|
};
|