pub(crate) fn update_sdp_origin(origin: &mut Origin, d: &mut SessionDescription) {
    //TODO: if atomic.CompareAndSwapUint64(&origin.SessionVersion, 0, d.Origin.SessionVersion)
    if origin.session_version == 0 {
        // store
        origin.session_version = d.origin.session_version;
        //atomic.StoreUint64(&origin.SessionID, d.Origin.SessionID)
        origin.session_id = d.origin.session_id;
    } else {
        // load
        /*for { // awaiting for saving session id
            d.Origin.SessionID = atomic.LoadUint64(&origin.SessionID)
            if d.Origin.SessionID != 0 {
                break
            }
        }*/
        d.origin.session_id = origin.session_id;

        //d.Origin.SessionVersion = atomic.AddUint64(&origin.SessionVersion, 1)
        origin.session_version += 1;
        d.origin.session_version += 1;
    }
}
/// update_sdp_origin saves sdp.Origin in PeerConnection when creating 1st local SDP;
/// for subsequent calling, it updates Origin for SessionDescription from saved one
/// and increments session version by one.
/// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-25#section-5.2.2
update_sdp_origin saves sdp.Origin in PeerConnection when creating 1st local SDP;
for subsequent calling, it updates Origin for SessionDescription from saved one
and increments session version by one.
update_sdp_origin saves sdp . Origin in PeerConnection when creating 1st local SDP ; for subsequent calling it updates Origin for SessionDescription from saved one and increments session version by one .
pub(crate) fn update_sdp_origin(origin: &mut Origin, d: &mut SessionDescription) {
    //TODO: if atomic.CompareAndSwapUint64(&origin.SessionVersion, 0, d.Origin.SessionVersion)
    if origin.session_version == 0 {
        // store
        origin.session_version = d.origin.session_version;
        //atomic.StoreUint64(&origin.SessionID, d.Origin.SessionID)
        origin.session_id = d.origin.session_id;
    } else {
        // load
        /*for { // awaiting for saving session id
            d.Origin.SessionID = atomic.LoadUint64(&origin.SessionID)
            if d.Origin.SessionID != 0 {
                break
            }
        }*/
        d.origin.session_id = origin.session_id;
        //d.Origin.SessionVersion = atomic.AddUint64(&origin.SessionVersion, 1)
        origin.session_version += 1;
        d.origin.session_version += 1;
    }
}
pub ( crate ) fn update_sdp_origin ( origin : & mut Origin , d : & mut SessionDescription ) { //TODO: if atomic.CompareAndSwapUint64(&origin.SessionVersion, 0, d.Origin.SessionVersion) if origin . session_version == 0 { // store origin . session_version = d . origin . session_version ; //atomic.StoreUint64(&origin.SessionID, d.Origin.SessionID) origin . session_id = d . origin . session_id ; } else { // load /*for { // awaiting for saving session id
            d.Origin.SessionID = atomic.LoadUint64(&origin.SessionID)
            if d.Origin.SessionID != 0 {
                break
            }
        }*/ d . origin . session_id = origin . session_id ; //d.Origin.SessionVersion = atomic.AddUint64(&origin.SessionVersion, 1) origin . session_version += 1 ; d . origin . session_version += 1 ; } }
update_sdp_origin saves sdp.Origin in PeerConnection when creating 1st local SDP;
for subsequent calling, it updates Origin for SessionDescription from saved one
and increments session version by one.
update_sdp_origin saves sdp . Origin in PeerConnection when creating 1st local SDP ; for subsequent calling it updates Origin for SessionDescription from saved one and increments session version by one .
origin
&mut Origin
d
&mut SessionDescription