IAMStreamSelect::Info method (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The Info method retrieves information about a given stream.

Syntax

HRESULT Info(
  [in]  long          lIndex,
  [out] AM_MEDIA_TYPE **ppmt,
  [out] DWORD         *pdwFlags,
  [out] LCID          *plcid,
  [out] DWORD         *pdwGroup,
  [out] LPWSTR        *ppszName,
  [out] IUnknown      **ppObject,
  [out] IUnknown      **ppUnk
);

Parameters

[in] lIndex

Zero-based index of the stream.

[out] ppmt

Address of a variable that receives a pointer to the stream's media type. This parameter is optional and can be NULL. If the value is non-NULL, the method returns a pointer to an AM_MEDIA_TYPE structure. The caller must delete the structure, including the format block. (You can use the DeleteMediaType function from the DirectShow base-class library.)

[out] pdwFlags

Pointer to a variable that receives one of the following values:

Value Description
Zero This stream is disabled.
AMSTREAMSELECTINFO_ENABLED The stream is enabled, and others in this group might be enabled too.
AMSTREAMSELECTINFO_EXCLUSIVE This stream is the only enabled stream in the group.
 

This parameter is optional and can be NULL.

[out] plcid

Pointer to a variable that receives a locale context (LCID) value. If the stream is associated with a particular locale, the LCID is returned in this variable. Otherwise, the variable receives the value zero. This parameter is optional and can be NULL.

[out] pdwGroup

Pointer to a variable that receives the logical group with which the stream is associated. This parameter is optional and can be NULL.

[out] ppszName

Address of a variable that receives a pointer to the stream name. The caller must free the returned string by calling the CoTaskMemFree function. This parameter is optional and can be NULL.

[out] ppObject

Address of a variable that receives an IUnknown interface pointer. The method might return a pointer to a pin or filter associated with the stream, or it might return the value NULL. If the method returns a non-NULL value, the caller must release the IUnknown pointer.

Calling the IAMStreamSelect::Enable method might invalidate the object returned by this method.

This parameter is optional and can be NULL.

The MPEG-1 Stream Splitter, MPEG-2 Splitter, and SAMI (CC) Parser filters return a pointer to the pin associated with the selected stream.

[out] ppUnk

Address of a variable that receives an IUnknown interface pointer. The method might return a pointer to an interface that is specific to the stream, or it might return the value NULL. If the method returns a non-NULL value, the caller must release the IUnknown pointer. This parameter is optional and can be NULL.

The MPEG-1 Stream Splitter, MPEG-2 Splitter, and SAMI (CC) Parser filters all return the value NULL. Third party filters might return a pointer to a custom filter interface.

Return value

Returns an HRESULT value. Possible values include the following.

Return code Description
E_FAIL
Failure.
E_OUTOFMEMORY
Insufficient memory.
S_FALSE
The index is out of range.
S_OK
Success.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IAMStreamSelect Interface