From 0dd0112518e18034712a69f5c9ee5de6092f3790 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 29 Sep 2023 17:20:50 -0500 Subject: [PATCH] Don't export EGLImages for software frames --- app/streaming/video/ffmpeg-renderers/drm.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index 31614bf6..c26af313 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -1158,8 +1158,13 @@ bool DrmRenderer::initializeEGL(EGLDisplay display, ssize_t DrmRenderer::exportEGLImages(AVFrame *frame, EGLDisplay dpy, EGLImage images[EGL_MAX_PLANES]) { - AVDRMFrameDescriptor* drmFrame = (AVDRMFrameDescriptor*)frame->data[0]; + if (frame->format != AV_PIX_FMT_DRM_PRIME) { + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, + "EGLImage export requires hardware-backed frames"); + return -1; + } + AVDRMFrameDescriptor* drmFrame = (AVDRMFrameDescriptor*)frame->data[0]; return m_EglImageFactory.exportDRMImages(frame, drmFrame, dpy, images); }