IAMVideoCompression Interface
Top  Previous  Next

Description

Provides the name and serial number of the currently selected camera.


Methods

HRESULT GetInfo ( WCHAR *pszVersion
, int *pcbVersion, LPWSTR pszDescription, int *pcbDescription, NULL, NULL, NULL, NULL )
 
Parameters

pszVersion  
[out] Pointer to a version string, such as "Version 2.1.0".  
pcbVersion  
[in, out] Size needed for a version string. Pointer to the number of bytes in the Unicode™ string, not the number of characters, so it must be twice the number of characters the string can hold. Call with this set to NULL to retrieve the current size.  
pszDescription  
[out] Pointer to a camera description.  
pcbDescription  
[in, out] Size needed for a description string. Pointer to the number of bytes in the Unicode string, not the number of characters, so it must be twice the number of characters the string can hold. Call with this set to NULL to retrieve the current size.  
 
Return Values

S_OK  
Success  
E_FAIL  
Failure.  
E_INVALIDARG  
Invalid argument.  
 

Example


This C++ code request a pointer to IAMVideoCompression interface from the video capture filter and retrieves the information about the current camera:

IAMVideoCompression *pVideoCompression;
HRESULT hr;
int versize = VERSIZE;
int descsize = DESCSIZE;
WCHAR wachVer[VERSIZE]={0}, wachDesc[DESCSIZE]={0};
TCHAR camName[VERSIZE + DESCSIZE + 5]={0};
hr = pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE,
         &MEDIATYPE_Video, pFilter,
         IID_IAMVideoCompression, (void **)&pVideoCompression);
if(hr==S_OK)
{
   hr = pVideoCompression->GetInfo(wachVer, &versize, wachDesc, &descsize, NULL, NULL, NULL, NULL);
   if(hr==S_OK)
      if(wcslen(wachDesc) && wcslen(wachVer))
            wsprintf(camName, TEXT("%s - %s\0"), W2T(wachDesc), W2T(wachVer));
}
 
 
Remarks

IAMVideoCompression is a standard DirectShow interface. Refer to Microsoft DirectX SDK documentation for more details.