I’m trying to retrieve the IAMStreamConfig interface from the output pin on my Integrated Camera, but am failing to E_NOINTERFACE.
I’m using the IntCam as a testing device, in reality I will have a source filter with two output pins that each support different configurations.
This is why I’m not sure using ICaptureGraphBuilder2::FindInterface is an option, because I still haven’t figured out how I will be able to get the interface from a specific output pin.
CComPtr<IEnumPins> pEnum = NULL;
IPin* pPin = NULL;
HRESULT hr = pFilter->EnumPins(&pEnum);
if (FAILED(hr))
return hr;
while (S_OK == pEnum->Next(1, &pPin, NULL))
{
IAMStreamConfig* pAMStreamConfig;
hr = pPin->QueryInterface(IID_PPV_ARGS(&pAMStreamConfig));
if (FAILED(hr))
return hr;
// ...
}
IAMStreamConfigis not a mandatory interface, it might me missing, though on camera filters it is almost always available (many application would refuse working with a device without this interface otherwise). That is, you should double check that you are querying correct filter and pin, the code snippet looks good.A real camera is most often implemented via
WDM Video Capture Filterwhich hasIAMStreamConfigbut since you are using a virtual device, it might be different.