CSourceStream.FillBuffer method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The FillBuffer method fills a media sample with data.

Syntax

virtual HRESULT FillBuffer(
   IMediaSample *pSample
) = 0;

Parameters

pSample

Pointer to the sample's IMediaSample interface.

Return value

Returns an HRESULT value. Possible values include those shown in the following table.

Return code Description
S_FALSE
End of stream
S_OK
Success

Remarks

The derived class must implement this method.

The media sample given to this method has no time stamps. The derived class should call the IMediaSample::SetTime method to set the time stamps. If appropriate for the media type, the derived class should also set the media times, by calling the IMediaSample::SetMediaTime method. For more information, see Time and Clocks in DirectShow.

Return S_FALSE at the end of the stream. This causes the CSourceStream class to send the end-of-stream notification and halt the buffer processing loop. See CSourceStream::DoBufferProcessingLoop for more information.

Requirements

Requirement Value
Header
Source.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CSourceStream Class