ISampleGrabber undeclared identifier

╄→尐↘猪︶ㄣ 提交于 2020-12-15 09:51:52

问题


I'm trying to execute a code generated by graphEditPlus (using VS2010) but having a trouble with the following line:

CComQIPtr<ISampleGrabber, &IID_ISampleGrabber> pSampleGrabber_isg(pSampleGrabber);

where the errors are: error C2065: 'ISampleGrabber' : undeclared identifier error C2065: 'IID_ISampleGrabber' : undeclared identifier error C2514: 'ATL::CComQIPtr' : class has no constructors

I tried downloading different versions of Windows SDK (V7.1, V6.0A, V5) and set the include / lib paths but still having the same problem!

Is the SampleGrabber still being supported? Mainly, the SampleGrabber is used in my code to grab frames from a video capturing source...

Thanks for your assistance...


回答1:


Microsoft deprecated Sample Grabber and the entire DES API, however you if you import the type library, or just copy the declarations into your project - the component is still usable except some very latest OS releases (Windows Server 2008?) where it is completely gone and you might need another solution such as building your own from earlier SDK samples.

See ISampleGrabber deprecated: where can I find alternatives? for more information.

See also RenderWmvVideo.cpp with code fragment to copy/paste and re-add the declarations to your project (#pragma section at the top of the file):

#pragma region Windows SDK Tribute, qedit.h

struct __declspec(uuid("0579154a-2b53-4994-b0d0-e773148eff85"))
ISampleGrabberCB : IUnknown
{

...

#pragma endregion


来源:https://stackoverflow.com/questions/23281086/isamplegrabber-undeclared-identifier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!