shmsink question

Olivier Crête olivier.crete at collabora.com
Thu Dec 8 16:14:53 PST 2011


On Thu, 2011-12-08 at 15:06 -0800, mattes wrote:
> 
> thanks for the info, I implemented it as you said.
> One first thing I noticed was that alloc_block() returns NULL once in
> a while.
> It seems that a block is not immediately available after free_block().
> Does this mean the block is still in use by the consumer(client)?

Exactly, yes.

> Is there magic number for the SHM memory size (set by
> sp_writer_create()) ?
> How many blocks/frames should fit the SHM memory to have a fluent
> frame flow,
> when doing video encoding? 

There isn't a magic number as it really depends on your application etc.
Normally, one 2 frames should be enough. It will block your writer side
regularly, but that just means it will allow the kernel to schedule the
receiver side. Obviously, you can buffer up more in the shared memory,
but that does increase the latency if you have a live pipeline, but it
will probably reduce the number of times the kernel has to reschedule in
a non-live case so it will increase throughput.. So it really is the
traditional throughput vs latency problem.

-- 
Olivier Crête
olivier.crete at collabora.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111208/8b7fe687/attachment.pgp>


More information about the gstreamer-devel mailing list