Microsoft DirectX 8.0

IQueueCommand Interface

Queues a command for processing at a designated time. The filter graph manager exposes this interface. Applications can use it to queue graph-control commands in advance.

The methods in IQueueCommand are modeled after the IDispatch::InvokeAt method. The application specifies an interface, a method on the interface, parameters to the method, and a reference time. The filter graph manager queues this information and then invokes the method at the specified time. The requested interface must inherit IDispatch and must be exposed by the filter graph manager. Examples include IMediaControl, IMediaEventEx, and IMediaPosition.

When the command is queued, the filter graph manager returns a pointer to the IDeferredCommand interface. The application can use this interface to cancel or modify the command.

Note  The two methods in IQueueCommand are InvokeAtStreamTime and InvokeAtPresentationTime. In the context of the filter graph manager, stream time and presentation time are identical, so there is no functional difference between the two methods. Other objects could implement IQueueCommand differently. For more information about stream time and presentation time, see Time and Clocks in DirectShow.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterface Returns pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IQueueCommand methodsDescription
InvokeAtStreamTime Queues a method to be invoked at the specified stream time.
InvokeAtPresentationTime Queues a method to be invoked at the specified presentation time.

IQueueCommand::InvokeAtPresentationTime

IQueueCommand Interface

Queues a method to be invoked at the specified stream time.

Syntax

HRESULT InvokeAtPresentationTime(
    IDeferredCommand **pCmd,
    REFTIME time,
    GUID *iid,
    long dispidMember,
    short wFlags,
    long cArgs,
    VARIANT *pDispParams,
    VARIANT *pvarResult,
    short *puArgErr
);

Parameters

pCmd
[out] Address of a variable that receives an IDeferredCommand interface pointer.
time
[in] Time at which to invoke the command.
iid
[in] Pointer to the interface identifier (IID) of interface.
dispidMember
[in] Dispatch identifier (DISPID) of a method or property on the interface. Equivalent to the dispIdMember parameter of the IDispatch::InvokeAt method.
wFlags
[in] Flags describing the context of the call. Equivalent to the wFlags parameter of the IDispatch::InvokeAt method.
cArgs
[in] Number of arguments in pDispParams. Equivalent to the cArgs member of the DISPPARAMS structure.
pDispParams
[in] Pointer to an array that contains the arguments. Equivalent to the rgvarg member of the DISPPARAMS structure.
pvarResult
[in, out] Pointer a VARIANT that receives the result. Equivalent to the pVarResult parameter of the IDispatch::InvokeAt method.
puArgErr
[out] Pointer to a variable that receives the index of the first argument that has an error. Equivalent to the puArgErr parameter of the IDispatch::InvokeAt method.

Return Value

Returns an HRESULT value.

Remarks

Use the IDispatch::GetIDsOfNames method to retrieve the DISPID for the dispidMember parameter.

IQueueCommand::InvokeAtStreamTime

IQueueCommand Interface

Queues a method or property change for execution at a specified stream time (that is, presentation time relative to the current stream time offset).

Syntax

HRESULT InvokeAtStreamTime(
    IDeferredCommand **pCmd,
    REFTIME time,
    GUID *iid,
    long dispidMember,
    short wFlags,
    long cArgs,
    VARIANT *pDispParams,
    VARIANT *pvarResult,
    short *puArgErr
);

Parameters

pCmd
[out] Address of a variable that receives an IDeferredCommand interface pointer.
time
[in] Time at which to invoke the command.
iid
[in] Pointer to the interface identifier (IID) of interface.
dispidMember
[in] Dispatch identifier (DISPID) of a method or property on the interface. Equivalent to the dispIdMember parameter of the IDispatch::InvokeAt method.
wFlags
[in] Flags describing the context of the call. Equivalent to the wFlags parameter of the IDispatch::InvokeAt method.
cArgs
[in] Number of arguments in pDispParams. Equivalent to the cArgs member of the DISPPARAMS structure.
pDispParams
[in] Pointer to an array that contains the arguments. Equivalent to the rgvarg member of the DISPPARAMS structure.
pvarResult
[in, out] Pointer to a VARIANT that receives the result. Equivalent to the pVarResult parameter of the IDispatch::InvokeAt method.
puArgErr
[out] Pointer to a variable that receives the index of the first argument that has an error. Equivalent to the puArgErr parameter of the IDispatch::InvokeAt method.

Return Value

Returns an HRESULT value.

Remarks

Use the IDispatch::GetIDsOfNames method to retrieve the DISPID for the dispidMember parameter.