Implementing an ltmmSampleSource Object
To implement the ltmmSampleSource Object use the following steps:
1. |
Create an instance of the ltmmSampleSource Object. | |
2. |
Create an ltmmMediaType Object. | |
3. |
Set the media type attributes. | |
4. |
Assign the media type to the source by calling the SetMediaType method. | |
5. |
Assign the source to the ltmmConvertCtrl or ltmmPlayCtrl objects using the ltmmConvertCtrl.SourceObject or ltmmPlayCtrl.SourceObject properties. | |
6. |
Run the object (ltmmConvertCtrl.StartConvert or ltmmPlayCtrl.Run). | |
7. |
Feed samples until "end of stream". | |
|
a. |
Get a free sample buffer by calling the GetSampleBuffer method. |
|
b. |
Set the sample attributes and data. |
|
c. |
Deliver the sample to the stream by calling the DeliverSample method. |
|
d. |
Release the buffer interface. |
8. |
Inform the object that it is at the "end of stream" by calling DeliverEndOfStream method. | |
9. |
Stop the object by calling ltmmConvertCtrl.StopConvert or ltmmPlayCtrl.Stop. |
See Also