Minor Rusty blockage

Russel Winder russel at winder.org.uk
Thu Mar 1 18:04:44 UTC 2018


Following the examples from GStreamer_Rs/examples, I added the
following in my playbin creation code:

       bus.add_watch(move |_, msg| {
                match msg.view() {
                    gst::MessageView::Eos(..) => {
                        println!("Got an EOS signal in GStreamer engine.");
                        application.quit();
                    },
                    gst::MessageView::Error(err) => {
                        println!(
                            "Error from {:?}: {} ({:?})",
                            err.get_src().map(|s| s.get_path_string()),
                            err.get_error(),
                            err.get_debug()
                        );
                        application.quit();
                    },
                    _ => (),
                };
                glib::Continue(true)
            }
        );

Sadly though this fails to compile, there seems to be some problem with
the gst::MessageView::Error(err) bit – CLion/Rust doesn't recognise the
Error, it does the Eos, and the compiler reports:


error[E0599]: no method named `get_src` found for type `gst::message::Error<'_>` in the current scope
  --> src/gstreamer_engine.rs:52:33
   |
52 |                             err.get_src().map(|s| s.get_path_string()),
   |                                 ^^^^^^^


I'll wager I am just missing something obvious. Can anyone spot it?

-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180301/4fe63a5f/attachment.sig>


More information about the gstreamer-devel mailing list