Microsoft DirectX 8.0

IDMOQualityControl Interface

Supports quality control on a Microsoft® DirectX® Media Object (DMO).

A DMO exposes this interface if it can respond to late samples. When quality control is enabled, the DMO attempts to process samples on time, discarding late samples if necessary. When quality control is disabled, the DMO processes every sample. By default, quality control is disabled.

Applications use this interface to enable or disable quality control. Using quality control is appropriate when you are viewing media data in real time. If you are capturing data to a file, do not enable quality control, because the DMO might discard samples. It does not matter in file capture whether samples arrive late, and you do not want to lose the data.

To use quality control, perform the following steps:

  1. Call the SetNow method with the reference time of the earliest sample to be processed.
  2. Call the SetStatus method with the DMO_QUALITY_STATUS_ENABLED flag.

To disable quality control, call SetStatus with no flag.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterfaceRetrieves pointers to supported interfaces.
AddRefIncrements the reference count.
ReleaseDecrements the reference count.
IDMOQualityControl methodsDescription
SetNowSpecifies the earliest time stamp for which the DMO should deliver data.
SetStatusEnables or disables quality control.
GetStatusDetermines whether quality control is active.

IDMOQualityControl::SetNow

IDMOQualityControl Interface

Specifies the earliest time stamp that the DMO will deliver.

Syntax

HRESULT SetNow(
    REFERENCE_TIME rtNow
);

Parameters

rtNow
[in] Reference time specifying the earliest time stamp to deliver.

Return Value

Returns an HRESULT value. Possible values include the following:

S_OKSuccess
E_FAILFailure

Remarks

If quality control is enabled, the DMO discards any samples whose time stamp is less than rtNow. Samples whose time stamp is rtNow or later are processed as efficiently as possible. Depending on the implementation, the DMO might drop some samples to keep pace.

If quality control is disabled, this method has no immediate effect. However, the DMO stores the specified reference time. It uses this value if quality control is enabled at a later time. To enable quality control, call the SetNow method.

If incoming samples are not time-stamped, the DMO never performs quality control. The application sets the time stamp in the IMediaObject::ProcessInput method.

IDMOQualityControl::SetStatus

IDMOQualityControl Interface

Enables or disables quality control.

Syntax

HRESULT SetStatus(
    DWORD dwFlags
);

Parameters

dwFlags
[in] Value that specifies whether to enable or disable quality control. Use DMO_QUALITY_STATUS_ENABLED to enable quality control, or zero to disable quality control.

Return Value

Returns an HRESULT value. Possible values include the following:

S_OKSuccess
E_INVALIDARGInvalid argument

Remarks

With quality control enabled, the DMO attempts to deliver samples on time. It can skip late samples if necessary. With quality control disabled, the DMO delivers every sample. If you enable quality control, call the SetNow method to specify the earliest time stamp that the DMO should process. Otherwise, the call to SetStatus succeeds but the DMO does not perform quality control.

By default, quality control is disabled.

IDMOQualityControl::GetStatus

IDMOQualityControl Interface

Determines whether quality control is active.

Syntax

HRESULT GetStatus(
    DWORD *pdwFlags
);

Parameters

pdwFlags
[out] Pointer to a variable that receives the quality control status. If quality control is disabled, the value is zero. If quality control is enabled, the value is DMO_QUALITY_STATUS_ENABLED.

Return Value

Returns an HRESULT value. Possible values include the following:

S_OKSuccess
E_POINTERNULL pointer value