|
@ -205,8 +205,8 @@ class WebRTCCamera(Thread): |
|
|
webrtcbin.set_property("bundle-policy", "max-bundle") |
|
|
webrtcbin.set_property("bundle-policy", "max-bundle") |
|
|
|
|
|
|
|
|
#webrtcbin.set_property("latency", 40) |
|
|
#webrtcbin.set_property("latency", 40) |
|
|
rtpbin = webrtcbin.get_by_name('rtpbin') |
|
|
#rtpbin = webrtcbin.get_by_name('rtpbin') |
|
|
rtpbin.set_property("latency", 40) |
|
|
#rtpbin.set_property("latency", 40) |
|
|
|
|
|
|
|
|
audio_queue = peer_bin.get_by_name("audio-queue") |
|
|
audio_queue = peer_bin.get_by_name("audio-queue") |
|
|
audio_sink_pad = Gst.GhostPad.new("audio_sink", audio_queue.get_static_pad("sink")) |
|
|
audio_sink_pad = Gst.GhostPad.new("audio_sink", audio_queue.get_static_pad("sink")) |
|
@ -229,24 +229,45 @@ class WebRTCCamera(Thread): |
|
|
# connect unlinked |
|
|
# connect unlinked |
|
|
|
|
|
|
|
|
audio_src_pad = self.audio_tee.get_request_pad('src_%u') |
|
|
audio_src_pad = self.audio_tee.get_request_pad('src_%u') |
|
|
|
|
|
audio_block = audio_src_pad.add_probe(Gst.PadProbeType.BLOCK_DOWNSTREAM, self.probe_block) |
|
|
audio_src_pad.link(audio_sink_pad) |
|
|
audio_src_pad.link(audio_sink_pad) |
|
|
|
|
|
|
|
|
video_src_pad = self.video_tee.get_request_pad('src_%u') |
|
|
video_src_pad = self.video_tee.get_request_pad('src_%u') |
|
|
|
|
|
video_block = video_src_pad.add_probe(Gst.PadProbeType.BLOCK_DOWNSTREAM, self.probe_block) |
|
|
video_src_pad.link(video_sink_pad) |
|
|
video_src_pad.link(video_sink_pad) |
|
|
|
|
|
|
|
|
peer_bin.sync_state_with_parent() |
|
|
peer_bin.sync_state_with_parent() |
|
|
#self.pipe.sync_children_states() |
|
|
#self.pipe.sync_children_states() |
|
|
#webrtc.sync_children_states() |
|
|
#webrtc.sync_children_states() |
|
|
|
|
|
|
|
|
|
|
|
audio_src_pad.remove_probe(audio_block) |
|
|
|
|
|
video_src_pad.remove_probe(video_block) |
|
|
|
|
|
|
|
|
|
|
|
def probe_block(self, pad, info): |
|
|
|
|
|
print("blocked") |
|
|
|
|
|
return Gst.PadProbeReturn.OK |
|
|
|
|
|
|
|
|
def close_client_pipeline(self, client_sid): |
|
|
def close_client_pipeline(self, client_sid): |
|
|
print("closing client pipeline") |
|
|
print("closing client pipeline") |
|
|
webrtcbin = self._peers[client_sid]['webrtcbin'] |
|
|
webrtcbin = self._peers[client_sid]['webrtcbin'] |
|
|
peer_bin = self._peers[client_sid]['bin'] |
|
|
peer_bin = self._peers[client_sid]['bin'] |
|
|
|
|
|
|
|
|
|
|
|
audio_tee_sinkpad = self.audio_tee.get_static_pad("sink") |
|
|
|
|
|
audio_block = audio_tee_sinkpad.add_probe(Gst.PadProbeType.BLOCK_DOWNSTREAM, self.probe_block) |
|
|
|
|
|
video_tee_sinkpad = self.video_tee.get_static_pad("sink") |
|
|
|
|
|
video_block = video_tee_sinkpad.add_probe(Gst.PadProbeType.BLOCK_DOWNSTREAM, self.probe_block) |
|
|
|
|
|
|
|
|
audio_sinkpad = peer_bin.get_static_pad("audio_sink") |
|
|
audio_sinkpad = peer_bin.get_static_pad("audio_sink") |
|
|
|
|
|
audio_tee_srcpad = audio_sinkpad.get_peer() |
|
|
|
|
|
audio_tee_srcpad.unlink(audio_sinkpad) |
|
|
|
|
|
self.audio_tee.release_request_pad(audio_tee_srcpad) |
|
|
|
|
|
audio_tee_sinkpad.remove_probe(audio_block) |
|
|
|
|
|
|
|
|
video_sinkpad = peer_bin.get_static_pad("video_sink") |
|
|
video_sinkpad = peer_bin.get_static_pad("video_sink") |
|
|
audio_sinkpad.get_peer().unlink(audio_sinkpad) |
|
|
video_tee_srcpad = video_sinkpad.get_peer() |
|
|
video_sinkpad.get_peer().unlink(video_sinkpad) |
|
|
video_tee_srcpad.unlink(video_sinkpad) |
|
|
|
|
|
self.video_tee.release_request_pad(video_tee_srcpad) |
|
|
|
|
|
video_tee_sinkpad.remove_probe(video_block) |
|
|
|
|
|
|
|
|
self.pipe.remove(peer_bin) |
|
|
self.pipe.remove(peer_bin) |
|
|
peer_bin.set_state(Gst.State.NULL) |
|
|
peer_bin.set_state(Gst.State.NULL) |
|
|