// Uses ctx_tx to notify the UI controllers about the inspection process
Uses ctx_tx to notify the UI controllers about the inspection process
Uses ctx_tx to notify the UI controllers about the inspection process
fn register_bus_inspector(&self, ctx_tx: Sender<ContextMessage>) {
        let mut init_done = false;
        self.pipeline.get_bus().unwrap().add_watch(move |_, msg| {
            match msg.view() {
                gst::MessageView::Eos(..) => {
                    ctx_tx.send(ContextMessage::Eos).unwrap();
                    return glib::Continue(false);
                }
                gst::MessageView::Error(err) => {
                    ctx_tx
                        .send(ContextMessage::FailedToExport(
                            err.get_error().description().to_owned(),
                        ))
                        .unwrap();
                    return glib::Continue(false);
                }
                gst::MessageView::AsyncDone(_) => {
                    if !init_done {
                        init_done = true;
                        ctx_tx.send(ContextMessage::InitDone).unwrap();
                    } else {
                        ctx_tx.send(ContextMessage::AsyncDone).unwrap();
                    }
                }
                _ => (),
            }
            glib::Continue(true)
        });
    }
fn register_bus_inspector ( & self , ctx_tx : Sender < ContextMessage > ) { let mut init_done = false ; self . pipeline . get_bus ( ) . unwrap ( ) . add_watch ( move | _ , msg | { match msg . view ( ) { gst :: MessageView :: Eos ( .. ) => { ctx_tx . send ( ContextMessage :: Eos ) . unwrap ( ) ; return glib :: Continue ( false ) ; } gst :: MessageView :: Error ( err ) => { ctx_tx . send ( ContextMessage :: FailedToExport ( err . get_error ( ) . description ( ) . to_owned ( ) , ) ) . unwrap ( ) ; return glib :: Continue ( false ) ; } gst :: MessageView :: AsyncDone ( _ ) => { if ! init_done { init_done = true ; ctx_tx . send ( ContextMessage :: InitDone ) . unwrap ( ) ; } else { ctx_tx . send ( ContextMessage :: AsyncDone ) . unwrap ( ) ; } } _ => ( ) , } glib :: Continue ( true ) } ) ; }
Uses ctx_tx to notify the UI controllers about the inspection process
Uses ctx_tx to notify the UI controllers about the inspection process
&self
ctx_tx
Sender<ContextMessage>