mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
feat: integrate DVR, live optical tuning and ARM64 tooling into modern GPUI Control Center
- Modern GPUI (src/gui_gpui.rs): Added 1-click DVR quick action button in header with live recording time/size, DVR status badge, reactive snapshots, live optical parameter tuning in Settings, and dedicated DVR settings card (MKV/MP4, StreamCopy/Composited). - Engine & DVR (src/engine.rs, src/dvr.rs, src/video_usb.rs): Integrated DVR recorder lifecycle with GStreamer supervisor probe for zero-CPU stream copy and hardware/composited OSD recording, dynamic optical updates without pipeline restarts. - Classic GUI fallback (src/gui.rs): Added DVR quick toggle, live optical slider callbacks, and full DVR settings section in egui. - OSD & Math optimizations: Zero-alloc stack formatting in src/telemetry_osd.rs, compile-time CRC8 table in src/nomad_elrs.rs, buffered file logger in src/logger.rs. - Steam Frame ARM64 scripts: udev rule scripts/99-radxa-vrx-rndis.rules, build & deployment tools scripts/build_steamframe_arm64.sh, scripts/deploy_to_steamframe.sh.
This commit is contained in:
1 parent
d5cc72750e
commit
7bee072e21
16 files changed
+1397
-75
No files matched your search
+211
-2
@@ -1,5 +1,9 @@
|
||||
use crate::config::AppConfig;
|
||||
use crate::engine::{EngineControlHandle, FpvEngineController, RuntimeMonitor, SubsystemStatus};
|
||||
use crate::dome_projection::ProjectionMode;
|
||||
use crate::dvr::{DvrContainer, DvrMode};
|
||||
use crate::engine::{
|
||||
EngineControlHandle, FpvEngineController, LiveOpticalParams, RuntimeMonitor, SubsystemStatus,
|
||||
};
|
||||
use crate::logger::{LogBuffer, LogEntry, LogFilter};
|
||||
use crate::nomad_elrs::{HeadPoseSample, NomadHeadTracker};
|
||||
use crate::telemetry_osd::TelemetryState;
|
||||
@@ -58,6 +62,12 @@ pub struct SteamFrameGpuiApp {
|
||||
xr_status: SubsystemStatus,
|
||||
nomad_status: SubsystemStatus,
|
||||
telem_status: SubsystemStatus,
|
||||
dvr_status: SubsystemStatus,
|
||||
dvr_recording: bool,
|
||||
dvr_elapsed_secs: u64,
|
||||
dvr_file_size_bytes: u64,
|
||||
dvr_frames_recorded: u64,
|
||||
dvr_filename: String,
|
||||
video_fps: f32,
|
||||
video_frames_total: u64,
|
||||
latest_pose: HeadPoseSample,
|
||||
@@ -95,6 +105,12 @@ impl SteamFrameGpuiApp {
|
||||
xr_status: SubsystemStatus::Starting,
|
||||
nomad_status: SubsystemStatus::Disabled,
|
||||
telem_status: SubsystemStatus::Disabled,
|
||||
dvr_status: SubsystemStatus::Stopped,
|
||||
dvr_recording: false,
|
||||
dvr_elapsed_secs: 0,
|
||||
dvr_file_size_bytes: 0,
|
||||
dvr_frames_recorded: 0,
|
||||
dvr_filename: String::new(),
|
||||
video_fps: 0.0,
|
||||
video_frames_total: 0,
|
||||
latest_pose: HeadPoseSample::default(),
|
||||
@@ -130,6 +146,18 @@ impl SteamFrameGpuiApp {
|
||||
self.telem_status = mon.telemetry_status.clone();
|
||||
changed = true;
|
||||
}
|
||||
if self.dvr_recording != mon.dvr_recording
|
||||
|| self.dvr_elapsed_secs != mon.dvr_elapsed_secs
|
||||
|| self.dvr_status != mon.dvr_status
|
||||
{
|
||||
self.dvr_recording = mon.dvr_recording;
|
||||
self.dvr_elapsed_secs = mon.dvr_elapsed_secs;
|
||||
self.dvr_file_size_bytes = mon.dvr_file_size_bytes;
|
||||
self.dvr_frames_recorded = mon.dvr_frames_recorded;
|
||||
self.dvr_filename = mon.dvr_filename.clone();
|
||||
self.dvr_status = mon.dvr_status.clone();
|
||||
changed = true;
|
||||
}
|
||||
if (self.video_fps - mon.video_fps).abs() > 0.1 {
|
||||
self.video_fps = mon.video_fps;
|
||||
changed = true;
|
||||
@@ -353,7 +381,8 @@ impl SteamFrameGpuiApp {
|
||||
.child("🥽 SteamFrame FPV"),
|
||||
)
|
||||
.child(self.render_status_badge("VRX", &self.usb_status))
|
||||
.child(self.render_status_badge("VR", &self.xr_status)),
|
||||
.child(self.render_status_badge("VR", &self.xr_status))
|
||||
.child(self.render_status_badge("DVR", &self.dvr_status)),
|
||||
)
|
||||
// CENTRE : Barre d'onglets épurée
|
||||
.child(
|
||||
@@ -434,6 +463,36 @@ impl SteamFrameGpuiApp {
|
||||
cx.notify();
|
||||
}))
|
||||
.child("🎯 Tare"),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.id("btn_dvr_quick")
|
||||
.px_2p5()
|
||||
.py_1()
|
||||
.bg(if self.dvr_recording { rgb(COLOR_RED) } else { rgb(COLOR_SURFACE_ELEVATED) })
|
||||
.border_1()
|
||||
.border_color(if self.dvr_recording { rgb(COLOR_RED) } else { rgb(COLOR_BORDER_SUBTLE) })
|
||||
.rounded_md()
|
||||
.text_xs()
|
||||
.font_weight(gpui::FontWeight::SEMIBOLD)
|
||||
.text_color(if self.dvr_recording { rgb(0xffffff) } else { rgb(COLOR_TEXT_MAIN) })
|
||||
.cursor_pointer()
|
||||
.on_click(cx.listener(|this, _, _, cx| {
|
||||
if this.dvr_recording {
|
||||
this.controls.stop_dvr();
|
||||
} else {
|
||||
this.controls.start_dvr();
|
||||
}
|
||||
cx.notify();
|
||||
}))
|
||||
.child(if self.dvr_recording {
|
||||
let mins = self.dvr_elapsed_secs / 60;
|
||||
let secs = self.dvr_elapsed_secs % 60;
|
||||
let mb = self.dvr_file_size_bytes as f64 / (1024.0 * 1024.0);
|
||||
format!("⏹ DVR ({:02}:{:02} - {:.1}Mo)", mins, secs, mb)
|
||||
} else {
|
||||
"🔴 DVR".to_string()
|
||||
}),
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -1010,6 +1069,14 @@ impl SteamFrameGpuiApp {
|
||||
self.cfg.projection_mode.eq_ignore_ascii_case("dome"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.projection_mode = "dome".into();
|
||||
this.controls.update_optical_params(LiveOpticalParams {
|
||||
camera_fov_deg: this.cfg.camera_fov_deg,
|
||||
lens_k1: this.cfg.lens_k1,
|
||||
lens_k2: this.cfg.lens_k2,
|
||||
screen_distance_m: this.cfg.screen_distance_m,
|
||||
screen_width_m: this.cfg.screen_width_m,
|
||||
projection_mode: ProjectionMode::Dome140,
|
||||
});
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
@@ -1019,6 +1086,14 @@ impl SteamFrameGpuiApp {
|
||||
self.cfg.projection_mode.eq_ignore_ascii_case("cylinder"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.projection_mode = "cylinder".into();
|
||||
this.controls.update_optical_params(LiveOpticalParams {
|
||||
camera_fov_deg: this.cfg.camera_fov_deg,
|
||||
lens_k1: this.cfg.lens_k1,
|
||||
lens_k2: this.cfg.lens_k2,
|
||||
screen_distance_m: this.cfg.screen_distance_m,
|
||||
screen_width_m: this.cfg.screen_width_m,
|
||||
projection_mode: ProjectionMode::Cylinder140,
|
||||
});
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
@@ -1028,6 +1103,14 @@ impl SteamFrameGpuiApp {
|
||||
self.cfg.projection_mode.eq_ignore_ascii_case("flat"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.projection_mode = "flat".into();
|
||||
this.controls.update_optical_params(LiveOpticalParams {
|
||||
camera_fov_deg: this.cfg.camera_fov_deg,
|
||||
lens_k1: this.cfg.lens_k1,
|
||||
lens_k2: this.cfg.lens_k2,
|
||||
screen_distance_m: this.cfg.screen_distance_m,
|
||||
screen_width_m: this.cfg.screen_width_m,
|
||||
projection_mode: ProjectionMode::FlatQuad,
|
||||
});
|
||||
cx.notify();
|
||||
}),
|
||||
)),
|
||||
@@ -1093,6 +1176,132 @@ impl SteamFrameGpuiApp {
|
||||
.text_color(rgb(COLOR_TEXT_MAIN))
|
||||
.child(format!("0.0.0.0:{}", self.cfg.telemetry_udp_port)),
|
||||
)),
|
||||
))
|
||||
// 3.5 Carte Enregistreur Vidéo DVR
|
||||
.child(self.render_settings_card(
|
||||
"🎥 5. Enregistreur Vidéo DVR",
|
||||
COLOR_RED,
|
||||
div()
|
||||
.flex()
|
||||
.flex_col()
|
||||
.gap_3()
|
||||
// Format de conteneur
|
||||
.child(self.render_setting_row(
|
||||
"Format Conteneur",
|
||||
div()
|
||||
.flex()
|
||||
.gap_2()
|
||||
.child(self.render_selectable_pill(
|
||||
"pill_dvr_mkv",
|
||||
"MKV (Résistant)",
|
||||
self.cfg.dvr_format.eq_ignore_ascii_case("mkv"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.dvr_format = "mkv".into();
|
||||
this.controls.update_dvr_config(
|
||||
this.cfg.dvr_dir.clone(),
|
||||
DvrContainer::Mkv,
|
||||
DvrMode::from_str(&this.cfg.dvr_mode),
|
||||
);
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
.child(self.render_selectable_pill(
|
||||
"pill_dvr_mp4",
|
||||
"MP4 (Standard)",
|
||||
self.cfg.dvr_format.eq_ignore_ascii_case("mp4"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.dvr_format = "mp4".into();
|
||||
this.controls.update_dvr_config(
|
||||
this.cfg.dvr_dir.clone(),
|
||||
DvrContainer::Mp4,
|
||||
DvrMode::from_str(&this.cfg.dvr_mode),
|
||||
);
|
||||
cx.notify();
|
||||
}),
|
||||
)),
|
||||
))
|
||||
// Mode d'enregistrement
|
||||
.child(self.render_setting_row(
|
||||
"Mode Enregistrement",
|
||||
div()
|
||||
.flex()
|
||||
.gap_2()
|
||||
.child(self.render_selectable_pill(
|
||||
"pill_dvr_copy",
|
||||
"Direct 0% CPU",
|
||||
self.cfg.dvr_mode.eq_ignore_ascii_case("copy"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.dvr_mode = "copy".into();
|
||||
this.controls.update_dvr_config(
|
||||
this.cfg.dvr_dir.clone(),
|
||||
DvrContainer::from_str(&this.cfg.dvr_format),
|
||||
DvrMode::StreamCopy,
|
||||
);
|
||||
cx.notify();
|
||||
}),
|
||||
))
|
||||
.child(self.render_selectable_pill(
|
||||
"pill_dvr_osd",
|
||||
"Avec OSD incrusté",
|
||||
self.cfg.dvr_mode.eq_ignore_ascii_case("composited") || self.cfg.dvr_mode.eq_ignore_ascii_case("osd"),
|
||||
cx.listener(|this, _, _, cx| {
|
||||
this.cfg.dvr_mode = "composited".into();
|
||||
this.controls.update_dvr_config(
|
||||
this.cfg.dvr_dir.clone(),
|
||||
DvrContainer::from_str(&this.cfg.dvr_format),
|
||||
DvrMode::CompositedOsd,
|
||||
);
|
||||
cx.notify();
|
||||
}),
|
||||
)),
|
||||
))
|
||||
// Statut & Action
|
||||
.child(self.render_setting_row(
|
||||
"Statut DVR",
|
||||
div()
|
||||
.text_xs()
|
||||
.text_color(if self.dvr_recording { rgb(COLOR_RED) } else { rgb(COLOR_TEXT_MUTED) })
|
||||
.child(if self.dvr_recording {
|
||||
let mins = self.dvr_elapsed_secs / 60;
|
||||
let secs = self.dvr_elapsed_secs % 60;
|
||||
let mb = self.dvr_file_size_bytes as f64 / (1024.0 * 1024.0);
|
||||
format!("● ACTIF : {:02}:{:02} ({} frames, {:.1} Mo)", mins, secs, self.dvr_frames_recorded, mb)
|
||||
} else {
|
||||
"Inactif (Prêt à enregistrer)".to_string()
|
||||
}),
|
||||
))
|
||||
.child(
|
||||
div()
|
||||
.flex()
|
||||
.pt_1()
|
||||
.child(
|
||||
div()
|
||||
.id("btn_toggle_dvr_card")
|
||||
.flex_1()
|
||||
.py_1p5()
|
||||
.bg(if self.dvr_recording { rgb(COLOR_RED) } else { rgb(COLOR_SURFACE_CARD) })
|
||||
.border_1()
|
||||
.border_color(if self.dvr_recording { rgb(COLOR_RED) } else { rgb(COLOR_BORDER_SUBTLE) })
|
||||
.rounded_md()
|
||||
.text_xs()
|
||||
.font_weight(gpui::FontWeight::BOLD)
|
||||
.text_color(if self.dvr_recording { rgb(0xffffff) } else { rgb(COLOR_TEXT_MAIN) })
|
||||
.cursor_pointer()
|
||||
.on_click(cx.listener(|this, _, _, cx| {
|
||||
if this.dvr_recording {
|
||||
this.controls.stop_dvr();
|
||||
} else {
|
||||
this.controls.start_dvr();
|
||||
}
|
||||
cx.notify();
|
||||
}))
|
||||
.child(if self.dvr_recording {
|
||||
"⏹ Arrêter l'enregistrement DVR"
|
||||
} else {
|
||||
"🔴 Démarrer l'enregistrement DVR"
|
||||
}),
|
||||
),
|
||||
),
|
||||
)),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user