[gst-devel] tcp elements

Thomas Vander Stichele thomas at apestaart.org
Tue Apr 27 10:00:01 CEST 2004


Hi,

so I've run into a problem I'm not completely sure how to handle
correctly.

Suppose one pipeline is encoding to jpeg and sending out buffers over
tcp.  A second pipeline is receiving these buffers and decoding them
from jpeg.

To get this right, the second pipeline needs to serve one JPEG frame per
buffer to jpegdec.  The size of this buffer is variable between frames,
of course.  So there needs to be a way for the second pipeline to know
the size of each buffer from the first pipeline.

In one direction (ie. a tcp client in the first pipeline and a server in
the second), this could be made to work; the client just performs a
write to the server with the buffer size, and IIRC there's an ioctl the
server can use to check how much data the client wants to write (which
probably maps to the complete TCP frame size).

In the other direction, this doesn't work; the server in the first
pipeline is the one that knows about buffer sizes, and just performs a
select waiting for clients doing a read.  The clients do a read with a
given size, which will only be satisfied when the server has written
that many bytes.

Anyways, in both directions, it might make sense to wrap the buffers
with a small header giving the buffer length.  That enables the other
side to reconstruct buffers.  And if we're doing that, we might as well
also put in timestamp and other info.

It could be controlled with an enum that was in the old tcp elements for
something similar.

What do you think about this approach ?

Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
Careful stays and careless dies
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/






More information about the gstreamer-devel mailing list