/* demo-uring.cpp - async file IO with io_uring Copyright (C) 2026, Hermann Vosseler This program is free software; you can redistribute it and/or modify it   under the terms of the GNU GPL version 2+ See the LICENSE file for details. * ************************************************************************/ #include "commons.hpp" #include "egl-display.hpp" #include "gtk-uring-app.hpp" #include #include #include using std::unique_ptr; //-----------------hard-coded-config-- //-----------------hard-coded-config-- class UringVideoPlayer { Glib::Dispatcher dispatchFrame_; EglDisplay videoDisplayer_; std::thread proactorThread_; public: UringVideoPlayer (Gtk::Window& appWindow) : videoDisplayer_{appWindow, dispatchFrame_} , proactorThread_{[this]{ playVideo(); }} { } void terminate(); private: void playVideo() { } }; unique_ptr launchPlayer (Gtk::Window& appWindow) { appWindow.resize (EglDisplay::VIDEO_WIDTH, EglDisplay::VIDEO_HEIGHT); auto player = std::make_unique (appWindow); return player; } void UringVideoPlayer::terminate() { ///// signal stop to proactor videoDisplayer_.cleanUp(); } int main (int, const char*[]) { return GtkUringApp{"io-uring-demo"} .onClick (launchPlayer) .onClose ([](auto& player){ player.terminate();}) .run(); }