fn on_incoming_stream(pipeline: &gst::Pipeline, pad: &gst::Pad) -> Result<()>{
    if pad.get_direction() != gst::PadDirection::Src {
        return Ok(());
    }

    let decodebin = gst::ElementFactory::make("decodebin", None).unwrap();
    let pipeclone = pipeline.clone();
    decodebin.connect_pad_added(move |_decodebin, pad| {
        add_stream_destination(&pipeclone, pad).expect("Could not add stream destination.");
    });

    pipeline.add(&decodebin).unwrap();
    decodebin.sync_state_with_parent().unwrap();

    let sinkpad = decodebin.get_static_pad("sink").unwrap();
    pad.link(&sinkpad).unwrap();

    Ok(())
}
/// Called by the pad-added event on webrtcbin; only *after* successful ice negotiation
Called by the pad-added event on webrtcbin; only *after* successful ice negotiation
Called by the pad - added event on webrtcbin ; only * after * successful ice negotiation
fn on_incoming_stream(pipeline: &gst::Pipeline, pad: &gst::Pad) -> Result<()>{
    if pad.get_direction() != gst::PadDirection::Src {
        return Ok(());
    }
    let decodebin = gst::ElementFactory::make("decodebin", None).unwrap();
    let pipeclone = pipeline.clone();
    decodebin.connect_pad_added(move |_decodebin, pad| {
        add_stream_destination(&pipeclone, pad).expect("Could not add stream destination.");
    });
    pipeline.add(&decodebin).unwrap();
    decodebin.sync_state_with_parent().unwrap();
    let sinkpad = decodebin.get_static_pad("sink").unwrap();
    pad.link(&sinkpad).unwrap();
    Ok(())
}
fn on_incoming_stream ( pipeline : & gst :: Pipeline , pad : & gst :: Pad ) -> Result < ( ) > { if pad . get_direction ( ) != gst :: PadDirection :: Src { return Ok ( ( ) ) ; } let decodebin = gst :: ElementFactory :: make ( " " , None ) . unwrap ( ) ; let pipeclone = pipeline . clone ( ) ; decodebin . connect_pad_added ( move | _decodebin , pad | { add_stream_destination ( & pipeclone , pad ) . expect ( " " ) ; } ) ; pipeline . add ( & decodebin ) . unwrap ( ) ; decodebin . sync_state_with_parent ( ) . unwrap ( ) ; let sinkpad = decodebin . get_static_pad ( " " ) . unwrap ( ) ; pad . link ( & sinkpad ) . unwrap ( ) ; Ok ( ( ) ) }
Called by the pad-added event on webrtcbin; only *after* successful ice negotiation
Called by the pad - added event on webrtcbin ; only * after * successful ice negotiation
pipeline
&gst::Pipeline
pad
&gst::Pad
pipeline
&gst::Pipeline
pad
&gst::Pad