This commit introduces a standalone proof-of-concept (POC) for screen capture on Wayland using PipeWire and xdg-desktop-portal. The POC demonstrates: - Initializing PipeWire context and core. - Requesting screen capture permission via xdg-desktop-portal, which triggers a user consent dialog. - Receiving the PipeWire node ID for the selected screen/window. - Connecting a PipeWire stream to the capture node. - Processing a single video frame from the PipeWire stream. - Converting the raw frame data into a QImage and saving it as a PNG file. This POC serves as a foundational step towards adapting the Hyperion grabber to work natively on Wayland, replacing the existing X11-specific grabbing logic. Further work will involve integrating this logic into the main grabber application and handling continuous frame processing.
36 lines
1.2 KiB
CMake
36 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.0.0)
|
|
|
|
project(Hyperion_Grabber_X11_QT VERSION 0.1 LANGUAGES CXX)
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
find_package(Qt5Core REQUIRED)
|
|
find_package(Qt5Network REQUIRED)
|
|
find_package(Qt5Widgets REQUIRED)
|
|
find_package(X11 REQUIRED)
|
|
|
|
# Find PipeWire
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3)
|
|
pkg_check_modules(PIPEWIRE_SM REQUIRED libpipewire-0.3-session-manager) # For session manager extensions
|
|
|
|
# Find GIO/GLib for GDBus
|
|
find_package(GLIB2 REQUIRED COMPONENTS gio)
|
|
|
|
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lXrender -lXdamage -lXss")
|
|
include_directories(${X11_INCLUDE_DIR})
|
|
|
|
add_executable(${PROJECT_NAME} "main.cpp" "hgx11.h" "hgx11.cpp" "hgx11net.h" "hgx11net.cpp" "hgx11damage.h" "hgx11damage.cpp" "hgx11grab.h" "hgx11grab.cpp" "hgx11screensaver.h" "hgx11screensaver.cpp")
|
|
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::Widgets ${X11_LIBRARIES})
|
|
|
|
# Add the Wayland POC executable
|
|
add_executable(wayland_poc "wayland_poc.cpp")
|
|
target_link_libraries(wayland_poc
|
|
Qt5::Core
|
|
${PIPEWIRE_LIBRARIES}
|
|
${PIPEWIRE_SM_LIBRARIES}
|
|
${GLIB2_LIBRARIES}
|
|
)
|