Resolved the issue where captured images were appearing upside down or flipped.
Implemented a final vertical flip on the QImage after reading from the OpenGL
Framebuffer Object (FBO) to ensure correct orientation before sending to Hyperion.
This completes the basic hardware-accelerated scaling pipeline.
This commit confirms that the Wayland-only Hyperion grabber is successfully
capturing frames and sending them to the mock server, which in turn
generates PNG output. This validates the refactoring efforts and the
transition to a Wayland-centric approach.
- Remove all X11-related code and dependencies.
- Create a mock Hyperion server for testing.
- Refactor the main application to be Wayland-only.
- Update the build system and documentation.
This commit updates the lessons learned document to include details about
the D-Bus connection issues encountered when running the wayland_poc
executable on the host. It covers the fixes for method name mismatches
(PickSource to SelectSources), argument type mismatches (string to
QDBusObjectPath), and QDBusMessage API versioning.
This provides a more complete record of the debugging process for the
xdg-desktop-portal interaction.
This commit adds a comprehensive document summarizing the challenges,
debugging steps, and solutions encountered while attempting to adapt
the Hyperion Grabber for Wayland. It covers issues related to build
environments, PipeWire header compilation, and xdg-desktop-portal
interaction.
This document serves as a reference for future development and
troubleshooting efforts.
This commit refactors the wayland_poc executable to use Qt's QDBus
module for interacting with xdg-desktop-portal. This approach bypasses
the problematic direct inclusion of PipeWire session manager headers
(e.g., session-manager.h) that were causing persistent compilation errors.
The wayland_poc now focuses solely on requesting screen capture permission
via D-Bus and retrieving the PipeWire node ID, without attempting to
create or manage PipeWire streams directly.
This change aims to provide a working foundation for the xdg-desktop-portal
interaction, which can then be integrated with the core PipeWire stream
capture logic (demonstrated by tutorial5.c).
This commit introduces a Dockerfile to create a reproducible build
environment for the Hyperion Grabber project. This aims to address
persistent compilation issues related to header file discovery on
the host system.
The Dockerfile sets up an Arch Linux base image, installs necessary
dependencies (Qt5, PipeWire, GLib, CMake, etc.), copies the source
code, and attempts to build the project within the container.
This approach provides an isolated and consistent environment, which
should help in diagnosing and resolving build-time problems.
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.
Added a qDebug() statement in hgx11::_sendImage() to log when an image
is created and an attempt is made to send it to the Hyperion server.
This will help determine if the image grabbing and sending pipeline is
active.
Added a qDebug() statement in hgx11net::_connectHost() to log a
successful connection to the Hyperion server. This will help confirm
that the network connection is established before any commands are
attempted to be sent.
Added a qDebug() statement in hgx11net::_sendCommand() to log the JSON
command string just before it is sent to the Hyperion server. This
will help in debugging why no results are appearing on the Hyperion
end, by confirming if commands are being sent and what their content is.
The JSON output sent to the Hyperion server was malformed, specifically
the "priority" field, leading to an "unterminated object" error.
This was caused by the _hyperionPriority_m variable (and
subsequently _priority_m in hgx11net) containing the literal
"priority:" string, which was then redundantly added during JSON
string construction.
This commit modifies:
- hgx11.cpp: To store only the numerical priority value in
_hyperionPriority_m.
- hgx11net.cpp: To explicitly add the "priority:" key during JSON
string construction in all relevant functions (clearLeds,
setLedColor, _colorAdjustment, _thresholdAdjustment,
_transformdAdjustment, _temperatureAdjustment, and _setImgSize).
This ensures that the generated JSON is correctly formatted.
Added qDebug() statements to trace the execution flow and print out important values in the damage monitoring thread.
This will help to identify if X11 damage events are being received.
Added qDebug() statements to trace the execution flow and print out important values in the main function.
This will help to identify if the application is exiting prematurely.
Added qDebug() statements to trace the execution flow and print out important values in the screen grabbing process.
This will help to identify the root cause of the screen grabbing issue.
The systemd user service might not clear the LED's because systemd doesn't allow enough time for the grabber to gracefully shutdown, so this service ensures the LED's do turn off, unfortunately this doesn't occur on user logout, putting a ExecStop in the user script could also be a viable option.