LEADTOOLS Multimedia API Help > LEADTOOLS Multimedia Features > Multimedia Interfaces > IltmmMultiStreamSource Interface |
The ltmmMultiStreamSource Object is accessed through the IltmmMultiStreamSource Interface and the IltmmObjectWrapper Interface. For more information about the IltmmObjectWrapper Interface, refer to IltmmObjectWrapper. The IltmmMultiStreamSource Interface lets the user set and get information about an ltmmMultiStreamSource object.
In addition to the methods inherited from IDispatch, the IltmmMultiStreamSource interface exposes the following functions:
Functions
IltmmMultiStreamSource::get_StreamCount
IltmmMultiStreamSource::put_StreamCount
IltmmMultiStreamSource::SetMediaType
IltmmMultiStreamSource::GetMediaType
IltmmMultiStreamSource::GetSampleBuffer
IltmmMultiStreamSource::DeliverSample
IltmmMultiStreamSource::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, accessed through the IltmmMediaTypeDisp Interface. Once the media type is set using the IltmmMediaTypeDisp Interface, the media type for each source stream is set by calling IltmmMultiStreamSource::SetMediaType and retrieved using IltmmMultiStreamSource::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 using the IltmmMediaSampleDisp Interface, and fill the sample data. |
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. |
|
Then stop the play or conversion process. |
An overview of the whole process would look like this:
1. |
Set the number of streams with IltmmMultiStreamSource::put_StreamCount. |
||
2. |
each stream n (n from 0 to StreamCount 1), do the following: |
||
|
a. |
Set the stream media type IltmmMultiStreamSource::SetMediaType(n, ) |
|
|
b. |
Feed the samples in a loop: |
|
|
|
i. |
Obtain a free sample buffer: IltmmMultiStreamSource::GetSampleBuffer(n) |
|
|
ii. |
Fill the sample data |
|
|
iii. |
Deliver the sample: IltmmMultiStreamSource::DeliverSample(n, ) |
|
c. |
After all the samples for a stream have been delivered, indicate that the end of stream has been reached: IltmmMultiStreamSource::DeliverEndOfStream(n, ) |
For one stream only, use IltmmSampleSource instead of IltmmMultiStreamSource.
Win32, x64