mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 14:40:56 +00:00
Add macro for printing FourCC values
This commit is contained in:
@@ -1261,15 +1261,15 @@ bool DrmRenderer::addFbForFrame(AVFrame *frame, uint32_t* newFbId, bool testMode
|
|||||||
|
|
||||||
if (!formatMatch) {
|
if (!formatMatch) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Selected DRM plane doesn't support chosen decoding format: %08x",
|
"Selected DRM plane doesn't support chosen decoding format: " FOURCC_FMT,
|
||||||
drmFrame->layers[0].format);
|
FOURCC_FMT_ARGS(drmFrame->layers[0].format));
|
||||||
drmModeRmFB(m_DrmFd, *newFbId);
|
drmModeRmFB(m_DrmFd, *newFbId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Selected DRM plane supports chosen decoding format: %08x",
|
"Selected DRM plane supports chosen decoding format: " FOURCC_FMT,
|
||||||
drmFrame->layers[0].format);
|
FOURCC_FMT_ARGS(drmFrame->layers[0].format));
|
||||||
|
|
||||||
// TODO: We can also check the modifier support using the IN_FORMATS property,
|
// TODO: We can also check the modifier support using the IN_FORMATS property,
|
||||||
// but checking format alone is probably enough for real world cases since we're
|
// but checking format alone is probably enough for real world cases since we're
|
||||||
|
|||||||
@@ -16,6 +16,18 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef FOURCC_FMT
|
||||||
|
#define FOURCC_FMT "%c%c%c%c"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FOURCC_FMT_ARGS
|
||||||
|
#define FOURCC_FMT_ARGS(f) \
|
||||||
|
(char)((f) & 0xFF), \
|
||||||
|
(char)(((f) >> 8) & 0xFF), \
|
||||||
|
(char)(((f) >> 16) & 0xFF), \
|
||||||
|
(char)(((f) >> 24) & 0xFF)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
#define MESA_EGL_NO_X11_HEADERS
|
#define MESA_EGL_NO_X11_HEADERS
|
||||||
#define EGL_NO_X11
|
#define EGL_NO_X11
|
||||||
|
|||||||
@@ -1102,15 +1102,15 @@ VAAPIRenderer::initializeEGL(EGLDisplay dpy,
|
|||||||
}
|
}
|
||||||
else if (!m_EglImageFactory.supportsImportingModifier(dpy, descriptor.layers[0].drm_format, descriptor.objects[0].drm_format_modifier)) {
|
else if (!m_EglImageFactory.supportsImportingModifier(dpy, descriptor.layers[0].drm_format, descriptor.objects[0].drm_format_modifier)) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Exporting separate layers due to lack of support for importing format and modifier: %08x %016" PRIx64,
|
"Exporting separate layers due to lack of support for importing format and modifier: " FOURCC_FMT " %016" PRIx64,
|
||||||
descriptor.layers[0].drm_format,
|
FOURCC_FMT_ARGS(descriptor.layers[0].drm_format),
|
||||||
descriptor.objects[0].drm_format_modifier);
|
descriptor.objects[0].drm_format_modifier);
|
||||||
m_EglExportType = EglExportType::Separate;
|
m_EglExportType = EglExportType::Separate;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Exporting composed layers with format and modifier: %08x %016" PRIx64,
|
"Exporting composed layers with format and modifier: " FOURCC_FMT " %016" PRIx64,
|
||||||
descriptor.layers[0].drm_format,
|
FOURCC_FMT_ARGS(descriptor.layers[0].drm_format),
|
||||||
descriptor.objects[0].drm_format_modifier);
|
descriptor.objects[0].drm_format_modifier);
|
||||||
m_EglExportType = EglExportType::Composed;
|
m_EglExportType = EglExportType::Composed;
|
||||||
}
|
}
|
||||||
@@ -1126,13 +1126,14 @@ VAAPIRenderer::initializeEGL(EGLDisplay dpy,
|
|||||||
for (uint32_t i = 0; i < descriptor.num_layers; i++) {
|
for (uint32_t i = 0; i < descriptor.num_layers; i++) {
|
||||||
if (!m_EglImageFactory.supportsImportingFormat(dpy, descriptor.layers[i].drm_format)) {
|
if (!m_EglImageFactory.supportsImportingFormat(dpy, descriptor.layers[i].drm_format)) {
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"EGL implementation lacks support for importing format: %08x", descriptor.layers[0].drm_format);
|
"EGL implementation lacks support for importing format: " FOURCC_FMT,
|
||||||
|
FOURCC_FMT_ARGS(descriptor.layers[i].drm_format));
|
||||||
}
|
}
|
||||||
else if (!m_EglImageFactory.supportsImportingModifier(dpy, descriptor.layers[i].drm_format,
|
else if (!m_EglImageFactory.supportsImportingModifier(dpy, descriptor.layers[i].drm_format,
|
||||||
descriptor.objects[descriptor.layers[i].object_index[0]].drm_format_modifier)) {
|
descriptor.objects[descriptor.layers[i].object_index[0]].drm_format_modifier)) {
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"EGL implementation lacks support for importing format and modifier: %08x %016" PRIx64,
|
"EGL implementation lacks support for importing format and modifier: " FOURCC_FMT " %016" PRIx64,
|
||||||
descriptor.layers[i].drm_format,
|
FOURCC_FMT_ARGS(descriptor.layers[i].drm_format),
|
||||||
descriptor.objects[descriptor.layers[i].object_index[0]].drm_format_modifier);
|
descriptor.objects[descriptor.layers[i].object_index[0]].drm_format_modifier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user