Date Tags Misc

Long time no blog, eh? Anyway I was today hooking up Telepathy Stream Tubes with GStreamer so that I could stream video over local-xmpp, go figure why… :)

Everything was fine:

  • on one side, offer a stream tube in a multi-user room and setup a pipeline like this one:

    videotestsrc ! gdppay ! multifdsink
  • on client side, join the room and accept the tube, hooked into the following pipeline with a socket:

    fdsrc ! gdpdepay ! xvimagesink
  • when server is notified of new client, add its socket fd in multifdsink and start playback

But it wasn’t working, multifdsink was removing the fd by itself from the list and client wasn’t receiving data. I spent some time this afternoon trying to figure out why and thought I might share the solution, if it can serve to anyone using multifdsink in Python. Because I wasn’t keeping references of the client socket instances in my code, they were garbage-collected by Python, so the fd was becoming invalid, hence the rejection by multifdsink.

Keeping a list of the socket instances and cleaning it up when the sink emits the client-removed signal does the trick and I got my video streaming over local-xmpp working. Those Tubes are so much fun, thanks Collabora & Telepathy folks for this nice stuff!