PDA

View Full Version : Grabber::newMemBufferCollection



rowkajjh
March 16, 2005, 14:00:40
Do I have to do something with the buffer getting from Grabber::newMemBufferCollection? Do I have to free it?

Can I call Grabber::newMemBufferCollection multiple times without memory leaks?

Bye - Robert

Stefan Geissler
March 17, 2005, 07:49:25
Robert,

No you will not have to free it. It will be done automatically, when the grabber object is destroyed.
Yes, you can call Grabber::newMemBufferCollection multiple without creating memory leaks.

rowkajjh
March 18, 2005, 07:51:34
I love it.

btw my favourite new function of 2.0 is showDevicePage ;-)

bitsnbites13
April 12, 2005, 16:53:39
In my application the grabber object remains active until the application is stopped where I delete it.

I need to (when required) delete the memBufferCollection object(s) created by newMemBufferCollection(). I allocate on startup pointers to 4 memBufferCollection objects that I initialize with newMemBufferCollection() (I am letting newMemBufferCollection() allocate the memBuffers).

Is it possible to delete the memBufferCollection objects when I need to? I need to keep the base memBufferCollection pointers public so they be available for my worker threads.

The compiler complains when I try use the operator delete on the pointer objects (VC 7.1).

For simplicity's sake I would rather use newMemBufferCollection() instead of doing my own multiple memBuffer allocations.

In a nutshell, I am using a DFG/LC4e 4 channel frame grabber. I need to cycle (low rate) through up to 4 cameras (single snapshot) with multiple NTSC/PAL/RS170 video norms / formats that can change while the application is running.

Thanks

Stefan Geissler
April 13, 2005, 15:05:17
Hello

If you want to delete the memory buffers, you just assign NULL to them. They are reference couting "samrtPrt", that delete themselfes, if NULL is assigned to them.