次の方法で共有


CBaseStreamControl::StopAt (Compact 2013)

3/26/2014

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

Header

dshow.h,
Streams.h

Library

ole32.lib,
Ole32auth.lib,
Strmbase.lib,
Strmiids.lib,
uuid.lib

See Also

Reference

CBaseStreamControl Class