IAMStreamSelect Interface

The IAMStreamSelect interface controls which logical streams are played and retrieves information about them.

Implement this interface on your filter when you want to enable selection of logical streams and provide information about them. An example of logical stream selection is selection from a set of audio streams that encode different national languages. Perhaps you could choose English from among a set of audio streams that include English, German, and French. The MPEG splitter implements this interface.

Use this interface when you want to select between available streams; for example, when you want to select the streams for a particular locale.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IAMStreamSelect methodsDescription
Count Retrieves the total count of available streams.
Info Retrieves information about a given stream.
Enable Enables or disables a given stream.

IAMStreamSelect::Count

IAMStreamSelect Interface

Retrieves the total count of available streams.

Syntax

HRESULT Count(
  DWORD *pcStreams
  );

Parameters

pcStreams
[out] Pointer to a value indicating the number of available streams.

Return Value

Returns an HRESULT value that depends on the implementation of the interface. The current Microsoft® DirectShow® implementation returns S_OK.

IAMStreamSelect::Enable

IAMStreamSelect Interface

Enables or disables a given stream.

Syntax

HRESULT Enable(
  long lIndex,
  DWORD dwFlags
  );

Parameters

lIndex
[in] Index number of desired stream. Zero-based.
dwFlags
[in] Flag indicating whether to enable or disable the stream. Valid values include the following:
Zero Disable all streams in the group containing this stream.
AMSTREAMSELECTENABLE_ENABLEEnable only this stream within the given group and disable all others.
AMSTREAMSELECTENABLE_ENABLEALLEnable all streams in the group containing this stream.

Return Value

Returns an HRESULT value that depends on the implementation of the interface. The current DirectShow implementation returns E_NOTIMPL if support for the specified flag has not been implemented, E_INVALIDARG if the stream ID is invalid, or S_OK otherwise.

IAMStreamSelect::Info

IAMStreamSelect Interface

Retrieves information about a given stream.

Syntax

HRESULT Info(
  long lIndex,
  AM_MEDIA_TYPE **ppmt,
  DWORD *pdwFlags,
  LCID *plcid,
  DWORD *pdwGroup,
  WCHAR **ppszName,
  IUnknown **ppObject,
  IUnknown **ppUnk
  );

Parameters

lIndex
[in] Index number of desired stream. Zero-based.
ppmt
[out] Address of a pointer to the stream's media type. Optional. Use the DeleteMediaType function to free the AM_MEDIA_TYPE structure when done.
pdwFlags
[out] Optional pointer to flags indicating the stream state. Valid values include the following:
ZeroThis stream is disabled.
AMSTREAMSELECTINFO_ENABLEDThe stream is enabled, and others in this group might be enabled too.
AMSTREAMSELECTINFO_EXCLUSIVEThis stream is the only enabled stream in the group.
plcid
[out] Pointer to the locale context (LCID) value. This parameter points to a zero value if there is no LCID. Optional.
pdwGroup
[out] Pointer to the logical group. Optional.
ppszName
[out] Address of a pointer to the stream name. Optional. Free with the CoTaskMemFree function when done.
ppObject
[out] Address of a pointer to the pin or filter object associated with this stream. Optional. The object can change if the IAMStreamSelect::Enable method is called. This parameter contains a null value upon return from this method if there is no associated object.
ppUnk
[out] Address of a pointer to a stream-specific interface.

Return Value

Returns an HRESULT value that depends on the implementation of the interface. The current DirectShow implementation returns S_FALSE if lIndex is out of range, or S_OK otherwise.

Remarks

The first stream in each group is the default.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.