IMixerPinConfig Interface


The IMixerPinConfig interface is exposed on the input pins of overlay mixer filters and contains methods that manipulate video streams in various ways. The overlay mixer filter contains multiple input pins that are dynamically created as video input streams are added. The video stream on the first pin is known as the primary stream and subsequent streams are known as secondary streams.

Use this interface to manipulate the parameters involved in mixing various video streams. These parameters include getting and setting position, z-order, blend levels, spect ratio correction, and colorkeys of streams.

When to Implement

DirectShow implements this interface on the input pins of overlay mixer filters. Developers should implement this interface when they create filters that mix video streams.

When to Use

Applications use this interface to get and set attributes when mixing multiple video streams.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IMixerPinConfig methods Description
SetRelativePosition Sets the position of the stream in the display window.
GetRelativePosition Retrieves the position of the stream in the display window.
SetZOrder Sets the z-order of a particular video stream.
GetZOrder Retrieves the z-order of a particular video stream.
SetColorKey Sets the colorkey being used by a video stream.
GetColorKey Retrieves the colorkey being used by a video stream.
SetBlendingParameter Sets the blending parameter which defines how a secondary stream is blended with a primary stream.
GetBlendingParameter Retrieves the value of the blending parameter which defines how a secondary stream is blended with a primary stream.
SetAspectRatioMode Sets the aspect ratio correction mode for window resizing.
GetAspectRatioMode Retrieves the aspect ratio correction mode for window resizing.


IMixerPinConfig::GetAspectRatioMode

IMixerPinConfig Interface

Retrieves the aspect ratio correction mode for window resizing.

STDMETHOD GetAspectRatioMode(
  AM_ASPECT_RATIO_MODE* pamAspectRatioMode
  ) PURE;

Parameters
pamAspectRatioMode
[out] Pointer to an AM_ASPECT_RATIO_MODE enumerated type member.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation return values include:
Value Meaning
E_NOTIMPL Method called on secondary stream.
E_INVALIDARG Value invalid or NULL.
NOERROR No error.

See Also

IMixerPinConfig::SetAspectRatioMode


IMixerPinConfig::GetBlendingParameter

IMixerPinConfig Interface

Retrieves the value of the blending parameter which defines how a secondary stream is blended with a primary stream.

STDMETHOD GetBlendingParameter(
  DWORD *pdwBlendingParameter
  ) PURE;

Parameters
pdwBlendingParameter
[out] Value between 0 and 255 that indicates the amount of blending between a primary stream and a secondary stream.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation return values include:
Value Meaning
E_UNEXPECTED Method called on primary stream.
E_INVALIDARG Value outside of possible range (0-255).
NOERROR No error.

Remarks

A value of zero indicates that the secondary stream is invisible; a value of 255 indicates the primary stream is invisible in the area that the secondary stream occupies.

See Also

IMixerPinConfig::SetBlendingParameter


IMixerPinConfig::GetColorKey

IMixerPinConfig Interface

Retrieves the colorkey being used by a video stream.

STDMETHOD GetColorKey(
  COLORKEY *pColorKey,
  DWORD *pColor ) PURE;

Parameters
pColorKey
[out] Pointer to a COLORKEY structure which contains the key type and a palette index.
pColor
[out] Value indicating the palette index of the COLORKEY structure.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation return values include:
Value Meaning
E_INVALIDARG Invalid arguments, both parameters are NULL.
E_FAIL GetColorKey failed because the colorkey isn't known.
NOERROR No error.

Remarks

Getting the value on the primary stream will retrieve the destination colorkey being used by the overlay surface. Getting this value on the secondary pin returns the colorkey being used by that particular stream.

Current DirectShow implementation of this interface can return NULL for either the pColorKey or the pColor parameters; however, the method will fail and return E_INVALIDARG if both parameters are NULL.

Note The DWORD value returned by the pColor parameter is the actual color being used. So, if the bit depth of the display is 8, 16, 24, 32 the last 8, 16, 24 or 32 bits of the DWORD specify the actual value of the colorkey.

See Also

IMixerPinConfig::SetColorKey


IMixerPinConfig::GetRelativePosition

IMixerPinConfig Interface

Retrieves the position of the stream in the display window.

STDMETHOD GetRelativePosition(
  DWORD *pdwLeft,
  DWORD *pdwTop,
  DWORD *pdwRight,
  DWORD *pdwBottom ) PURE;

Parameters
pdwLeft
[out] Specifies the x-coordinate in the top-left corner of the display window.
pdwTop
[out] Specifies the y-coordinate in the top-left corner of the display window.
pdwRight
[out] Specifies the x-coordinate in the bottom-right corner of the display window.
pdwBottom
[out] Specifies the y-coordinate in the bottom-right corner of the display window.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation return values include:
Value Meaning
E_INVALIDARG Coordinates not in the {0, 0, 10,000, 10,000} range.
NOERROR No error.

Remarks

This method assumes window coordinates of {0, 0, 10,000, 10,000}. If the video stream is being rendered in the bottom right quarter of the display window, this method would return {5,000, 5,000, 10,000, 10,000}.

See Also

IMixerPinConfig::SetRelativePosition


IMixerPinConfig::GetZOrder

IMixerPinConfig Interface

Retrieves the z-order of a particular video stream.

STDMETHOD GetZOrder(
  DWORD *pdwZOrder ) PURE;

Parameters
pdwZOrder
[out] Value indicating the order in which streams will clip each other.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation returns E_NOTIMPL.

Remarks

The larger the value returned by the pdwZOrder parameter, the farther the video stream is from the user's eyes.

See Also

IMixerPinConfig::SetZOrder


IMixerPinConfig::SetAspectRatioMode

IMixerPinConfig Interface

Sets the aspect ratio correction mode for window resizing.

STDMETHOD SetAspectRatioMode(
  AM_ASPECT_RATIO_MODE amAspectRatioMode
  ) PURE;

Parameters
amAspectRatioMode
[in] Specify one of the AM_ASPECT_RATIO_MODE enumerated type members.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation return values include:
Value Meaning
E_NOTIMPL Method called on secondary stream.
E_INVALIDARG Invalid arguement.
NOERROR No error.

Remarks

Currently this function is implemented only on the primary pin of the Overlay Mixer filter. Calling it on a secondary pin will result in an error.

See Also

IMixerPinConfig::GetAspectRatioMode


IMixerPinConfig::SetBlendingParameter

IMixerPinConfig Interface

Sets the blending parameter which defines how a secondary stream is blended with a primary stream.

STDMETHOD SetBlendingParameter(
  DWORD dwBlendingParameter
  ) PURE;

Parameters
dwBlendingParameter
[in] Value between 0 and 255 that indicates the amount of blending between a primary stream and a secondary stream.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation return values include:
Value Meaning
E_UNEXPECTED Method called on primary stream.
E_INVALIDARG Value outside of possible range (0 to 255).
NOERROR No error.

Remarks

The value of the dwBlendingParameter parameter must be between 0 and 255, where 0 makes the secondary stream invisible and 255 makes the primary stream invisible in the area that the secondary stream occupies. If no value is set the default is 255.

This method is not intended to be called on the primary stream.

Note Current DirectShow implementation of this interface allows only values of 0 or 255 for the dwBlendingParameter parameter. Any other values are invalid.

See Also

IMixerPinConfig::GetBlendingParameter


IMixerPinConfig::SetColorKey

IMixerPinConfig Interface

Sets the colorkey being used by a video stream.

STDMETHOD SetColorKey(
  COLORKEY *pColorKey ) PURE;

Parameters
pColorKey
[in] Pointer to a COLORKEY structure.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation returns E_NOTIMPL.

Remarks

The term colorkey has different meanings depending on which stream it is referring to. The colorkey of the primary stream refers to the destination colorkey being used by the overlay surface. The colorkey of the secondary stream refers to the source colorkey used, when blitting from an offscreen surface to the primary surface.

Applications should set the colorkey of the primary pin to an obscure color (some color which, in all probability, will not be present on the desktop). Overlay mixer filters will try to pick an obscure color, but if the application knows that the specified color is part of some other content, then it should change it.

Setting the colorkey on the secondary stream can be used to make the stream transparent (nonrectangular). For example, if the secondary stream is closed-captioned text, then the closed-captioned text decoder should paint a solid color in the background and then set the colorkey on the corresponding pin to that color. This ensures that all pixels are transferred except those specified by the colorkey. If possible the colorkey of the secondary stream should be made the same as that of the primary stream to give a slight performance advantage.

Note Setting this value on the primary stream sets the destination colorkey being used by the overlay surface. By default, the destination colorkey is used as the colorkey for all transparent (secondary) streams.

See Also

IMixerPinConfig::GetColorKey


IMixerPinConfig::SetRelativePosition

IMixerPinConfig Interface

Sets the position of the stream in the display window.

STDMETHOD SetRelativePosition(
  DWORD dwLeft,
  DWORD dwTop,
  DWORD dwRight,
  DWORD dwBottom ) PURE;

Parameters
dwLeft
[in] Specifies the x-coordinate in the upper-left corner of the display window.
dwTop
[in] Specifies the y-coordinate in the upper-left corner of the display window.
dwRight
[in] Specifies the x-coordinate in the bottom-right corner of the display window.
dwBottom
[in] Specifies the y-coordinate in the bottom-right corner of the display window.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation return values include:
Value Meaning
E_INVALIDARG Coordinates not in the {0, 0, 10,000, 10,000} range.
NOERROR No error.

Remarks

This method assumes window coordinates of {0, 0, 10,000, 10,000}. Therefore, if you want your video stream to be rendered in the bottom right quarter of the display window, you would call this method with the parameters {5,000, 5,000, 10,000, 10,000}.

Note Values greater than 10,000 are invalid and will cause an error.

See Also

IMixerPinConfig::GetRelativePosition


IMixerPinConfig::SetZOrder

IMixerPinConfig Interface

Sets the z-order of a particular video stream.

STDMETHOD SetZOrder(
  DWORD dwZOrder ) PURE;

Parameters
dwZOrder
[in] Value indicating the order in which streams will clip each other.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. Current DirectShow implementation returns E_NOTIMPL.

Remarks

The z-order indicates which streams can clip other streams. Specifying a value of zero for the dwZOrder parameter places that stream on top of all others. The greater the value, the farther away from the eyes of the user.

The relative order of multiple streams is significant only if the video images overlap.

Specifying the same z-order for two overlaping streams can cause strange video artifacts.

See Also

IMixerPinConfig::GetZOrder

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