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)