IVPConfig Interface


IVPConfig enables a video port (VP) mixer filter to communicate with a VP driver (decoder), to set and retrieve configuration information. This interface assumes that the mixer filter creates the video port.

When to Implement

The Windows Driver Model (WDM) Ksproxy filter implements this interface so you won't need to implement it in most cases. Implement this interface when you need this functionality on a platform that does not support WDM, or when you need to alter the default behavior.

When to Use

The overlay mixer filter (Overlay Mixer) uses this interface so you won't need to use it in most cases. Use this interface when you implement your own overlay mixer filter.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IVPConfig methods Description
GetConnectInfo Retrieves connection information structures.
SetConnectInfo Sets the index for the current video port connection information.
GetVPDataInfo Retrieves the current video port data information.
GetMaxPixelRate Retrieves the maximum pixels per second rate for a given width and height.
InformVPInputFormats Informs the device what video formats the video port supports.
GetVideoFormats Retrieves the video formats the decoder supports.
SetVideoFormat Sets the video format.
SetInvertPolarity Reverses the current polarity.
GetOverlaySurface Given the context, retrieves an overlay surface object to be used as an allocator.
IsVPDecimationAllowed Given the context (Video/VBI), retrieves whether scaling at the video port is allowed.
SetScalingFactors Sets the factors by which the decoder should scale the video stream.
SetDirectDrawKernelHandle Sets the DirectDraw® kernel handle.
SetVideoPortID Sets the video port ID.
SetDDSurfaceKernelHandle Sets the DirectDraw surface kernel handle.


IVPConfig::GetConnectInfo

IVPConfig Interface

Retrieves connection information structures.

HRESULT GetConnectInfo(
  LPDWORD pdwNumConnectInfo,
  LPDDVIDEOPORTCONNECT pddVPConnectInfo
  );

Parameters
pdwNumConnectInfo
[in/out] Points to a buffer that contains the number of DDVIDEOPORTCONNECT structures provided by the pddVPConnectInfo parameter. Contains the actual number of structures returned on output. If pddVPConnectInfo is NULL, this method updates this parameter with the number of structures supported by the driver.
pddVPConnectInfo
[in/out] Points to an array of DDVIDEOPORTCONNECT structures that the driver fills in. Specify NULL to retrieve the total number of formats supported.
Return Values

Returns NOERROR if the count or structures were retrieved, or a driver error.

Remarks

This method retrieves the various connection information structures (guid, port width) in an array of structures (pddVPConnectInfo). It is the callee's responsibility to allocate the correct amount of space for the number of structures requested.

Set the index for connection information by using the IVPConfig::SetConnectInfo method.


IVPConfig::GetMaxPixelRate

IVPConfig Interface

Retrieves the maximum pixels per second rate for a given width and height.

HRESULT GetMaxPixelRate(
  LPAMVPSIZE pamvpSize,
  LPDWORD pdwMaxPixelsPerSecond
  );

Parameters
pamvpSize
[in/out] Pointer to an AMVPSIZE structure containing the desired width and height and which receives the final dimensions upon return.
pdwMaxPixelsPerSecond
[out] Pointer to the retrieved maximum pixels per second rate.
Return Values

Returns NOERROR if the maximum pixel rate was retrieved.

Remarks

This method retrieves the maximum pixels per second rate expected for a given format and a given scaling factor. If the decoder does not support those scaling factors, then it returns the rate and the nearest scaling factors it supports.


IVPConfig::GetOverlaySurface

IVPConfig Interface

Given the context, retrieves an overlay surface object to use as an allocator.

HRESULT GetOverlaySurface(
  AMVP_CONTEXT amvpContext,
  LPDIRECTDRAWSURFACE *ppddOverlaySurface
  );

Parameters
amvpContext
[in] Context in which to use the overlay surface.
ppddOverlaySurface
[out] Address of a pointer to the retrieved DirectDraw® overlay surface object.
Return Values

Returns NOERROR if the overlay surface object was returned. (Default implementation sets the surface to NULL and returns NOERROR.)

Remarks

The VP mixer uses this function to determine if the driver wants the VP mixer to use its overlay surface and if so to get a pointer to it. If this function returns NULL, then the VP mixer allocates its own surface.


IVPConfig::GetVideoFormats

IVPConfig Interface

Retrieves the video formats the decoder supports.

HRESULT GetVideoFormats(
  LPDWORD pdwNumFormats,
  LPDDPIXELFORMAT pddPixelFormats
  );

Parameters
pdwNumFormats
[in/out] Pointer to the number of DDPIXELFORMAT structures provided by the pddPixelFormats parameter. Upon output, this method updates this parameter with the actual number of structures retrieved. If pddPixelFormats is NULL, this method updates this parameter with the total number of formats the driver supports.
pddPixelFormats
[in/out] Pointer to an array of DDPIXELFORMAT structures that the driver fills. Specify NULL to retrieve only the count of supported formats in pdwNumFormats.
Return Values

Returns NOERROR if the count or structures were returned, or a driver error otherwise.

Remarks

This method queries for either the number of DDPIXELFORMAT structures supported by the driver, or retrieves as many structures as can fit into the provided buffer space.

It is the callee's responsibility to allocate the correct amount of space for the number of structures requested.

Set the video format using IVPConfig::SetVideoFormat.


IVPConfig::GetVPDataInfo

IVPConfig Interface

Retrieves the current video port data information.

HRESULT GetVPDataInfo(
  LPAMVPDATAINFO pamvpDataInfo
  );

Parameters
pamvpDataInfo
[in/out] Pointer to the AMVPDATAINFO data information structure.
Return Values

Returns NOERROR if the video port data information was retrieved.


IVPConfig::InformVPInputFormats

IVPConfig Interface

Informs the device what video formats the video port supports.

HRESULT InformVPInputFormats(
  DWORD dwNumFormats,
  LPDDPIXELFORMAT pDDPixelFormats
  );

Parameters
dwNumFormats
[in] Number of video formats contained in the pDDPixelFormats parameter.
pDDPixelFormats
[in] Array of pixel format structures (DDPIXELFORMAT) to send to the device.
Return Values

Returns S_FALSE if failure, or NOERROR otherwise.

Remarks

The supplied array of supported video port formats might determine what formats the device, in turn, proposes.


IVPConfig::IsVPDecimationAllowed

IVPConfig Interface

Given the context (Video/VBI), retrieves whether scaling at the video port is allowed.

HRESULT IsVPDecimationAllowed(
  AMVP_CONTEXT amvpContext,
  LPBOOL pbIsDecimationAllowed
  );

Parameters
amvpContext
[in] Context in which to query the VP decimation capability.
pbIsDecimationAllowed
[out] Pointer to the retrieved value indicating whether decimation is allowed.
Return Values

Returns NOERROR if this method returned the decimation capability.

Remarks

The VP mixer uses this function to determine whether the driver wants the mixer to decimate video data at its own discretion. This function can be especially useful in a capture with preview situation in which you would not want the VP mixer filter to perform any scaling at the video port.


IVPConfig::SetConnectInfo

IVPConfig Interface

Sets the index for the current video port connection information.

HRESULT SetConnectInfo(
  DWORD dwChosenEntry
  );

Parameters
dwChosenEntry
[in] Index of new video port connect information (zero-based) to pass to the driver.
Return Values

Returns NOERROR if the video port connect information was set.

Remarks

Retrieve connection information by using IVPConfig::GetConnectInfo.


IVPConfig::SetDirectDrawKernelHandle

IVPConfig Interface

Sets the DirectDraw kernel handle.

HRESULT SetDirectDrawKernelHandle(
  DWORD dwDDKernelHandle
  );

Parameters
dwDDKernelHandle
[in] DirectDraw kernel level handle passed as a DWORD value.
Return Values

Returns NOERROR if the specified handle was set successfully.

Remarks

Sets the DirectDraw kernel level handle on the mini driver to enable it to talk to DirectDraw directly.


IVPConfig::SetDDSurfaceKernelHandle

IVPConfig Interface

Sets the DirectDraw surface kernel handle.

HRESULT SetDDSurfaceKernelHandle(
  DWORD dwDDKernelHandle
  );

Parameters
dwDDKernelHandle
[in] DirectDraw surface handle (kernel mode) passed as a DWORD value.
Return Values

Returns NOERROR if the specified handle is set successfully.

Remarks

This method sets the DirectDraw handle on the mini driver to enable it to talk to the video port directly.


IVPConfig::SetInvertPolarity

IVPConfig Interface

Reverses the current polarity.

HRESULT SetInvertPolarity(void);

Return Values

Returns NOERROR if the polarity was reversed.

Remarks

Reversing polarity means asking the decoder to treat even fields like odd fields and vice versa.


IVPConfig::SetScalingFactors

IVPConfig Interface

Sets the factors by which the decoder should scale the video stream.

HRESULT SetScalingFactors(
  LPAMVPSIZE pamvpSize
  );

Parameters
pamvpSize
[in] Pointer to the new scaling size structure (AMVPSIZE) to use to specify the width and height.
Return Values

Returns NOERROR if the new scaling factors were set.

Remarks

If the decoder does not support the specified scaling factors, then it sets the values to the nearest factors it can support.


IVPConfig::SetVideoFormat

IVPConfig Interface

Sets the video format.

HRESULT SetVideoFormat(
  DWORD dwChosenEntry
  );

Parameters
dwChosenEntry
[in] Specifies the index (zero-based) of the video pixel format to use.
Return Values

Returns NOERROR if the new video format was set.

Remarks

Retrieve the video formats by using IVPConfig::GetVideoFormats.


IVPConfig::SetVideoPortID

IVPConfig Interface

Sets the video port ID.

HRESULT SetVideoPortID (
  DWORD dwVideoPortID
  );

Parameters
dwVideoPortID
[in] DirectDraw video port ID.
Return Values

Returns NOERROR if the specified handle is set successfully.

Remarks

This method sets the DirectDraw video port ID on the mini driver to enable it to talk to the video port directly.

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