IAMVideoCompression::GetInfo
Microsoft DirectShow 9.0 |
IAMVideoCompression::GetInfo
The GetInfo method retrieves information about the filter's compression properties, including capabilities and default values.
Syntax
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 buffer that receives a version string, such as "Version 2.1.0."
pcbVersion
[in, out] Receives the size of the version string, in bytes.
pszDescription
[out] Pointer to a buffer that receives a description string, such as "My Video Compressor."
pcbDescription
[in, out] Receives the size of the description string, in bytes.
pDefaultKeyFrameRate
[out] Receives the default key-frame rate.
pDefaultPFramesPerKey
[out] Receives the default rate of predicted (P) frames per key frame.
pDefaultQuality
[out] Receives the default quality.
pCapabilities
[out] 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:
// Get the size of the version and description strings, in bytes. int cbVersion, cbDesc; hr = pCompress->GetInfo(NULL, &cbVersion, NULL, &cbDesc, NULL, NULL, NULL, NULL); if (SUCCEEDED(hr)) { // Allocate the buffers. WCHAR *pszVersion = new WCHAR[cbVersion / sizeof(WCHAR)]; WCHAR *pszDesc = new WCHAR[cbDesc / sizeof(WCHAR)]; // Now query for the strings. hr = pCompress->GetInfo(pszVersion, &cbVersion, pszDesc, &cbDesc, NULL, NULL, NULL, NULL); } 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 methods are supported. For example, if the CompressionCaps_CanKeyFrame flag is returned, it 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
Header: Declared in Strmif.h; include Dshow.h.
Library: Use Strmiids.lib.
See Also