Files
screen_cast/include/screencast/app/pipeline.h
T
fegger 5c39662cc2 feat(gui): add a GTK sender panel and a waybar widget
A gtkmm-4.0 control panel (behind -Dgui=true, default off): refresh
shows discovered receivers (grouped and preference-sorted), a bitrate
scale, and start/stop that runs the whole session on a worker thread
so the interactive portal picker never blocks the UI. The CLI and the
GUI now share the new sc_app_core static library holding the
pipelines, session orchestration (negotiation + PLI feedback), and a
state store.

The sender pipeline publishes its state to
$XDG_RUNTIME_DIR/screencast/sender.json (session id, receiver,
bitrate, pid, start time; stale files detected by pid liveness) and
persists the last session for one-click restarts. The new
'screencast waybar' subcommand prints a waybar module line and its
--toggle flag stops a running sender gracefully or spawns a detached
restart of the last receiver.

Waybar on the dev machine is wired: custom/screencast module with
click-to-toggle and right-click panel, plus styles, with a timestamped
backup of both config files. Both binaries are installed to
/usr/local/bin.

Validated: waybar output (idle and streaming states with a synthetic
state file), GUI launches on the desktop (window observed via
hyprctl), meson test 5/5 in both build configurations, formatting
clean.
2026-09-08 17:14:44 +02:00

69 lines
1.8 KiB
C++

#pragma once
#include "screencast/capture/capture.h"
#include "screencast/codec/decoder.h"
#include "screencast/codec/encoder.h"
#include "screencast/network/transport.h"
#include "screencast/render/renderer.h"
#include <memory>
#include <optional>
namespace sc {
struct SenderPipelineConfig {
CaptureTarget capture_target;
EncoderConfig encoder;
Endpoint local_rtp_endpoint;
std::optional<Endpoint> signaling_server;
// Where encoded RTP packets are sent. Defaults to the local loopback so
// a sender and receiver on one machine work without any configuration.
Endpoint peer_rtp_endpoint{"127.0.0.1", 5004};
// Session identity from signaling; written to the sender state file for
// status widgets (waybar) and one-click restarts.
std::string session_id;
};
struct ReceiverPipelineConfig {
DecoderConfig decoder;
Endpoint local_rtp_endpoint;
std::optional<Endpoint> peer_signaling;
RendererConfig renderer;
// TCP port the signaling server listens on (offers arrive here).
std::uint16_t signaling_port = 5005;
};
// Sender pipeline: capture → encode → packetize → RTP/UDP.
class SenderPipeline {
public:
explicit SenderPipeline(SenderPipelineConfig config);
~SenderPipeline();
bool start();
void stop();
// Ask the sender to encode its next frame as a keyframe. Thread-safe;
// used by the PLI feedback path.
void request_keyframe();
private:
class Impl;
std::unique_ptr<Impl> impl_;
};
// Receiver pipeline: RTP/UDP → depacketize → decode → render.
class ReceiverPipeline {
public:
explicit ReceiverPipeline(ReceiverPipelineConfig config);
~ReceiverPipeline();
bool start();
void stop();
private:
class Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace sc