Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correção do drm/drm_fourcc.h não encontrado #471

Closed
mxnt10 opened this issue May 19, 2024 · 3 comments
Closed

Correção do drm/drm_fourcc.h não encontrado #471

mxnt10 opened this issue May 19, 2024 · 3 comments

Comments

@mxnt10
Copy link
Contributor

mxnt10 commented May 19, 2024

a correção foi o #include <drm/drm_fourcc.h> para #include <libdrm/drm_fourcc.h>

+++ b/qavhwdevice_vaapi_drm_egl.cpp     2024-05-19 20:34:09.990158427 -0300
@@ -16,7 +16,7 @@
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 #include <va/va_drmcommon.h>
-#include <drm/drm_fourcc.h>
+#include <libdrm/drm_fourcc.h>
 
 extern "C" {
 #include <libavutil/hwcontext_vaapi.h>
@mxnt10 mxnt10 changed the title Correção do drm/drm_fourcc.h não encontrado e ajustes no qmediaplayer Correção do drm/drm_fourcc.h não encontrado May 19, 2024
@valbok
Copy link
Owner

valbok commented May 21, 2024

What is the distro and version?

Ubuntu 22.04:

$ locate drm_fourcc.h
/usr/include/drm/drm_fourcc.h

@mxnt10
Copy link
Contributor Author

mxnt10 commented May 25, 2024

Slackware 15.0 Stable.

$ locate drm_fourcc.h
/usr/include/libdrm/drm_fourcc.h
/usr/src/linux-5.15.117/include/drm/drm_fourcc.h
/usr/src/linux-5.15.117/include/uapi/drm/drm_fourcc.h

Pacote: libdrm-2.4.109-x86_64-1

Tem que ver se o drm do Ubuntu não é o do próprio kernel. O Ubuntu também tem o libdrm que possui o local "/usr/include/libdrm/drm_fourcc.h".

EDIT:

dpkg-query -S /usr/include/drm/drm_fourcc.h
linux-libc-dev:amd64: /usr/include/drm/drm_fourcc.h

Descobri o problema: O pacote que tem o drm é o linux-libc-dev que não tem no slackware. Então, dá pra criar uma compatibilidade.

diff -u a/qavhwdevice_vaapi_drm_egl.cpp b/qavhwdevice_vaapi_drm_egl.cpp
--- a/qavhwdevice_vaapi_drm_egl.cpp     2024-05-19 19:58:54.133011919 -0300
+++ b/qavhwdevice_vaapi_drm_egl.cpp     2024-05-25 19:48:04.131841485 -0300
@@ -16,7 +16,12 @@
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 #include <va/va_drmcommon.h>
-#include <drm/drm_fourcc.h>
+
+#ifdef USE_LIBDRM
+#include <libdrm/drm_fourcc.h> // libdrm
+#else
+#include <drm/drm_fourcc.h> // linux-libc-dev
+#endif
 
 extern "C" {
 #include <libavutil/hwcontext_vaapi.h>

No cmake:

include(CheckIncludeFile)

check_include_file("drm/drm_fourcc.h" HAVE_DRM_FOURCC_H)

if(HAVE_DRM_FOURCC_H)
    message(STATUS "Found drm/drm_fourcc.h")
else()
    message(STATUS "drm/drm_fourcc.h not found, using libdrm")
    add_definitions(-DUSE_LIBDRM)
endif()

Caso aceite, já mandei um pull request.

@valbok
Copy link
Owner

valbok commented May 31, 2024

btw there is #478
allows to use -DQT_AVPLAYER_VA_DRM=ON and fixes QT_CONFIG(egl) compile issue, for Qt5

@mxnt10 mxnt10 closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants