PDA

View Full Version : Locking Buffers



Kay
March 23, 2004, 18:54:24
Stefan,

Let's say that I set the sink type to FrameGrabberSink and allocate 4 buffers in the memory buffer collection. I set up 'grabmode' and start the frame grabber with 'startLive'.

The question is: Do I need to 'lock' each buffer during the frameReady callback in order for the class library to know to put the next frame in the next buffer in the collection?

Thanks,

Peter

Stefan Geissler
March 24, 2004, 08:09:31
Peter,

No, you do not. The memory buffer is a ring buffer. This means the buffers are filled in sequence automatically if they are not locked. It is started with the first buffer. When the last buffer was filled, it starts again with the first buffer.

The buffer locking is necessary to prevend a buffer from being overwritten.