mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 06:30:55 +00:00
Simplify EGLImageFactory and remove caching logic for now
The platforms that would most benefit (embedded V4L2 decoders) either don't use frame pooling or don't synchronize with modified DMA-BUFs unless eglCreateImage() is called each time.
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
|
||||
#include "renderer.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#ifdef HAVE_LIBVA
|
||||
#include <va/va_drmcommon.h>
|
||||
#endif
|
||||
|
||||
#include <optional>
|
||||
|
||||
class EglImageFactory
|
||||
{
|
||||
class EglImageContext {
|
||||
@@ -64,19 +64,14 @@ public:
|
||||
ssize_t exportVAImages(AVFrame* frame, uint32_t exportFlags, EGLDisplay dpy, EGLImage images[EGL_MAX_PLANES]);
|
||||
#endif
|
||||
|
||||
void freeEGLImages();
|
||||
|
||||
bool supportsImportingFormat(EGLDisplay dpy, EGLint format);
|
||||
bool supportsImportingModifier(EGLDisplay dpy, EGLint format, EGLuint64KHR modifier);
|
||||
|
||||
void freeEGLImages(EGLDisplay dpy, EGLImage images[EGL_MAX_PLANES]);
|
||||
|
||||
private:
|
||||
ssize_t queryImageCache(AVFrame* frame, EGLImage images[EGL_MAX_PLANES]);
|
||||
void populateImageCache(AVFrame* frame, EglImageContext &&imgCtx);
|
||||
|
||||
private:
|
||||
IFFmpegRenderer* m_Renderer;
|
||||
bool m_CacheDisabled;
|
||||
std::unordered_map<AVBuffer*, EglImageContext> m_CachedImages;
|
||||
std::optional<EglImageContext> m_LastImageCtx;
|
||||
bool m_EGLExtDmaBuf;
|
||||
PFNEGLCREATEIMAGEPROC m_eglCreateImage;
|
||||
PFNEGLDESTROYIMAGEPROC m_eglDestroyImage;
|
||||
|
||||
Reference in New Issue
Block a user