Hi, I want to create a pipeline with multisocketsink, add a socket to it and then read from it as a normal python socket.client_id = Gio.Socket().new_from_fd(wfile.fileno()) self.clients.append(client_id) self.sink.emit("add", client_id) So I wanted to make a more manual approach: client_id = Gio.Socket() client_id.set_timeout(1) self.clients.append(client_id) while True: data = client_id.receive(1024) if not data: break else: wfile.write(data) wfile.flush() But that does not work. I see socket being added to multisocket sink and removed after timeout. No data is passed to wfile. Just to be clear: I tried using python's own socket module, but I cannot even add this socket to gstreamer. :( Thanks in advance! _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Mo, 2016-03-21 at 14:17 +0300, Krutskikh Ivan wrote:
> Hi, > > I want to create a pipeline with multisocketsink, add a socket to it > and then read from it as a normal python socket. > [...] The socket you pass to multisocketsink is not supposed to be used anymore from the application. multisocketsink handles and owns it. You could create a socket pair though, pass one part of the pair to multisocketsink and then read from the other part of the pair from your Python application. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
Thanks! Would this work with vanilla socket or I should stick with Gio.Socket ?2016-03-22 11:38 GMT+03:00 Sebastian Dröge <[hidden email]>: On Mo, 2016-03-21 at 14:17 +0300, Krutskikh Ivan wrote: _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Di, 2016-03-22 at 12:42 +0300, Krutskikh Ivan wrote:
> Thanks! > > Would this work with vanilla socket or I should stick with Gio.Socket > ? GSocket is just an API around normal sockets. But multisocketsink requires sockets to be wrapped in a GSocket. > I believe I can use socketpair to connect gstreamer multisocketsink > to another gstreamer chain with socketsrc, am I right? Yes that should work -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
GSocket is just an API around normal sockets. But multisocketsink Well, I was wondering because python has socket.socketpair element and Gio.Socket() does not. How can I wrap a socket in a GSocket then? 2016-03-22 12:50 GMT+03:00 Sebastian Dröge <[hidden email]>: On Di, 2016-03-22 at 12:42 +0300, Krutskikh Ivan wrote: _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Maybe something really stupid like: sock = socket.socket()client_id = Gio.Socket().new_from_fd(sock.fileno()) 2016-03-22 13:04 GMT+03:00 Krutskikh Ivan <[hidden email]>:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Di, 2016-03-22 at 13:46 +0300, Krutskikh Ivan wrote:
> Maybe something really stupid like: > > sock = socket.socket() > client_id = Gio.Socket().new_from_fd(sock.fileno()) > > and so on... Exactly like that :) -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
This hurts my brain... But thanks non the less! =)2016-03-22 15:30 GMT+03:00 Sebastian Dröge <[hidden email]>: On Di, 2016-03-22 at 13:46 +0300, Krutskikh Ivan wrote: _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |