2026-05-10 02:18:40 +00:00
|
|
|
mod server;
|
|
|
|
|
mod bundle;
|
2026-05-10 20:45:56 +00:00
|
|
|
mod cec;
|
2026-05-12 23:18:22 +00:00
|
|
|
mod gpio;
|
2026-05-11 09:47:07 +00:00
|
|
|
mod hwmon;
|
2026-05-10 02:18:40 +00:00
|
|
|
mod pipeline;
|
|
|
|
|
mod ui;
|
2026-05-10 20:15:58 +00:00
|
|
|
mod ws_client;
|
|
|
|
|
|
|
|
|
|
pub enum ServerMsg {
|
|
|
|
|
ReloadBundle,
|
2026-05-10 20:45:56 +00:00
|
|
|
Standby,
|
|
|
|
|
Wake,
|
2026-05-11 09:47:07 +00:00
|
|
|
/// Some(0..=255) = manual PWM. None = restore auto.
|
|
|
|
|
Fan(Option<u32>),
|
2026-05-12 23:00:11 +00:00
|
|
|
/// Switch to a specific layout by ID (must be present in current bundle).
|
|
|
|
|
SwitchLayout(u32),
|
2026-05-10 20:15:58 +00:00
|
|
|
}
|
2026-05-10 02:18:40 +00:00
|
|
|
|
2026-05-10 18:12:14 +00:00
|
|
|
use gtk4::prelude::{ApplicationExt, ApplicationExtManual};
|
2026-05-10 18:59:23 +00:00
|
|
|
use gstreamer::prelude::PluginFeatureExtManual;
|
2026-05-10 18:52:25 +00:00
|
|
|
use tracing::info;
|
2026-05-10 02:18:40 +00:00
|
|
|
use tracing_subscriber::EnvFilter;
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
tracing_subscriber::fmt()
|
|
|
|
|
.with_env_filter(EnvFilter::from_default_env().add_directive("betterframe_kiosk=info".parse().unwrap()))
|
|
|
|
|
.init();
|
|
|
|
|
|
|
|
|
|
gstreamer::init().expect("Failed to init GStreamer");
|
2026-05-10 18:52:25 +00:00
|
|
|
|
|
|
|
|
// Demote Pi5 hw H265 decoder — rejects non-standard resolutions like 960x1080
|
|
|
|
|
if let Some(factory) = gstreamer::ElementFactory::find("v4l2slh265dec") {
|
|
|
|
|
factory.set_rank(gstreamer::Rank::NONE);
|
|
|
|
|
info!("demoted v4l2slh265dec to NONE (sw fallback)");
|
|
|
|
|
}
|
2026-05-10 02:18:40 +00:00
|
|
|
let app = ui::build_app();
|
2026-05-10 18:11:31 +00:00
|
|
|
// Pass empty args to GTK — server URL handled via env or argv directly
|
2026-05-10 18:13:01 +00:00
|
|
|
app.set_flags(gtk4::gio::ApplicationFlags::NON_UNIQUE);
|
2026-05-10 18:11:31 +00:00
|
|
|
std::process::exit(app.run_with_args::<&str>(&[]).into());
|
2026-05-10 02:18:40 +00:00
|
|
|
}
|