IAMStreamControl::StopAt
A version of this page is also available for
4/8/2010
This method informs the pin when to suspend processing and supplying data.
Syntax
HRESULT StopAt(
const REFERENCE_TIME* ptStop,
BOOL bSendExtra,
DWORD dwCookie
);
Parameters
- ptStop
[in] Time at which to stop streaming as specified in the REFERENCE_TIME structure. If you specify NULL for ptStop, it will stop immediately (no notification); if MAX_TIME, cancels stop.
- bSendExtra
[in] Indicates whether to send an extra sample after scheduled ptStop time.
- dwCookie
[in] Specifies a particular value to send with the notification when the stop occurs (used only if ptStart if not NULL or MAX_TIME).
Return Value
Returns an HRESULT value that depends on the implementation of the interface.
Remarks
This method is exposed by pins that support the stopping of streams. It sets the StreamControlState enumeration type to STREAM_DISCARDING.
In video capture, you would typically call StopAt on both the output pin of a capture filter and the input pin of a multiplexer, and pay attention only to the notification from the multiplexer. This ensures that the capture filter does not needlessly capture extra frames, while guaranteeing that the multiplexer has, in fact, saved the last frame to a file.
In addition, you should specify TRUE for the bSendExtra parameter on the capture pin, and specify FALSE to the multiplexer pin. If an extra frame is not sent, the multiplexer will wait for the stop time indefinitely and not realize it already has received all the capture information. The multiplexer will discard the extra sample sent by the capture pin, so it will not get written to the file. Do not set bSendExtra to TRUE unless you also use IAMStreamControl on another downstream pin too, like in the preceding case.
If you call StopAt with a time that is in the middle of a packet, the filter will deliver the whole packet before going into a discarding state. Also, if start and stop are scheduled for a single point in time, the effect is as if the start occurred an infinitesimal time before the stop. You can use this effect to capture a single frame (see CBaseStreamControl for an implementation example).
Requirements
Windows Embedded CE | Windows CE 2.12 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
Note | Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements For more information, see Setting Up the Build Environment, Version 2.12 requires DXPAK 1.0 or later |