shmsink question

mattes effemm at mykmk.com
Wed Dec 7 14:49:18 PST 2011


I feeding gstreamer via the shm interface from my custom app.
the file shmpipe.h  outlines shortly how to interact on the server side
(acting like a sink/server).

 * First, create a writer with sp_writer_create()
 * And selectes() on the socket from sp_get_fd()
 * If the socket is closed or there are errors from any function, the app
 * should call sp_close() and assume the writer is dead
 * The server calls sp_writer_accept_client() when there is something to read
 * from the server fd
 * It then needs to select() on the socket from sp_writer_get_client_fd()
 * If it gets an error on that socket, it call sp_writer_close_client().
 * If there is something to read, it calls sp_writer_recv().
 *
 * The writer allocates buffers with sp_writer_alloc_block(),
 * writes something in the buffer (retrieved with sp_writer_block_get_buf(),
 * then calls  sp_writer_send_buf() to send the buffer or a subsection to
 * the other side. When it is done with the block, it calls
 * sp_writer_free_block().
 * If alloc fails, then the server must wait for events from the clients before
 * trying again.


One thing that's not clear to me: Do I have to call sp_writer_alloc_block()
for every single frame I pass on to sp_writer_send_buf()?
Or is sp_writer_alloc_block() simply done once only at startup?

mattes







More information about the gstreamer-devel mailing list