Skip to content

net/webrtc/whip_signaller: implement WHIP server

Taruntej Kanakamalla requested to merge tkanakamalla/gst-plugins-rs:whipsrc into main
  • Extract BaseWebRTCSrc

    • Define a Base for all the webrtcsrc type elements so they can all be derived from it. Similar to base element defined for webrtcsink type elements
  • To reduce the confusion between implementations of WHIP client and WHIP server

    • Rename the existing impl Signaller to WhipClient
    • Rename the existing struct WhipSignaller to WhipClientSignaller
  • Rename the name consumer-added to webrtcbin-ready on the Signallable iface

    • This will make it more meaningful as this signal is used by the elements to tweak the webrtcbin once it is created
  • For the WHIP server implementation

    • new signaller WhipServerSignaller

      • an http server using 'warp'
      • handlers for the POST, OPTIONS, PATCH and DELETE
      • fixed path /whip/endpoint as the URI
      • fixed value 'whip-client' as the producer peer id
    • Derive whipserversrc element from BaseWebRTCSrc

      • implement constructed method for ObjectImpl to set non-default signaller, i.e., WhipServerSignaller
      • implement notify method for ObjectImpl; the properties like stun-server and turn-servers will be set on the Signaller when they are set on the element
  • Connect to 'webrtcbin-ready' signal in the constructor of WhipServerSignaller

    • it will be emitted by the webrtcsrc when the webrtcbin element is ready
    • the closure for this signal will in turn connect to webrtcbin's ice-gathering-state and perform send with the answer sdp via the channel
    • the WhipServer will hold its HTTP response in POST handler until this signal is received or timeout which happens early
Edited by Taruntej Kanakamalla

Merge request reports

Loading