ltmmMultiStreamSource.GetSampleBuffer Method

Visual Basic Example 1

Visual Basic Example 2

 

Syntax

object.GetSampleBuffer(Stream As Long, TimeOut As Long) As MediaSample

Remarks

Retrieves a sample buffer from a stream.

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 with ltmmMultiStreamSource.DeliverSample, and 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 VFW_E_TIMEOUT [0x8004022E]. 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:

ltmmMultiStreamSource.StreamCount, ltmmMultiStreamSource.SetMediaType, ltmmMultiStreamSource.GetMediaType, ltmmMultiStreamSource.DeliverSample, ltmmMultiStreamSource.DeliverEndOfStream

Topic:

ltmmMultiStreamSource Object