Partager via


ISelector Interface

 
Microsoft DirectShow 9.0

ISelector Interface

This topic applies to Windows XP Service Pack 2 and later.

The ISelector interface is used to select source nodes in a stream class driver. Applications can use this interface to select which input is active on the device. For example, if a USB video capture device has a camera and a tape transport, these inputs could be represented as source nodes.

In addition to the methods inherited from IUnknown, the ISelector interface exposes the following methods.

Method Description
get_NumSources Returns the number of source nodes connected to the selector node.
get_SourceNodeId Returns the index of the active source node.
put_SourceNodeId Activates a source node.

Remarks

A kernel-streaming (KS) filter contains one or more nodes. Each node encapsulates a processing task that is applied to the stream. In the following diagram, nodes 1 and 2 are source nodes and node 3 is a selector node.

KsProxy nodes

The source nodes represent input streams — for example, a camera or a tape transport. The selector node controls which stream is sent to the filter's output pin. To switch between inputs, an application would do the following:

  1. Use the IKsTopologyInfo interface to enumerate the nodes and discover the node types, identifiers, and names.
  2. Call IKsTopologyInfo::CreateNodeInstance to create the selector node, passing in the node identifier and the interface identifier IID_ISelector. The method returns an ISelector interface pointer.
  3. Use the ISelector interface to select the source node.

The ISelector interface is available if the selector node supports the PROPSETID_VIDCAP_SELECTOR property set. For more information, see the Windows DDK documentation.

Requirements

Header: Include Vidcap.h.

Library: None.