Partager via


CBaseStreamControl::StopAt

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Informs the pin when to stop processing data and to discard any new samples.

Syntax

HRESULT StopAt(
  const REFERENCE_TIME* ptStop = NULL,
  BOOL bSendExtra = FALSE,
  DWORD dwCookie = 0 
);

Parameters

  • ptStop
    REFERENCE_TIME at which to stop streaming. If NULL, stop immediately (no notification). If MAX_TIME, cancels stop.
  • bSendExtra
    Indicates whether to send an extra sample after scheduled ptStop time.
  • dwCookie
    Specifies a particular value to be sent with the notification when the stop occurs. (Only used if ptStart is not NULL or MAX_TIME.)

Return Value

Returns NOERROR.

Remarks

This member function implements the IAMStreamControl::StopAt method and is used by pins and filters that must support the stopping of streams.

It sets the StreamControlState enumeration type to STREAM_DISCARDING.

In a video capture scenario, specify StopAt on both the output pin of a capture filter and an input pin of a multiplexer and have the multiplexer send notification of completion. This ensures that the capture filter does not capture extra frames and also guarantees that the multiplexer has written the last frame to disk.

In addition, the capture output pin should specify TRUE for the bSendExtra variable while all other pins specify FALSE.

If an extra frame is not sent the multiplexer waits for the stop time indefinitely and does not realize it has received all capture information.

Note

If a stop time is given in the middle of a packet, the filter delivers 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.

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