共用方式為


Motion Compensation Callbacks

DirectX Video Acceleration makes use of the following motion compensation callback functions provided in DirectDraw drivers for acceleration of digital video decoding processing, with support of alpha blending for such purposes as DVD subpicture support:

DdMoCompBeginFrame

DdMoCompCreate

DdMoCompDestroy

DdMoCompEndFrame

DdMoCompGetBuffInfo

DdMoCompGetFormats

DdMoCompGetGuids

DdMoCompGetInternalInfo

DdMoCompQueryStatus

DdMoCompRender

The motion compensation callback functions comprise the device driver side of the DirectX Video Acceleration interface. The motion compensation callback functions are specified by members of the DD_MOTIONCOMPCALLBACKS structure. The following steps show how motion compensation callback functions are accessed:

  1. GUIDs received from IAMVideoAccelerator::GetVideoAcceleratorGUIDs originate from the device driver's DdMoCompGetGuids.

  2. A call to the downstream input pin's IAMVideoAccelerator::GetUncompFormatsSupported returns data from the device driver's DdMoCompGetFormats.

  3. At the start of the relevant processing, the DXVA_ConnectMode data structure from the output pin of the decoder's IAMVideoAcceleratorNotify::GetCreateVideoAcceleratorData is passed to the device driver's DdMoCompCreate, which notifies the decoder about the video acceleration object.

  4. Data returned from IAMVideoAccelerator::GetCompBufferInfo originates from the device driver's DdMoCompGetBuffInfo.

  5. Buffers sent using IAMVideoAccelerator::Execute are received by the device driver's DdMoCompRender.

  6. Use of IAMVideoAccelerator::QueryRenderStatus calls the device driver's DdMoCompQueryStatus. A return code of DDERR_WASSTILLDRAWING from DdMoCompQueryStatus will be seen by the host decoder as a return code of E_PENDING from IAMVideoAccelerator::QueryRenderStatus.

  7. Data sent to IAMVideoAccelerator::BeginFrame is received by the device driver's DdMoCompBeginFrame. A return code of DDERR_WASSTILLDRAWING is needed from DdMoCompBeginFrame in order for E_PENDING to be seen by the host decoder in response to IAMVideoAccelerator::BeginFrame.

  8. Data sent to IAMVideoAccelerator::EndFrame is received by the device driver's DdMoCompEndFrame.

  9. At the end of the relevant processing, the device driver's DdMoCompDestroy is used to notify the driver that the current video acceleration object will no longer be used, so that the driver can perform any necessary cleanup.