Python socketpair and gstreamer multisocketsink
Krutskikh Ivan
stein.hak at gmail.com
Sat May 28 10:29:14 UTC 2016
Hi,
Can someone give me a working example of using socket.socketpair with
gstreamer multisocketsink?
No matter what I try, I get socket timeout event from gstreamer and only
one last frame from the read socket. It seams that socketpair blocks
reading until writing takes place :(
My example:
print 'creating socket for client',
self.client_address[0]
reader, writer = socket.socketpair()
reader.setblocking(False)
writer.setblocking(False)
while True:
data = reader.read(65536)
if not data:
break
self.wfile.write(data)
self.wfile.flush()
On gstreamer side:
client_id = Gio.Socket().new_from_fd(writer.fileno())
self.sink.emit("add", client_id)
while client_id in self.clients.keys():
time.sleep(1)
client_id.close()
What's wrong here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160528/42b13ae2/attachment.html>
More information about the gstreamer-devel
mailing list