[gst-devel] Using fdsrc with a socket

David Johnson dj at david-web.co.uk
Wed May 23 18:13:53 CEST 2007


Hi,

I'm trying to get GStreamer to playback data that's coming into a socket and 
it looks like fdsrc is the tool for the job - I can't use tcpclientsrc as I 
need to talk on the socket before the server will start sending data to it. 
I'm using Python.

I currently do the following:
* set up the socket
* tell the server to start sending data
* start reading data (an MPEG2 transport stream) from the socket using 
socket.read() in a thread (not storing it anywhere, just reading it)
* set up my GStreamer pipeline
* get the file descriptor from socket.fileno() and pass it to the fdsrc
* start GStreamer playback

However GStreamer isn't seeing any data. The pipeline works if I use, for 
example, a filesrc so that part of things is OK and I am getting data through 
the socket (if I save it to a file, I can play it back using GStreamer).

Am I doing something wrong/missing something? Can fdsrc actually be used in 
this way? If so, are there any code examples out there? There seems to be a 
file associated with flumotion that does this, but there's a lot of other 
things going on and it's not too easy to follow.

Any help would be much appreciated.

Thanks,
David.

-- 
David Johnson
www.david-web.co.uk




More information about the gstreamer-devel mailing list