DirectShow Animated Header -- IAMStreamSelect Interface DirectShow Animated Header -- IAMStreamSelect Interface* Microsoft DirectShow SDK
*Index  *Topic Contents
*Previous Topic: IAMStreamControl Interface
*Next Topic: IAMTimecodeDisplay Interface

IAMStreamSelect Interface


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

When to Implement

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.

When to Use

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 methods Description
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IAMStreamSelect methods Description
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.

HRESULT Count(
  DWORD *pcStreams
  );

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

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


IAMStreamSelect::Enable

IAMStreamSelect Interface

Enables or disables a given stream.

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:
ValueMeaning
Zero Disable all streams in the group containing this stream.
AMSTREAMSELECTENABLE_ENABLE Enable only this stream within the given group and disable all others.
AMSTREAMSELECTENABLE_ENABLEALL Enable all streams in the group containing this stream.
Return Values

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.

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] Pointer to flags. Optional. Valid values include the following:
ValueMeaning
Zero Disable this stream.
AMSTREAMSELECTINFO_ENABLED Enable the stream.
AMSTREAMSELECTINFO_EXCLUSIVE Turns off the other streams in the group when enabling this one.
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] Pointer to the stream name. Optional. Free with the CoTaskMemFree function when done.
ppObject
[out] 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 Values

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.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page