Skip to content

Commit

Permalink
fix: fixed libva link error on ubuntu environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart-Steensma committed Jan 29, 2024
1 parent c32ce17 commit a11cd82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ more information.
- [x] Publish the directory tree as an archive as a release. Other more
sophisticated release methods can be used later.

- [ ] Make setup-release-env also compatible with pacman
- [ ] Cross compile for raspberry pi
- [ ] Segmentation fault when running --record without a camera being
available.
- [ ] Fix release workflow such that it links libva correctly to static ffmpeg.
It could be that I need to update the target property
"INTERFACE_LINK_LIBRARIES" of the QFFmpegMediaPlugin such that it also
links to libva.
- [ ] Fix issue with ffmpeg + hw acceleration on my arch machine:

```
Expand Down
30 changes: 10 additions & 20 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,17 @@ if(QT6_LIB_TYPE STREQUAL "STATIC_LIBRARY")
set(MULTIMEDIA_PLUGINS Qt6::QFFmpegMediaPlugin)

find_libva() # creates Libva::va/va-drm/va-x11/va-wayland

get_target_property(VA_LIBRARY Libva::va LOCATION)
get_target_property(VA_DRM_LIBRARY Libva::va-drm LOCATION)
get_target_property(VA_X11_LIBRARY Libva::va-x11 LOCATION)
get_target_property(VA_WAYLAND_LIBRARY Libva::va-wayland LOCATION)

message(STATUS "Libva::va library is: ${VA_LIBRARY}")
message(STATUS "Libva::va-drm library is: ${VA_DRM_LIBRARY}")
message(STATUS "Libva::va-x11 library is: ${VA_X11_LIBRARY}")
message(STATUS "Libva::va-wayland library is: ${VA_WAYLAND_LIBRARY}")

list(
APPEND
LINK_LIBS
get_target_property(QT6_QFFMPEGMEDIAPLUGIN_INTERFACE_LINK_LIBRARIES
Qt6::QFFmpegMediaPlugin INTERFACE_LINK_LIBRARIES)
list(APPEND QT6_QFFMPEGMEDIAPLUGIN_INTERFACE_LINK_LIBRARIES Libva::va
Libva::va-drm Libva::va-x11 Libva::va-wayland)
set_target_properties(
FFmpeg::FFmpeg
Libva::va
Libva::va-drm
Libva::va-x11
Libva::va-wayland
${PLATFORM_PLUGINS}
${MULTIMEDIA_PLUGINS})
Qt6::QFFmpegMediaPlugin
PROPERTIES INTERFACE_LINK_LIBRARIES
"${QT6_QFFMPEGMEDIAPLUGIN_INTERFACE_LINK_LIBRARIES}")

list(APPEND LINK_LIBS Qt6::QFFmpegMediaPlugin ${PLATFORM_PLUGINS})
endif()

target_link_libraries(snapshotapp PUBLIC ${LINK_LIBS})
Expand Down

0 comments on commit a11cd82

Please sign in to comment.