ltmmSampleSource.GetSampleBuffer Method

Visual Basic Example

Syntax

object.GetSampleBuffer(TimeOut As Long) As MediaSample

Remarks

Retrieves an unused sample buffer.

The buffer retrieved by this method comes from a pool of buffers. There should be no assumptions made on the number of available buffers. If you get a buffer, fill it with data and then deliver it downstream, you should release the buffer (by setting the reference to Nothing) before getting another. This is because there may only be one buffer available at a time.

If the method fails, an error is raised. For more information, refer to the Error Codes.

If the method does not retrieve a buffer within the allotted time it will return E_FAIL. If this happens, you may have specified a small timeout and all the available buffers are currently being sent downstream.

If you get the sample in .NET, call System.Runtime.InteropServices.Marshal.ReleaseComObject to release the sample before getting another sample.

Platforms

Win32, x64

See Also

Elements:

ltmmSampleSource.SetMediaType Method, ltmmSampleSource.DeliverEndOfStream Method, ltmmSampleSource.DeliverSample Method, ltmmSampleSource.GetMediaType Method

Topic:

ltmmSampleSource Object

 

Implementing an ltmmSampleSource Object