This commit is contained in:
Brad Stein 2025-06-29 17:53:25 -05:00
parent 6e107bb136
commit e62f588cf5

View File

@ -45,9 +45,7 @@ pub async fn eye_ball(
gst::init().context("gst init")?;
let desc = format!(
// Elementary H264 stream coming straight from the UVC device
// no MPEGTS container, so no tsdemux.
"v4l2src device=\"{dev}\" io-mode=mmap do-timestamp=true ! \
"v4l2src name=cam_{eye} device=\"{dev}\" io-mode=mmap do-timestamp=true ! \
queue ! \
h264parse disable-passthrough=true config-interval=-1 ! \
video/x-h264,stream-format=byte-stream,alignment=au ! \
@ -80,21 +78,22 @@ pub async fn eye_ball(
/* ----- BUS WATCH: show errors & warnings immediately --------------- */
let bus = pipeline.bus().expect("bus");
let src_pad = pipeline
.by_name("v4l2src1") // adapt: eyespecific element name
.unwrap()
.static_pad("src")
.unwrap();
src_pad.add_probe(gst::PadProbeType::EVENT_DOWNSTREAM, |pad, info| {
if let Some(gst::PadProbeData::Event(ref ev)) = info.data {
if let gst::EventView::Caps(c) = ev.view() {
trace!(target:"lesavka_server::video",
?c, "🔍 new caps on {}", pad.name());
if let Some(src_pad) = pipeline.by_name(&format!("cam_{eye}"))
.and_then(|e| e.static_pad("src")) {
src_pad.add_probe(gst::PadProbeType::EVENT_DOWNSTREAM, |pad, info| {
if let Some(gst::PadProbeData::Event(ref ev)) = info.data {
if let gst::EventView::Caps(c) = ev.view() {
trace!(target:"lesavka_server::video",
?c, "🔍 new caps on {}", pad.name());
}
}
}
gst::PadProbeReturn::Ok
});
gst::PadProbeReturn::Ok
});
} else {
warn!(target:"lesavka_server::video",
eye = %eye,
"🍪 cam_{eye} not found skipping padprobe");
}
let eye_clone = eye.to_owned();
std::thread::spawn(move || {