fn add_stream_destination(pipeline: &gst::Pipeline, pad: &gst::Pad) -> Result<()> {
    let caps = pad.get_current_caps().unwrap();
    let name = caps.get_structure(0).unwrap().get_name();

    let sink = if name.starts_with("video/") {
        gst::parse_bin_from_description(
            "queue ! videoconvert ! videoscale ! fakesink",
            true,
        )?
    } else if name.starts_with("audio/") {
        gst::parse_bin_from_description(
            "queue ! audioconvert ! audioresample ! fakesink",
            true,
        )?
    } else {
        println!("Unknown pad {:?}, ignoring", pad);
        return Ok(());
    };

    pipeline.add(&sink).unwrap();
    sink.sync_state_with_parent()?;

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

    Ok(())
}
/// creates a destination where audio or video will be dumped, depending on the
/// pad's capabilities.
/// 
/// The gstwebrtc-demos dumps the media to autovideosink or autoaudiosink, which
/// demonstrates that media is actually flowing bidirectionally. 
/// Here's we're just going to dump to fake sinks instead
creates a destination where audio or video will be dumped, depending on the
pad's capabilities.

The gstwebrtc-demos dumps the media to autovideosink or autoaudiosink, which
demonstrates that media is actually flowing bidirectionally.
Here's we're just going to dump to fake sinks instead
creates a destination where audio or video will be dumped depending on the pad ' s capabilities . The gstwebrtc - demos dumps the media to autovideosink or autoaudiosink which demonstrates that media is actually flowing bidirectionally . Here ' s we ' re just going to dump to fake sinks instead
fn add_stream_destination(pipeline: &gst::Pipeline, pad: &gst::Pad) -> Result<()> {
    let caps = pad.get_current_caps().unwrap();
    let name = caps.get_structure(0).unwrap().get_name();
    let sink = if name.starts_with("video/") {
        gst::parse_bin_from_description(
            "queue ! videoconvert ! videoscale ! fakesink",
            true,
        )?
    } else if name.starts_with("audio/") {
        gst::parse_bin_from_description(
            "queue ! audioconvert ! audioresample ! fakesink",
            true,
        )?
    } else {
        println!("Unknown pad {:?}, ignoring", pad);
        return Ok(());
    };
    pipeline.add(&sink).unwrap();
    sink.sync_state_with_parent()?;
    let sinkpad = sink.get_static_pad("sink").unwrap();
    pad.link(&sinkpad)?;
    Ok(())
}
fn add_stream_destination ( pipeline : & gst :: Pipeline , pad : & gst :: Pad ) -> Result < ( ) > { let caps = pad . get_current_caps ( ) . unwrap ( ) ; let name = caps . get_structure ( 0 ) . unwrap ( ) . get_name ( ) ; let sink = if name . starts_with ( " " ) { gst :: parse_bin_from_description ( " " , true , ) ? } else if name . starts_with ( " " ) { gst :: parse_bin_from_description ( " " , true , ) ? } else { println ! ( " " pad ) ; return Ok ( ( ) ) ; } ; pipeline . add ( & sink ) . unwrap ( ) ; sink . sync_state_with_parent ( ) ? ; let sinkpad = sink . get_static_pad ( " " ) . unwrap ( ) ; pad . link ( & sinkpad ) ? ; Ok ( ( ) ) }
creates a destination where audio or video will be dumped, depending on the
pad's capabilities.
creates a destination where audio or video will be dumped depending on the pad ' s capabilities .
pipeline
&gst::Pipeline
pad
&gst::Pad
pipeline
&gst::Pipeline
pad
&gst::Pad