I am enumerating the UVC properties for a camera using IKsTopologyInfo and IKsControl interface. I am using both MFT and Direct Show this code.during enumeration I get various GUID for example CLSID_IAMCameraControl, CLSID_IAMVideoProcAmp and many more.
Now IAMVideoProcAmp Support 10 properties and IAMCameraControl supports 7 properties
Not all camera supports all the property items.I wanted to know exact properties(enum index/value) supported by a any camera.Can we query this using IKsTopologyInfo and IKsControl ?Is ther other way to so this.
Here is the code to enumerate properties i.e. this code gives me interface CLSID_IAMCameraControl,CLSID_IAMVideoProcAmp
HRESULT hRet = S_OK;
CComPtr<IKsTopologyInfo> ksTopology = NULL;
BYTE* pList = NULL;
do
{
if(!m_pMediaSource)
break;
if(m_SuppPropSetGUIDS.size())
break;
hRet = m_pMediaSource->QueryInterface(IID_PPV_ARGS(&ksTopology));
if(FAILED(hRet))
break;
ksTopology->get_NumNodes(&m_dwNumNodes);
for (ULONG ulNode=0; ulNode < m_dwNumNodes; ulNode++ )
{
CComPtr<IKsControl> ksControl = 0;
GUID nodeType = GUID_NULL;
DWORD dwBytesReturned = 0;
KSPROPERTY KsProp = {0};
KsProp.Set = GUID_NULL;
KsProp.Id = 0; // Ignored
KsProp.Flags = KSPROPERTY_TYPE_SETSUPPORT;
KSP_NODE KsNode = {0};
KsNode.Property.Set = GUID_NULL;
KsNode.NodeId = ulNode;
KsNode.Property.Flags = KSPROPERTY_TYPE_SETSUPPORT;
ksTopology->get_NodeType(ulNode, &nodeType);
hRet = ksTopology->CreateNodeInstance(ulNode, IID_PPV_ARGS(&ksControl));
if(FAILED(hRet))
continue;
hRet = ksControl->KsProperty(&KsProp, sizeof(KSPROPERTY), NULL, NULL, &dwBytesReturned);
if( hRet == HRESULT_FROM_WIN32(ERROR_MORE_DATA) && dwBytesReturned )
{
pList = (BYTE*)calloc(dwBytesReturned, sizeof(BYTE) );
if ( pList == NULL )
continue;
hRet = ksControl->KsProperty(&KsProp, sizeof(KSPROPERTY), pList, dwBytesReturned, &dwBytesReturned);
if(FAILED(hRet))
break;
}
else
continue;
GUID* pGuidList = (GUID*)pList;
int iCount = dwBytesReturned/sizeof(GUID);
for(int i = 0; i < iCount; i++ )
{
if( !LookUpPS( &pGuidList[i] ) )
m_SuppPropSetGUIDS.push_back( pGuidList[i] );
}
if(pList)
free(pList);
pList = NULL;
}
}while(FALSE);
if(pList)
free(pList);
pList = NULL;
return hRet;