DXVA_DeinterlaceContainerDeviceClass::ProcAmpControlQueryRange method

The sample ProcAmpControlQueryRange function allows the VMR to query the driver to determine the minimum, maximum, step size, and default value for each ProcAmp property.

Syntax

HRESULT ProcAmpControlQueryRange(
  [in]  DWORD                   VideoProperty,
  [in]  DXVA_VideoDes           *lpVideoDescription,
  [out] DXVA_VideoPropertyRange *lpPropRange
);

Parameters

VideoProperty [in] Identifies the ProcAmp control property for which the driver should return information. The following are possible values for this parameter.

Value Description

DXVA_ProcAmp_Brightness

Returns brightness information.

DXVA_ProcAmp_Contrast

Returns contrast information.

DXVA_ProcAmp_Hue

Returns hue information.

DXVA_ProcAmp_Saturation

Returns saturation information.

lpVideoDescription [in] Supplies a pointer to a DXVA_VideoDesc structure. This structure provides the driver with a description of the video to which the ProcAmp adjustment will be applied. Drivers can adjust their ProcAmp support for particular video streams.

lpPropRange [out] Receives a pointer to a DXVA_VideoPropertyRange structure that specifies the range, step size, and default value for the ProcAmp.

Return value

Returns zero (S_OK or DD_OK) if successful; otherwise, returns an error code (for example, E_NOTIMPL). Refer to ddraw.h for a complete list of error codes.

Remarks

For each ProcAmp property, the VMR queries the driver to determine the minimum, maximum, step size, and default value. If the hardware does not support a particular ProcAmp control property, the driver should return E_NOTIMPL from the ProcAmpControlQueryRange function.

For more information regarding ProcAmp properties, see ProcAmp Properties.

The sample ProcAmpControlQueryRange function maps directly to a call to the RenderMoComp member of the DD_MOTIONCOMPCALLBACKS structure. The RenderMoComp member points to the driver-supplied DdMoCompRender callback that references the DD_RENDERMOCOMPDATA structure. The DD_RENDERMOCOMPDATA structure is filled as follows.

Member Value

dwNumBuffers

Zero.

lpBufferInfo

NULL.

dwFunction

DXVA_ProcAmpControlQueryRangeFnCode constant (defined in dxva.h).

lpInputData

Pointer to a DXVA_ProcAmpControlQueryRange structure.

lpOutputData

Pointer to a DXVA_VideoPropertyRange structure.

Note that the RenderMoComp function will be called without the display driver-supplied BeginMoCompFrame or EndMoCompFrame function being called first.

Example Code

The following code provides an example of how you can implement your ProcAmpControlQueryRange function:

HRESULT
DXVA_DeinterlaceContainerDeviceClass::ProcAmpControlQueryRange(
    DWORD VideoProperty,
    LPDXVA_VideoDesc lpVideoDesc,
    DXVA_VideoPropertyRange* lpPropRange
    )
{
    // only the YUY2 and YV12 formats can be operated on
    if (lpVideoDesc->d3dFormat != '2YUY' &&
        lpVideoDesc->d3dFormat != '21VY') {
        return E_INVALIDARG;
    }
    // the following are the recommended settings for each property
    switch (VideoProperty) {
    case DXVA_ProcAmp_Brightness:
        lpPropRange->MinValue = -100.F;
        lpPropRange->MaxValue = 100.F;
        lpPropRange->DefaultValue = 0.0F;
        lpPropRange->StepSize = 0.1F;
        break;
    case DXVA_ProcAmp_Contrast:
        lpPropRange->MinValue = 0.F;
        lpPropRange->MaxValue = 10.F;
        lpPropRange->DefaultValue = 1.0F;
        lpPropRange->StepSize = 0.01F;
        break;
    case DXVA_ProcAmp_Hue:
        lpPropRange->MinValue = -180.0F;
        lpPropRange->MaxValue =  180.0F;
        lpPropRange->DefaultValue = 0.0F;
        lpPropRange->StepSize = 0.1F;
        break;
    case DXVA_ProcAmp_Saturation:
        lpPropRange->MinValue = 0.F;
        lpPropRange->MaxValue = 10.F;
        lpPropRange->DefaultValue = 1.0F;
        lpPropRange->StepSize = 0.01F;
        break;
    }
    return S_OK;
}

Requirements

Target platform

Desktop

Header

N/A (Declared in a driver-supplied header file.)

See also

DXVA_ProcAmpControlQueryRange

DXVA_VideoDesc

DXVA_VideoPropertyRange