This topic has not yet been rated - Rate this topic

CSourceStream.FillBuffer method

Applies to: desktop apps only

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 codeDescription
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

Header

Source.h (include Streams.h)

Library

Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CSourceStream Class

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
don't have to fill
NB that you don't have to fill the entire buffer size, for each call to fillBuffer.  You can fill an arbitrary (as much as you want) of it and send it on, just make sure to call SetActualDataLength appropriately (for audio at least, video has its own headers with size info so you may not have to call SetActualDataLength, but you'll still need at least as much space as your frame requires, including headers).