View Full Version : Locking Buffers

March 23, 2004, 19:54:24

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?



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

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.