From: gregor herrmann Date: Wed, 24 Jun 2020 21:18:16 +0000 (+0200) Subject: drop bundle-policy, add audio caps, add data-channel X-Git-Url: https://git.toastfreeware.priv.at/toast/stream2beamer.git/commitdiff_plain/c7973a1e48b8ff169d4d6e5585df55431de43cc3 drop bundle-policy, add audio caps, add data-channel --- diff --git a/laplace_client.py b/laplace_client.py index 0aa7f50..2778341 100755 --- a/laplace_client.py +++ b/laplace_client.py @@ -120,16 +120,19 @@ class WebRTCClient: def start_pipeline(self): self.webrtc = Gst.ElementFactory.make('webrtcbin', 'laplace') - self.webrtc.set_property("bundle-policy", 3) direction = GstWebRTC.WebRTCRTPTransceiverDirection.RECVONLY - caps = Gst.caps_from_string("application/x-rtp,media=video,encoding-name=VP8/9000,payload=96") - self.webrtc.emit('add-transceiver', direction, caps) + vcaps = Gst.caps_from_string("application/x-rtp,media=video,encoding-name=VP8/9000,payload=96") + acaps = Gst.caps_from_string("application/x-rtp,media=audio,encoding-name=OPUS,media=audio,clock-rate=48000,payload=97") + # vcaps.append(acaps) + self.webrtc.emit('add-transceiver', direction, vcaps) + self.webrtc.emit('add-transceiver', direction, acaps) self.pipe = Gst.Pipeline.new("pipeline") Gst.Bin.do_add_element(self.pipe, self.webrtc) self.webrtc.connect('on-negotiation-needed', self.on_negotiation_needed) self.webrtc.connect('on-ice-candidate', self.send_ice_candidate_message) self.webrtc.connect('pad-added', self.on_incoming_stream) self.pipe.set_state(Gst.State.PLAYING) + self.webrtc.emit('create-data-channel', 'laplace', None) def close_pipeline(self): self.pipe.set_state(Gst.State.NULL)