DXVA-HD DDI Programming Considerations

This section applies only to Windows 7 and later, and Windows Server 2008 R2 and later versions of Windows operating system.

When you implement the DXVA-HD DDI in your user-mode display driver, you should consider the following programming tips:

  • The driver must set the D3DCAPS3_DXVAHD (0x00000400L) bit in the Caps3 member of D3DCAPS9 structure to indicate that it supports the DXVA-HD DDI, otherwise the Direct3D runtime fails to call the CreateVideoProcessor function to create a DXVA-HD device. The D3DCAPS9 structure is described in the DirectX 9.0 SDK documentation. The driver sets the D3DCAPS3_DXVAHD bit in response to a call to its GetCaps function in which the D3DDDICAPS_GETD3D9CAPS value is set in the Type member of the D3DDDIARG_GETCAPS structure that the pData parameter points to.

  • The DXVAHD_SURFACE_TYPE_VIDEO_INPUT_PRIVATE value of the application-level DXVAHD_SURFACE_TYPE enumeration has no corresponding DDI value. An application sets the DXVAHD_SURFACE_TYPE_VIDEO_INPUT_PRIVATE value for an off-screen plain surface that is allocated in different format type for the CPU or a shader-base video processor plug-in.

  • The DXVAHD_SURFACE_TYPE_VIDEO_OUTPUT value of the application-level DXVAHD_SURFACE_TYPE enumeration corresponds to the VideoProcessRenderTarget bit-field flag of the D3DDDI_RESOURCEFLAGS structure. The Direct3D runtime sets VideoProcessRenderTarget in the Flags member of the D3DDDIARG_CREATERESOURCE structure when the runtime calls the driver's CreateResource function to create a video processing render target.

  • The Direct3D runtime maintains both bit-block transfer (bitblt) and stream states. The runtime returns to the application when the runtime is queried.

  • The application-level IDXVAHD_VideoProcessor::GetVideoProcessBltState method has no corresponding DDI function. However, when an application calls IDXVAHD_VideoProcessor::GetVideoProcessBltState to retrieve the private bitblt state data for a video processor, the Direct3D runtime calls the driver's GetVideoProcessBltStatePrivate function.

  • The application-level IDXVAHD_VideoProcessor::GetVideoProcessStreamState method has no corresponding DDI function. However, when an application calls IDXVAHD_VideoProcessor::GetVideoProcessBltState to retrieve the private stream state data for a video processor, the Direct3D runtime calls the driver's GetVideoProcessStreamStatePrivate function.

  • The DXVAHD_STREAM_STATE_D3DFORMAT value of the application-level DXVAHD_STREAM_STATE enumeration has no corresponding DDI value in the DXVAHDDDI_STREAM_STATE enumeration. The video processor plug-in uses the DXVAHD_STREAM_STATE_D3DFORMAT value for a surface that is allocated with the DXVAHD_SURFACE_TYPE_VIDEO_INPUT_PRIVATE value of the application-level DXVAHD_SURFACE_TYPE enumeration.

  • The DXVAHD_DEVICE_TYPE enumeration has no corresponding DDI enumeration (for example, no DXVAHDDDI_DEVICE_TYPE). The first member of the DXVAHDDDI_VPDEVCAPS structure is reserved whereas the first member of the application-level DXVAHD_VPDEVCAPS structure is set to a DXVAHD_DEVICE_TYPE value in the DeviceType member. The DeviceType member is set by the runtime or the video processor plug-in, which always reports the driver as DXVAHD_DEVICE_TYPE_HARDWARE.

  • The Multiplier member of the DXVAHDDDI_FILTER_RANGE_DATA structure is a floating-point value. The driver should use a value that can be represented exactly as a base 2 fraction. For example, 0.25 can be represented exactly as a base 2 fraction but 0.1 cannot.

  • Any DXVA-HD DDI function should return S_OK, E_INVALIDARG or E_OUTOFMEMORY.