Use new function SDPMessage.new_from_text.
[toast/stream2beamer.git] / lagarde.py
index 7c982c3b9bff049e0c593ae4861bb6a2bf701b29..55b1e1f21cacff70c8e5dfe8d068f5d8a6526f4d 100755 (executable)
@@ -254,11 +254,8 @@ class WebRTCClient:
                         return
                 elif self.events.sdp_offer.qsize() > 0:
                     sdp_offer = self.events.sdp_offer.get_nowait()
-                    res, sm = GstSdp.SDPMessage.new()
+                    res, sm = GstSdp.SDPMessage.new_from_text(sdp_offer)
                     assert res == GstSdp.SDPResult.OK
-                    GstSdp.sdp_message_parse_buffer(bytes(sdp_offer.encode()), sm)
-                    # the three lines above can also be done this way in new versions of GStreamer:
-                    # sm = GstSdp.SDPMessage.new_from_text(sdp_offer)
                     rd = GstWebRTC.WebRTCSessionDescription.new(GstWebRTC.WebRTCSDPType.OFFER, sm)
                     gst_promise = Gst.Promise.new_with_change_func(self.set_remote_desciption_done)
                     self.webrtcbin.emit('set-remote-description', rd, gst_promise)