diff --git a/app/streaming/video/ffmpeg-renderers/eglimagefactory.cpp b/app/streaming/video/ffmpeg-renderers/eglimagefactory.cpp index a6efa9d3..f4221091 100644 --- a/app/streaming/video/ffmpeg-renderers/eglimagefactory.cpp +++ b/app/streaming/video/ffmpeg-renderers/eglimagefactory.cpp @@ -1,5 +1,7 @@ #include "eglimagefactory.h" +#include + // Don't take a dependency on libdrm just for these constants #ifndef DRM_FORMAT_MOD_INVALID #define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1) @@ -449,8 +451,8 @@ bool EglImageFactory::supportsImportingFormat(EGLDisplay dpy, EGLint format) return false; } - EGLint formats[numFormats]; - if (!m_eglQueryDmaBufFormatsEXT(dpy, numFormats, formats, &numFormats)) { + std::vector formats(numFormats); + if (!m_eglQueryDmaBufFormatsEXT(dpy, numFormats, formats.data(), &numFormats)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "eglQueryDmaBufFormatsEXT() #2 failed: %d", eglGetError()); return false; @@ -491,8 +493,8 @@ bool EglImageFactory::supportsImportingModifier(EGLDisplay dpy, EGLint format, E return false; } - EGLuint64KHR modifiers[numModifiers]; - if (!m_eglQueryDmaBufModifiersEXT(dpy, format, numModifiers, modifiers, nullptr, &numModifiers)) { + std::vector modifiers(numModifiers); + if (!m_eglQueryDmaBufModifiersEXT(dpy, format, numModifiers, modifiers.data(), nullptr, &numModifiers)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "eglQueryDmaBufModifiersEXT() #2 failed: %d", eglGetError()); return false; diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 9c16f5a1..d8f66074 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -1,5 +1,7 @@ #include +#include + // HACK: Include before vaapi.h to prevent conflicts with Xlib.h #include @@ -573,9 +575,9 @@ VAAPIRenderer::isDirectRenderingSupported() AVHWDeviceContext* deviceContext = (AVHWDeviceContext*)m_HwContext->data; AVVAAPIDeviceContext* vaDeviceContext = (AVVAAPIDeviceContext*)deviceContext->hwctx; - VAEntrypoint entrypoints[vaMaxNumEntrypoints(vaDeviceContext->display)]; + std::vector entrypoints(vaMaxNumEntrypoints(vaDeviceContext->display)); int entrypointCount; - VAStatus status = vaQueryConfigEntrypoints(vaDeviceContext->display, VAProfileNone, entrypoints, &entrypointCount); + VAStatus status = vaQueryConfigEntrypoints(vaDeviceContext->display, VAProfileNone, entrypoints.data(), &entrypointCount); if (status == VA_STATUS_SUCCESS) { for (int i = 0; i < entrypointCount; i++) { // Without VAEntrypointVideoProc support, the driver will crash inside vaPutSurface()