PDA

View Full Version : Grabber::getUserMemBufferSize gives unexptected value



roncordell
October 20, 2003, 03:53:10
I've got the 1394 FW FrameGrabber, and am setting it up to use RGB8 640x 480.
The steps I use are:

Instantiate the Grabber,
Set the video input channel,
Set the video norm (NTSC),
Set the vidoe Format (RGB8 640x480)
Allocate the MemBufferCollection
etc.

To allocate correctly sized buffers for the capture ring buffer collection, I use the method Grabber::getUserMemBufferSize. However, this is returning the value 921600 (640x480x3), when I expect 1/3 that size of 307200 (640x480x1).

Since I am specifying RGB, am I getting a larger buffer for three color planes? If so, is the image data the same for each color plane, or do the planes have to be added or normalized?

Thanks!

Stefan Geissler
October 20, 2003, 08:57:20
Hello,

The default sink type is set to RGB 24. Therefore, you get 640x480x3 bytes of memory allocated. The RGB8 image will be converted to a RGB 24 image. To get a RGB 8 image in the memory buffer, you have to set the sinktype:


grabber->setSinkType( FrameGrabberSink( FrameGrabberSink::tFrameGrabberMode::eSNAP, DShowLib::eY8 ) );


Please remark, that the eY8 /RGB8 format is a black/white format in IC Imaging Control.

roncordell
October 20, 2003, 19:42:39
OK, so it's OK to set the memory buffer collection after setting the sink type, then? I don't want to have to allocate more memory than is necessary for the buffers.

And, to be sure, what we want is black and white, 8 bit (or even 10-12 bits if we could get it!) .

Thanks!

-ronc