View Full Version : tColorformatEnum enumerations "undeclared identifier"

April 14, 2005, 14:06:33
When I try to use newMemBufferCollection(), the compiler returns " 'eRGB24' undeclared indentifier".

A sample line:
m_dlg -> m_buf1Collection1 = m_dlg -> m_grabber -> newMemBufferCollection(RGB24MEM, eRGB24, m_frames);

RGB24MEM is a constant (640*480*3).

I have successfully used newMemBufferCollection() where I specify my own buffers, but without specfying the color format.

Note that the memBufferCollection sample also fails compilation if I try to use a color format enumeration variant for the collection allocation.

What gives?

BTW thanks for the response for my other post.


Stefan Geissler
April 14, 2005, 15:33:35

you need you use the name space DShowLib. You may write:
using namespace DShowLib;
at top your CPP or you can use it directly:

April 14, 2005, 17:11:12
I inserted the namespace declaration. The enums are now found but I now have this error:

(SIZE,DShowLib::tColorformatEnum, DWORD)const: cannot convert parameter 2 from 'DShowLib::tColorformatEnum' to 'SIZE'.

No constructor could take the source type, or constructor overload resolution was ambiguous.

Once again I'm stomped!



Stefan Geissler
April 15, 2005, 09:57:25

The type SIZE, that is the first parameter of some of the newMemBufferCollection implementations is a struct, not a single DWORD or int:

typedef struct tagSIZE
LONG cx;
LONG cy;

So the first parameter you pass (RGB24MEM) is interpreted as DWORD and the following implementation is tried to be used by the compiler:

tMemBufferCollectionPtr newMemBufferCollection( DWORD buffersize,
BYTE* buffers [],
DWORD count ) const;

This does not match to your parameters anyway. You can solve your problem in two ways:

SIZE ImageSize;
ImageSize.cx = 640;
ImageSize.cy = 480;
Grabber::tMemBufferCollectionPtr pMemBuffColl = grabber->newMemBufferCollection( ImageSize, DShowLib::eRGB24, m_frames );

Or much more easier, after you have assigned the frame grabber sink:

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

Grabber::tMemBufferCollectionPtr pMemBuffColl = grabber->newMemBufferCollection(m_frames );

This creates the correct buffer size, because the grabber already knows the video format and the color format in memory.

April 15, 2005, 13:01:22
For some reason I did not clue in that the SIZE parameter was a windows definition, although I did use it in other GDI+ applications.

I had a mindset that this was ClassLib object. Duhh...

Thanks for all the help.