Microsoft Windows CE 3.0  

IAMStreamControl::StopAt

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Informs the pin when to suspend processing and supplying data.

HRESULT StopAt(
const REFERENCE_TIME *
ptStop
,
BOOL
bSendExtra
,
DWORD
dwCookie
);

Parameters

ptStop
[in] Time at which to stop streaming as specified in the REFERENCE_TIMEstructure. 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 ptStoptime.
dwCookie
[in] Specifies a particular value to send with the notification when the stop occurs (used only if ptStartif not NULL or MAX_TIME).

Return Values

Returns an HRESULTvalue that depends on the implementation of the interface.

Remarks

This method is exposed by pins that support the stopping of streams. It sets the StreamControlStateenumeration type to STREAM_DISCARDING.

In video capture, you would typically call StopAton 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 doesn't 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 bSendExtraparameter 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 bSendExtrato TRUE unless you also use IAMStreamControlon another downstream pin too, like in the preceding case.

If you call StopAtwith 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 CBaseStreamControlfor an implementation example).