PDA

View Full Version : Saving individual buffers from a memBufferCollection



Unregistered
April 28, 2004, 03:13:54
I have set up a ring of images with

m_pGrabber->setActiveMemBufferCollection(m_pGrabber->newMemBufferCollection(256));

I use getCollectionPosition to identify the starting position ringStartPos for 160 image beffers I intend to fill. I fill those 160 images buffers ringStartPos to ringStartPos+159. I now want to save only those 160 images. How to do it?

Thanks

Stefan Geissler
April 29, 2004, 08:15:08
Hello,

you can do following:


DWORD i;
DWORD dwSaved;

dwSaved = 0;
for( i = buffer.getCollectionPos(); i < 256 && dwSaved < 160; i++)
{
// Save here...
dwSaved++;
}

// End of the list is reached, now start ad beginning of the list.
for( i = 0; i < 160 && dwSaved < 160; i++)
{
// Save here...
dwSaved++;
}