fn block_get_local_description(
    webrtcbin: &gst::Element,
) -> Result<gst_webrtc::WebRTCSessionDescription> {
    let mut local = None;

    let delay = Duration::from_millis(1);
    while local.is_none() {
        local = webrtcbin
            .get_property("local-description")
            .expect("Requires local description")
            .get::<gst_webrtc::WebRTCSessionDescription>()
            .expect("Actual sdp");

        // TODO - find better mechanism. Park? Condvar?
        thread::sleep(delay)
    }

    Ok(local.unwrap())
}
/// Gets the local description from the provided webrtcbin. The local description may have
/// been set as part of sdp negotiation, but the actual setting is async, so it may not show up
/// in the "local-description" property. This function blocks indefinitely until the value is non-none
/// Internally it does a thread::sleep for 1 ms; I'm sure there's a better rust way of doing this
Gets the local description from the provided webrtcbin. The local description may have
been set as part of sdp negotiation, but the actual setting is async, so it may not show up
in the "local-description" property. This function blocks indefinitely until the value is non-none
Internally it does a thread::sleep for 1 ms; I'm sure there's a better rust way of doing this
Gets the local description from the provided webrtcbin . The local description may have been set as part of sdp negotiation but the actual setting is async so it may not show up in the " local - description " property . This function blocks indefinitely until the value is non - none Internally it does a thread :: sleep for 1 ms ; I ' m sure there ' s a better rust way of doing this
fn block_get_local_description(
    webrtcbin: &gst::Element,
) -> Result<gst_webrtc::WebRTCSessionDescription> {
    let mut local = None;
    let delay = Duration::from_millis(1);
    while local.is_none() {
        local = webrtcbin
            .get_property("local-description")
            .expect("Requires local description")
            .get::<gst_webrtc::WebRTCSessionDescription>()
            .expect("Actual sdp");
        // TODO - find better mechanism. Park? Condvar?
        thread::sleep(delay)
    }
    Ok(local.unwrap())
}
fn block_get_local_description ( webrtcbin : & gst :: Element , ) -> Result < gst_webrtc :: WebRTCSessionDescription > { let mut local = None ; let delay = Duration :: from_millis ( 1 ) ; while local . is_none ( ) { local = webrtcbin . get_property ( " " ) . expect ( " " ) . get :: < gst_webrtc :: WebRTCSessionDescription > ( ) . expect ( " " ) ; // TODO - find better mechanism. Park? Condvar? thread :: sleep ( delay ) } Ok ( local . unwrap ( ) ) }
Gets the local description from the provided webrtcbin.
Gets the local description from the provided webrtcbin .
webrtcbin
&gst::Element
webrtcbin
&gst::Element