IAMVideoCompression::GetInfo
This method retrieves information about the filter's compression properties, including capabilities and default values.
HRESULT GetInfo(
WCHAR* pszVersion,
int* pcbVersion,
LPWSTR pszDescription,
int* pcbDescription,
long* pDefaultKeyFrameRate,
long* pDefaultPFramesPerKey,
double* pDefaultQuality,
long* pCapabilities
) PURE;
Parameters
- pszVersion
[out] Pointer to a WCHAR buffer that receives a version string, such as "Version 2.1.0." - pcbVersion
[in, out] Pointer to an int variable that receives the size of the version string, in bytes. - pszDescription
[out] A LPWSTR buffer that receives a description string, such as "My Video Compressor." - pcbDescription
[in, out] Pointer to an int variable that receives the size of the description string. - pDefaultKeyFrameRate
[out] Pointer to a long variable that receives the default key-frame rate. - pDefaultPFramesPerKey
[out] Pointer to a long variable that receives the default rate of predicted (P) frames per key frame. - pDefaultQuality
[out] Pointer to a double variable that receives the default quality. - pCapabilities
[out] Pointer to a long variable that receives the compression capabilities, as a bitwise combination of zero or more CompressionCaps flags.
Return Values
Returns an HRESULT value.
Remarks
Any of the listed parameters can be NULL, in which case the method ignores that parameter.
The application must allocate the buffers for the version and description strings. To determine the required size of the buffers, call this method with NULL for the pszVersion and pszDescription parameters. Use the values returned in pcbVersion and pcbDescription to allocate the buffers and then call the method again, as shown in the following code:
int cbVersion, cbDesc; // Size in bytes, not characters!
hr = pCompress->GetInfo(0, &cbVersion, 0, &cbDesc, 0, 0, 0, 0);
if (SUCCEEDED(hr))
{
WCHAR *pszVersion = new WCHAR[cbVersion/2]; // Wide character = 2
bytes
WCHAR *pszDesc = new WCHAR[cbDesc/2];
if (pszVersion && pszDesc)
{
hr = pCompress->GetInfo(pszVersion, 0, pszDesc, 0, 0, 0, 0, 0);
}
delete [] pszVersion;
delete [] pszDesc;
}
Note that the strings are wide-character strings, and the returned sizes are in bytes, not number of characters. Also, one or both strings might be zero-length.
The pCapabilities parameter receives a set of flags indicating which compression properties are supported, and thus which IAMVideoCompression interface methods are supported. For example, if the CompressionCaps_CanKeyFrame flag is returned, the filter supports the IAMVideoCompression::get_KeyFrameRate and IAMVideoCompression::put_KeyFrameRate methods.
The remaining parameters receive default values for the compression properties. For unsupported properties (as determined by the flags returned in pCapabilities), you should ignore the corresponding default value, as it may not be correct or meaningful.
Requirements
DirectShow applications and DirectShow filters have different include file and link library requirements. See Setting Up the Build Environment for more information.
Pocket PC: Windows Mobile 5.0 and later
Smartphone: Windows Mobile 5.0 and later
OS Versions: Windows CE 5.01 and later.
Header:
See Also
IAMVideoCompression Interface | IAMVideoCompression interface | IAMVideoCompression::get_KeyFrameRate | IAMVideoCompression::put_KeyFrameRate
Send Feedback on this topic to the authors