Skip to content
  • Johan Sternerup's avatar
    webrtc: return error when sending on non-open datachannel · 212c09a7
    Johan Sternerup authored and GStreamer Marge Bot's avatar GStreamer Marge Bot committed
    According to W3C
    specification (https://w3c.github.io/webrtc-pc/#datachannel-send) we
    should return InvalidStateError exception when trying to send when the
    channel is not open. In the world of C/glib/gstreamer we don't have
    exceptions but have to rely on gboolean/GError instead. Introducing
    these calls for a change in function signature of the action signals
    used to send data on the datachannel. Changing the signature of the
    existing "send-string" and "send-data" signals would mean an immediate
    breaking change so instead we deprecate them. Furthermore, there is no
    way to express GError** as an argument to an action signal in a way
    that fits language bindings (pointer-to-pointer simply does not work)
    and we have to use regular functions instead.
    
    Therefore we introduce gst_webrtc_data_channel_send_data_full() and
    gst_webrtc_data_channel_send_string_full() while deprecating the old
    functions and corresponding signals.
    
    Part-of: <gstreamer/gstreamer!1958>
    212c09a7
Loading