IStreamSample::Update
This method performs a synchronous or an asynchronous update on the current sample.
HRESULT Update(
DWORD dwFlags,
HANDLE hEvent,
PAPCFUNC pfnAPC,
DWORD dwAPCData
);
Parameters
- dwFlags
[in] Flag that specifies whether the update is synchronous or asynchronous. The SSUPDATE_ASYNC flag specifies an asynchronous update, which you can set if both hEvent and pfnAPC are NULL. Use SSUPDATE_CONTINUOUS to continuously update the sample until you call the IStreamSample::CompletionStatus method. - hEvent
[in] Handle to an event that this method will trigger when the update is complete. - pfnAPC
[in] Pointer to a Win32 asynchronous procedure call (APC) function that this method will call after it completes the sample update. - dwAPCData
[in] Value that this method passes to the function specified by the pfnAPC parameter.
Return Values
Returns one of the following values.
Value | Description |
---|---|
E_ABORT | The update aborted. |
E_INVALIDARG | One of the parameters is invalid. |
E_POINTER | One of the parameters is invalid. |
MS_E_BUSY | This sample already has a pending update. |
MS_S_ENDOFSTREAM | Reached the end of the stream; the sample was not updated. |
MS_S_PENDING | The asynchronous update is pending. |
S_OK | Success. |
Remarks
This method can be used to perform a synchronous or asynchronous update of a sample. If both hEvent and pfnAPC are NULL then the update will be synchronous unless either of the SSUPDATE_ASYNC or SSUPDATE_CONTINUOUS flags is specified. When a synchronous update returns, the result of the function contains the I/O completion status.
You cannot specify values for both hEvent and pfnAPC; the method will fail.
Asynchronous updates might complete before the update returns; in that case, the return value is S_OK. If you specify an event and the update returns S_OK, this method sets the event on return. If you specify an APC function and the update returns S_OK, the APC will not be queued and the function will not be called.
Asynchronous updates that do not complete prior to returning will return a value of MS_S_PENDING.
Applications that create multiple streams must read from each of them to avoid having their data blocked.
Requirements
DirectShow applications and DirectShow filters have different include file and link library requirements. See Setting Up the Build Environment for more information.
OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.
See Also
Last updated on Wednesday, April 13, 2005
© 2005 Microsoft Corporation. All rights reserved.