CCrossbar Class

CCrossbar class hierarchy

The CCrossbar class controls video crossbars. The crossbar filter is modeled after a general switching matrix, with n inputs and m outputs. Any of the input signals can be routed to one or more of the outputs.

This class creates a single object that encapsulates all connected crossbars. CCrossbar enumerates all unique inputs that can be reached from a given starting pin and automatically routes audio when a video source is selected.

CCrossbar supports an arbitrarily complex graph of crossbar filters. These filters can be layered and can contain dead inputs and outputs. CCrossbar can enumerate all the possible inputs and select a single input for recording and viewing.

Given a starting input pin (typically the analog video input to the capture filter), this class recursively traces upstream searching for all viable inputs. An input is considered viable if it is a video pin and is either unconnected or is connected to a filter that does not support the IAMCrossbar interface.

Member Functions

CCrossbar Constructs a CCrossbar object.
GetInputCount Retrieves the number of unique video inputs that can be selected.
GetInputIndex Retrieves the currently selected input.
GetInputName Retrieves a human-readable string describing the type of each input.
GetInputType Retrieves the computer-readable physical type of each input.
SetInputIndex Selects a particular input.

CCrossbar::CCrossbar

CCrossbar Class

Constructs a CCrossbar object.

Syntax

CCrossbar(
    IPin *pPin);

Parameters

pPin
Pointer to starting input pin.

Return Value

No return value.

CCrossbar::GetInputCount

CCrossbar Class

Retrieves the number of unique video inputs that can be selected.

Syntax

HRESULT GetInputCount(
    LONG *pCount);

Parameters

pCount
Pointer to the number of video inputs.

Return Value

Returns S_OK.

CCrossbar::GetInputIndex

CCrossbar Class

Retrieves the currently selected input.

Syntax

HRESULT GetInputIndex(
    LONG *Index);

Parameters

Index
Pointer to current routing index.

Return Value

Returns S_OK.

CCrossbar::GetInputName

CCrossbar Class

Retrieves a human-readable string describing the type of each input.

Syntax

HRESULT GetInputName(
    LONG Index,
    TCHAR *pName,
    LONG NameSize);

Parameters

Index
Current routing index.
pName
Pointer to the buffer that will receive the text version of the current routing input. It cannot be equal to NULL before the method call or the operation will fail. For example, if the current routing input is of type PhysConn_Video_Tuner, the function will return the string "Video Tuner" in this parameter. For more information, see Remarks.
NameSize
Size of the buffer that will receive the text version of the current routing input. Note that the buffer pointed to by pName must be large enough to include a terminating null character.

Return Value

If the buffer is large enough to copy the string name, the method returns S_OK; otherwise, the method returns E_FAIL.

Remarks

The following table shows what the pName parameter returns, depending on the current routing type.

Physical type pName
PhysConn_Video_Tuner Video Tuner
PhysConn_Video_Composite Video Composite
PhysConn_Video_SVideo Video SVideo
PhysConn_Video_RGB Video RGB
PhysConn_Video_YRYBY Video YRYBY
PhysConn_Video_SerialDigital Video SerialDigital
PhysConn_Video_ParallelDigital Video ParallelDigital
PhysConn_Video_SCSI Video SCSI
PhysConn_Video_AUX Video AUX
PhysConn_Video_1394 Video 1394
PhysConn_Video_USB Video USB
PhysConn_Video_VideoDecoder Video Decoder
PhysConn_Video_VideoEncoder Video Encoder
PhysConn_Audio_Tuner Audio Tuner
PhysConn_Audio_Line Audio Line
PhysConn_Audio_Mic Audio Mic
PhysConn_Audio_AESDigital Audio AESDigital
PhysConn_Audio_SPDIFDigital Audio SPDIFDigital
PhysConn_Audio_SCSI Audio SCSI
PhysConn_Audio_AUX Audio AUX
PhysConn_Audio_1394 Audio 1394
PhysConn_Audio_USB Audio USB
PhysConn_Audio_AudioDecoder Audio Decoder

CCrossbar::GetInputType

CCrossbar Class

Retrieves the computer-readable physical type of each input.

Syntax

HRESULT GetInputType(
    LONG Index,
    LONG *PhysicalType);

Parameters

Index
Current routing index.
PhysicalType
Pointer to the physical type of pin (video). Returns a member of the PhysicalConnectorType enumerated data type.

Return Value

Returns E_FAIL if the Index parameter is out of bounds; otherwise, returns S_OK.

CCrossbar::SetInputIndex

CCrossbar Class

Selects a particular input.

Syntax

HRESULT SetInputIndex(
    LONG Index);

Parameters

Index
Routing index to be set.

Return Value

Returns S_OK if successful; otherwise, returns E_FAIL.


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