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 all 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
26 changes: 26 additions & 0 deletions src/QtAVPlayer/QtAVPlayer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,32 @@ endif()

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

# Search for the drm_fourcc.h file in both possible locations
find_path(DRM_FOURCC_H_PATH drm_fourcc.h
PATHS
/usr/include/drm
/usr/include/libdrm
NO_DEFAULT_PATH
)

# Check if the file was found
if (DRM_FOURCC_H_PATH)
message(STATUS "Found drm_fourcc.h at ${DRM_FOURCC_H_PATH}")

# Check if the file is in both locations and prefer the drm version
find_path(DRM_PATH drm_fourcc.h PATHS /usr/include/drm NO_DEFAULT_PATH)
if (DRM_PATH AND DRM_PATH STREQUAL DRM_FOURCC_H_PATH)
message(STATUS "Using /usr/include/drm version of drm_fourcc.h")
include_directories(/usr/include/drm)
else()
message(STATUS "Using ${DRM_FOURCC_H_PATH} version of drm_fourcc.h")
include_directories(${DRM_FOURCC_H_PATH})
endif()
else()
message(FATAL_ERROR "drm_fourcc.h not found in the specified paths")
endif()

add_definitions(-DQT_AVPLAYER_VA_DRM)

find_package(OpenGL REQUIRED COMPONENTS OpenGL EGL)
Expand Down
2 changes: 1 addition & 1 deletion src/QtAVPlayer/qavhwdevice_vaapi_drm_egl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <va/va_drmcommon.h>
#include <drm/drm_fourcc.h>
#include <drm_fourcc.h>

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