#pragma once #include "screencast/codec/decoder.h" #include "screencast/render/error.h" #include #include namespace sc { struct RendererConfig { std::string window_title = "screencast receiver"; int initial_width = 1280; int initial_height = 720; // Borderless fullscreen. On the headless KMSDRM backend (no window // manager) fullscreen is enabled automatically. bool fullscreen = false; }; class Renderer { public: virtual ~Renderer() = default; // Present one decoded frame. Returns false if the window was closed. virtual bool present(const DecodedFrame& frame) = 0; // The display resolution (native monitor size in fullscreen mode). // Used by the receiver to tell the sender what resolution to encode at. virtual int display_width() const = 0; virtual int display_height() const = 0; // Pump events (window close, resize). Non-blocking. virtual bool poll_events() = 0; // Destroy the window and release GPU resources. virtual void shutdown() = 0; }; class RendererFactory { public: static RendererResult> create(const RendererConfig& config); }; } // namespace sc