drop bundle-policy, add audio caps, add data-channel
authorgregor herrmann <gregor@toastfreeware.priv.at>
Wed, 24 Jun 2020 21:18:16 +0000 (23:18 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Wed, 24 Jun 2020 21:18:16 +0000 (23:18 +0200)
laplace_client.py

index 0aa7f50b2f223cb6b6bb2aacd616e4e197fb649e..2778341f1296bb9f2ff5ec2e350a2b408ddb88df 100755 (executable)
@@ -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)