mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-06-30 23:06:35 +00:00
Replace C++ VLAs with std::vector
This commit is contained in:
parent
515db03fe5
commit
4af9623727
@ -1,5 +1,7 @@
|
||||
#include "eglimagefactory.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
// 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<EGLint> 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<EGLuint64KHR> 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;
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
// HACK: Include before vaapi.h to prevent conflicts with Xlib.h
|
||||
#include <streaming/session.h>
|
||||
|
||||
@ -573,9 +575,9 @@ VAAPIRenderer::isDirectRenderingSupported()
|
||||
|
||||
AVHWDeviceContext* deviceContext = (AVHWDeviceContext*)m_HwContext->data;
|
||||
AVVAAPIDeviceContext* vaDeviceContext = (AVVAAPIDeviceContext*)deviceContext->hwctx;
|
||||
VAEntrypoint entrypoints[vaMaxNumEntrypoints(vaDeviceContext->display)];
|
||||
std::vector<VAEntrypoint> 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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user