have a problem with still pin capture,
we have a basic video and picture capturing project, capturing images and videos from capture pin is okay, but once i try to connect still pin (which is found succesfully by FindPin) to samplegrabber, it fails with hresult = E_FAIL/Unspecified failure/0x80004005,
the steps of the alrorythm is as follows (written in delphi, i have deleted the names of the variables):
initializing interfaces, succesful search for the device, adding video capture filter;
FindPin( 'capture filter' , // Filter. PINDIR_OUTPUT, // Look for an output pin. @PIN_CATEGORY_STILL, // Pin category. Nil, // Media type (don't care). False, // Pin must be unconnected. 0, // Get the 0'th pin. 'still pin' // Receives a pointer to thepin. ); this procedure finds pin succesfully;
CoCreateInstance(CLSID_SampleGrabber, NIL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, 'sample grabber filter'); succesful;
'sample grabber filter'.QueryInterface(IID_ISampleGrabber, 'isamplegrabber object'); succesful;
'graph builder'.AddFilter (VCOISampleGrabFilter, 'Sample Grabber'); succesful;
CoCreateInstance(CLSID_NullRenderer, NIL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, 'null renderer filter'); succesful;
'graph builder'.AddFilter (VCONullRendererFilter, 'Null Renderer'); succesful;
'isamplegrabber object'.SetBufferSamples(True); 'isamplegrabber object'.SetOneShot(False); succesful;
'graph builder 2'.RenderStream (@PIN_CATEGORY_STILL, @MEDIATYPE_Video, 'video capture filter', 'sample grabber filter', 'null renderer filter'); there is where it is fails, after this alrotythm, if i look at the graph (have wrote the procedure for this), it looks like just 3 unconnected filters;
didn't use callback function for sample grabber, just get shots by using GetCurrentBuffer,
actually, this algorythm (only for capture pin) works alright,
algorythm was adopted from http://msdn.microsoft.com/ru-ru/library/windows/desktop/dd318622%28v=vs.85%29.aspx,
also have tried another parameters for RenderStream, the same error occurs,
also tried using 'graph builder'.Connect function with 2 finded pins (out-still, in-samplegrabber), it also fails,
have anyone experienced the same? it is weird, at the first sight i thought that it is enough just to change PIN_CATEGORY_CAPTURE to PIN_CATEGORY_STILL and it will be fine,
the camera is 100% have working still pin (it is working with another programs),
i am rewriting microsoft's AmCap to try the same for now, but, unfortunately it is not finished yet,
thanks, igor.