Microsoft DirectX 8.1 (C++)

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] Pointer to a variable that 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] Pointer to a variable that receives the size of the description string.

pDefaultKeyFrameRate

[out] Pointer to a variable that receives the default key-frame rate.

pDefaultPFramesPerKey

[out] Pointer to a variable that receives the default rate of predicted (P) frames per key frame.

pDefaultQuality

[out] Pointer to a variable that receives the default quality.

pCapabilities

[out] Pointer to a 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];
    hr = pCompress->GetInfo(pszVersion, 0, pszDesc, 0, 0, 0, 0, 0);
}

Note that the strings are wide-character strings, and the returned sizes are in bytes, not number of characters. 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.

See Also