ltmmMultiStreamTarget Object

The ltmmMultiStreamTarget Object allows the user to fetch multiple media samples (with different media types) from the ltmmConvertCtrl and ltmmCaptureCtrl objects.

The ltmmMultiStreamTarget Object contains the following methods:

Properties

ltmmMultiStreamTarget.StreamCount

Methods

ltmmMultiStreamTarget.GetAcceptedMediaType

ltmmMultiStreamTarget.GetConnectedMediaType

ltmmMultiStreamTarget.GetSample

ltmmMultiStreamTarget.SetAcceptedMediaType

ltmmMultiStreamTarget.WaitForSample

A multi stream target will accept samples of different media types (each stream will have its own media type). The number of streams the object can support is specified using ltmmMultiStreamTarget.StreamCount.

The media type of each stream is set in the ltmmMediaType object. Use ltmmMultiStreamTarget.SetAcceptedMediaType to set the media type for a specific target stream. To determine the accepted media type of some target stream, call the GetAcceptedMediaType method.

The Multi Stream Target object is intended to receive samples from either a Convert Object or a Capture Object.

Once the target for the Convert or Capture object is set, the capturing or the conversion process can be started, after which the multiple stream target can begin receiving samples.

Using the WaitForSample and the GetSample methods, the multi stream target can get delivered samples for all streams, until the end of the stream is reached. When the end of the stream is reached, the convert or capture process should be stopped.

An overview of the whole process would look like this:

1.

Set the number of streams with ltmmMultiStreamTarget.StreamCount.

2.

Set the media type for all streams using ltmmMultiStreamTarget.SetAcceptedMediaType( n, …) for each stream n (n from 0 to StreamCount – 1).

3.

Receive samples:

 

a.

Call WaitForSample(timeout, …), which will return the index of the stream most recently having a sample to retrieve.

 

b.

Call GetSample(stream, …) to retrieve the sample.

 

c.

You might need to call GetConnectedMediaType(stream, …) to know the media type of the sample to retrieve (or retrieved).

For one stream only, use the ltmmSampleTarget object instead of the ltmmMultiStreamTarget object.

See Also

ltmmSampleTarget Object

ltmmMediaSample Object

ltmmMediaType Object