Share via


ISampleGrabber::SetOneShot

 
Microsoft DirectShow 9.0

ISampleGrabber::SetOneShot

The SetOneShot method specifies whether the filter should stop the graph after receiving one sample.

Syntax

  HRESULT SetOneShot(
  BOOL OneShot
);

Parameters

OneShot

Boolean value specifying whether the filter should stop the graph after receiving one sample. If TRUE, the filter graph stops when the Sample Grabber receives the first sample and signals EC_COMPLETE. If FALSE, the filter graph continues to run normally.

Return Value

Returns S_OK.

Remarks

You can retrieve a sample at a particular time by calling this method with a value of TRUE, seeking to the desired time, and running the graph.

The Sample Grabber implements one-shot mode by calling IPin::EndOfStream on the downstream filter and returning S_FALSE from the IMemInputPin::Receive method of it.

Requirements

Header: Include Qedit.h. This header file is not compatible with Microsoft® Direct3D® headers later than version 7.

Library: Use strmiids.lib.

See Also