Microsoft DirectX 8.0 |
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:
To disable quality control, call SetStatus with no flag.
IUnknown methods Description QueryInterface Retrieves pointers to supported interfaces. AddRef Increments the reference count. Release Decrements the reference count. IDMOQualityControl methods Description SetNow Specifies the earliest time stamp for which the DMO should deliver data. SetStatus Enables or disables quality control. GetStatus Determines whether quality control is active.
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_OK Success E_FAIL Failure
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.
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_OK Success E_INVALIDARG Invalid 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.
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_OK Success E_POINTER NULL pointer value