wegen/FrOSCon26/examples
Ichthyostega 703e60c85a Review: identify and resolve problem with sync logic
''Review supported by Claude Code''

Control flow logic was scrutinised, and a race identified
in the solution to pass on the display action to the GUI thread.

Reconsidering the design, cross-thread synchronisation is now
hinged rather on a single atomic buffer pointer, where the GUI
thread notifies back completion of display work by setting that
pointer to NULL. Overall this simplifies the control logic

----
As an aside, I setup an outline of topics for documentation in `DemoSpec.txt`
and then instructed Claude to fill in the paragraphs, based on insight gained
as part of the code validation / review. Furthermore, I requested to generate
some diagrams that could be useful later when preparting the presentation
2026-07-19 03:48:16 +02:00
..
__CONTENT__ __FrOSCon26__ : Planung und Vorbereitungen 2026-05-10 12:51:04 +02:00
CMakeLists.txt Prototype: add dependency to liburing 2026-07-12 03:35:25 +02:00
commons.hpp Prototype/Demo: add IO timing measurement 2026-07-18 01:25:17 +02:00
demo-uring.cpp Review: identify and resolve problem with sync logic 2026-07-19 03:48:16 +02:00
egl-display.hpp Prototype: code improvements 2026-07-16 19:31:34 +02:00
gtk-uring-app.hpp Prototype: Playback parameters for a 1200px-50fps video 2026-07-17 19:00:14 +02:00
LICENSE Prototype: setup for example code ++ GPL v2+ 2026-07-11 20:43:45 +02:00
README Documentation skeleton to complement the example code 2026-07-12 03:56:11 +02:00

IO_URING and Video Output Example Code
======================================
:revision: 1.0
:author: Hermann Voßeler
:date: 8/2026


This directory contains a example code to demonstrate reading data blocks
continuously using the io_uring kernel interface. The loaded data is then
fed to a video display pipeline based on OpenGL / EGL

[red yellow-background]#Publish on Lumiera.org#
////
TIP: This demo code has been published on
     link:https://lumiera.org/research/videoDisplay/index.html[Lumiera.org]
////


Building the code
-----------------
As convenience, a CMake build system is provided, defining all library prerequisites.

A typical invocation for a complete build might be...

[source,sh]
--------------
cmake -S examples -B build
cmake --build build -- -j4

# clean tree with...
cmake --build build --target clean
--------------

TIP: The `-j4` option tells make to use 4 cores concurrently to speed up the build.
     Furthermore, you might want to configure further options with a graphical GUI,
     e.g: `cmake-gui build`; this way you can configure individual library dependencies
     to point to custom locations.

Use at least GCC-14
~~~~~~~~~~~~~~~~~~~
[red yellow-background]#TODO: still relevant?#
Some older C++ compilers seem to have problems with a `constexpr` function used in 'commons.hpp'.
Either comment out the line with the static assertion, or use at least GCC-14, which can be
configured for CMake with

-----
cmake -S examples -B build -DCMAKE_CXX_COMPILER=g++-14
-----


Dependencies
~~~~~~~~~~~~
Although the prime objective of this demo is to show how to read a sequence of data blocks using io_uring,
the practical example uses this technology to display video frames with an OpenGL pipeline. The framework
is a simple GTK-3 application that integrates OpenGL through EGL (with GLEW). This explains why you
need several distinct groups of dependencies to build the code. The build system only mentions the
top-level dependencies;  so either you have to install further transitive dependencies manually, or
(preferrably) you might want to rely on the _package manager_ of a Linux distribution.
The following list shows how to install the dependencies on Debian / Ubuntu.

Basic build environment::
+
-----------
apt install build-essential cmake
-----------
+
Lib-uring::
+
-----------
apt install liburing-dev
-----------
+
Build a GTK-3 application with C++::
+
-----------
apt install libgtkmm-3.0-dev
-----------
+
EGL Video Display::
+
-----------
apt install libx11-dev libglew-dev libegl-dev libgl-dev
-----------