AV Desc fix
This commit is contained in:
parent
20be1763b8
commit
14bad67a04
@ -35,12 +35,15 @@ impl MonitorWindow {
|
|||||||
.expect("not a pipeline");
|
.expect("not a pipeline");
|
||||||
|
|
||||||
// Optional: turn the sink full‑screen when LESAVKA_FULLSCREEN=1
|
// Optional: turn the sink full‑screen when LESAVKA_FULLSCREEN=1
|
||||||
if std::env::var("LESAVKA_FULLSCREEN").is_ok() {
|
let fullscreen = std::env::var("LESAVKA_FULLSCREEN").is_ok();
|
||||||
if let Some(sink) = pipeline.by_name("sink") {
|
if let Some(sink) = pipeline.by_name("sink") {
|
||||||
sink.set_property_from_str("fullscreen", "true");
|
// glimagesink: title / fullscreen / force‑aspect‑ratio
|
||||||
sink.set_property("force-aspect-ratio", &true);
|
let title = format!("Lesavka‑eye‑{_id}");
|
||||||
// Wayland & GL sinks accept it :contentReference[oaicite:1]{index=1}
|
let _ = sink.set_property("title", &title); // only if supported
|
||||||
|
if fullscreen {
|
||||||
|
let _ = sink.set_property("fullscreen", &true); // ditto
|
||||||
}
|
}
|
||||||
|
let _ = sink.set_property("force-aspect-ratio", &true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- AppSrc ------------------------------------------------- */
|
/* ---------- AppSrc ------------------------------------------------- */
|
||||||
|
|||||||
@ -8,7 +8,7 @@ use gst::{log, MessageView};
|
|||||||
use lesavka_common::lesavka::VideoPacket;
|
use lesavka_common::lesavka::VideoPacket;
|
||||||
use tokio_stream::wrappers::ReceiverStream;
|
use tokio_stream::wrappers::ReceiverStream;
|
||||||
use tonic::Status;
|
use tonic::Status;
|
||||||
use tracing::{debug, enabled, trace, Level};
|
use tracing::{debug, warn, error, info, enabled, trace, Level};
|
||||||
use futures_util::Stream;
|
use futures_util::Stream;
|
||||||
|
|
||||||
const EYE_ID: [&str; 2] = ["l", "r"];
|
const EYE_ID: [&str; 2] = ["l", "r"];
|
||||||
@ -76,6 +76,41 @@ pub async fn eye_ball(
|
|||||||
|
|
||||||
let (tx, rx) = tokio::sync::mpsc::channel(8192);
|
let (tx, rx) = tokio::sync::mpsc::channel(8192);
|
||||||
|
|
||||||
|
/* ----- BUS WATCH: show errors & warnings immediately --------------- */
|
||||||
|
let bus = pipeline.bus().expect("bus");
|
||||||
|
let eye_clone = eye.to_owned();
|
||||||
|
std::thread::spawn(move || {
|
||||||
|
for msg in bus.iter_timed(gst::ClockTime::NONE) {
|
||||||
|
use gst::MessageView::*;
|
||||||
|
match msg.view() {
|
||||||
|
Error(err) => {
|
||||||
|
tracing::error!(target:"lesavka_server::video",
|
||||||
|
eye = %eye_clone,
|
||||||
|
"💥 pipeline error: {} ({})",
|
||||||
|
err.error(), err.debug().unwrap_or_default());
|
||||||
|
}
|
||||||
|
Warning(w) => {
|
||||||
|
tracing::warn!(target:"lesavka_server::video",
|
||||||
|
eye = %eye_clone,
|
||||||
|
"⚠️ pipeline warning: {} ({})",
|
||||||
|
w.error(), w.debug().unwrap_or_default());
|
||||||
|
}
|
||||||
|
Info(i) => {
|
||||||
|
tracing::info!(target:"lesavka_server::video",
|
||||||
|
eye = %eye_clone,
|
||||||
|
"📌 pipeline info: {} ({})",
|
||||||
|
i.error(), i.debug().unwrap_or_default());
|
||||||
|
}
|
||||||
|
StateChanged(s) if s.current() == gst::State::Playing => {
|
||||||
|
tracing::info!(target:"lesavka_server::video",
|
||||||
|
eye = %eye_clone,
|
||||||
|
"🎬 pipeline PLAYING");
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
sink.set_callbacks(
|
sink.set_callbacks(
|
||||||
gst_app::AppSinkCallbacks::builder()
|
gst_app::AppSinkCallbacks::builder()
|
||||||
.new_sample(move |sink| {
|
.new_sample(move |sink| {
|
||||||
@ -121,13 +156,29 @@ pub async fn eye_ball(
|
|||||||
/ 1_000;
|
/ 1_000;
|
||||||
|
|
||||||
/* -------- ship over gRPC ----- */
|
/* -------- ship over gRPC ----- */
|
||||||
let pkt = VideoPacket {
|
let data = map.as_slice().to_vec();
|
||||||
id,
|
let size = data.len();
|
||||||
pts: pts_us,
|
let pkt = VideoPacket { id, pts: pts_us, data };
|
||||||
data: map.as_slice().to_vec(),
|
match tx.try_send(Ok(pkt)) {
|
||||||
};
|
Ok(_) => {
|
||||||
tracing::trace!("srv→grpc eye-{eye} {} bytes pts={}", pkt.data.len(), pkt.pts);
|
trace!(target:"lesavka_server::video",
|
||||||
let _ = tx.try_send(Ok(pkt));
|
eye = %eye,
|
||||||
|
size = size,
|
||||||
|
"📤 sent");
|
||||||
|
}
|
||||||
|
Err(tokio::sync::mpsc::error::TrySendError::Full(_)) => {
|
||||||
|
static DROP_CNT: std::sync::atomic::AtomicU64 =
|
||||||
|
std::sync::atomic::AtomicU64::new(0);
|
||||||
|
let c = DROP_CNT.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
|
||||||
|
if c % 120 == 0 {
|
||||||
|
debug!(target:"lesavka_server::video",
|
||||||
|
eye = %eye,
|
||||||
|
dropped = c,
|
||||||
|
"⏳ channel full – dropping frames");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => error!("mpsc send err: {e}"),
|
||||||
|
}
|
||||||
|
|
||||||
Ok(gst::FlowSuccess::Ok)
|
Ok(gst::FlowSuccess::Ok)
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user