Hey,
I'm writing a small application where I want to start a pipeline when a device is connected. To detect device I'm using DeviceMonitor api. I'm having trouble receiving an event from `gst_bus_add_watch_full`, but it works fine if I do it with timed iteration `gst_bus_timed_pop`. I was following this <http://(https://gstreamer.freedesktop.org/documentation/gstreamer/gstdevicemonitor.html?gi-language=c> tutorial. What I'm doing wrong here? fn main() -> Result<(), Error> { gst::init(); let monitor = gst::DeviceMonitor::new(); monitor.set_show_all_devices(true); let bus = monitor.get_bus(); let r = bus.add_watch(|bus, msg| { // never called println!("WATCH Message {:?}", &msg); Continue(true) }); println!("result {:?}", r); let caps = gst::Caps::new_any(); monitor.add_filter(None, Some(&caps)); monitor.start(); monitor.get_providers() .into_iter().for_each(|provider| println!("provider {:?}", String::from(provider))); let devices =monitor.get_devices(); println!("devices {:?}", &devices); for msg in bus.iter_timed(gst::CLOCK_TIME_NONE) { // works fine println!("Message iter {:?}", &msg); } Ok(()) } Cheers! -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi, Thanks, Ilya On Wed, Mar 31, 2021 at 1:30 PM Townsheriff <[hidden email]> wrote: Hey, _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |