ltmmMultiStreamSource Object
The ltmmMultiStreamSource Object allows the user to supply multiple streams to the ltmmConvertCtrl and ltmmPlayCtrl objects. These streams can be of different types (video and audio). Use this for creating output files with more than one stream.
If you have only one stream, it is recommended to use the ltmmSampleSource object.
The ltmmMultiStreamSource object contains the following properties and methods:
Properties
ltmmMultiStreamSource.StreamCount
Methods
ltmmMultiStreamSource.SetMediaType
ltmmMultiStreamSource.GetMediaType
ltmmMultiStreamSource.GetSampleBuffer
ltmmMultiStreamSource.DeliverSample
ltmmMultiStreamSource.DeliverEndOfStream
A multi stream source will provide samples having different media types (each stream will have its own media type). Each media type is set in the ltmmMediaType object. The media type for each source stream is set by calling ltmmMultiStreamSource.SetMediaType and retrieved using ltmmMultiStreamSource.GetMediaType.
The Multi Stream Source object is intended for use with either a Convert Object or a Play Object. Once the source for the Convert or Play object is set, the play or the conversion process can be started, after which the multiple stream source can begin sending samples downstream. For each stream, you would do the following:
A. |
Obtain a free sample buffer using GetSampleBuffer. |
B. |
Set the sample information, and fill the sample data (ltmmMediaType object). |
C. |
Deliver the sample by calling the DeliverSample. |
D. |
Release the buffer. |
E. |
Continue sending samples until the end of the stream is reached. |
F. |
Call DeliverEndOfStream for each stream. |
An overview of the whole process would look like this:
1. |
Set the number of streams in the ltmmMultiStreamSource.StreamCount property. |
||
2. |
For each stream ‘n’ (n from 0 to StreamCount – 1), do the following: |
||
|
a. |
Set the stream media type ltmmMultiStreamSource.SetMediaType(n, …) |
|
|
b. |
Feed the samples in a loop: |
|
|
|
i. |
Obtain a free sample buffer: ltmmMultiStreamSource.GetSampleBuffer(n) |
|
|
ii. |
Fill the sample data |
|
|
iii. |
Deliver the sample: ltmmMultiStreamSource.DeliverSample(n, …) |
|
c. |
After all the samples for a stream have been delivered, indicate that the end of stream has been reached: ltmmMultiStreamSource.DeliverEndOfStream(n, …) |
For one stream only, use an ltmmSampleSource object instead of an ltmmMultiStreamSource object.
Win32, x64
See Also