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 #475

Merged
merged 5 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/QtAVPlayer/QtAVPlayer.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include(CheckIncludeFile)

if(NOT QT_AVPLAYER_DIR)
set(QT_AVPLAYER_DIR ${CMAKE_SOURCE_DIR})
endif()
Expand Down Expand Up @@ -182,6 +184,16 @@ endif()

if(QT_AVPLAYER_VA_DRM)
message(STATUS "QT_AVPLAYER_VA_DRM is defined")

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()

add_definitions(-DQT_AVPLAYER_VA_DRM)

set(QtAVPlayer_LIBS
Expand Down
5 changes: 5 additions & 0 deletions src/QtAVPlayer/qavhwdevice_vaapi_drm_egl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <va/va_drmcommon.h>

#ifdef USE_LIBDRM
#include <libdrm/drm_fourcc.h>
#else
#include <drm/drm_fourcc.h>
Copy link
Owner

@valbok valbok May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val@qt:~$ dpkg -S /usr/include/drm/drm_fourcc.h
linux-libc-dev:amd64: /usr/include/drm/drm_fourcc.h
val@qt:~$ dpkg -S /usr/include/libdrm/drm_fourcc.h
libdrm-dev:amd64: /usr/include/libdrm/drm_fourcc.h

Looks it is too different packages, so I would suggest to use
#include <drm_fourcc.h>
but in cmake/pro file to add include path to found package, instead of inventing the define.

$ pkg-config --cflags libdrm
-I/usr/include/libdrm

How you like this idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho que eu entendi. Nós temos:
drm/drm_fourcc.h
libdrm/drm_fourcc.h

você quer que o compilador escolha entre libdrm ou drm no arquivo cmake/pro.
mas aí teria que mudar para #include <drm_fourcc.h>

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes only this should be used,

#include <drm_fourcc.h>

You can try to make it for cmake, will try to think how to adjust qmake pro.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

#endif

extern "C" {
#include <libavutil/hwcontext_vaapi.h>
Expand Down