Implementing an ltmmSampleSource Object

To implement the ltmmSampleSource Object use the following steps:

1.

Create an instance of the ltmmSampleSource Object, acquiring the IltmmSampleSource Interface.

2.

Create an ltmmMediaType Object.

3.

Set the media type attributes through the IltmmMediaTypeDisp Interface.

4.

Assign the media type to the source by calling the SetMediaType function.

5.

Assign the source to the ltmmConvert or ltmmPlay objects using the IltmmConvert::put_SourceObject or IltmmPlay::put_SourceObject function.

6.

Run the object (IltmmConvert::StartConvert or IltmmPlay::Run).

7.

Feed samples until "end of stream".

 

a.

Get a free sample buffer by calling the GetSampleBuffer function.

 

b.

Set the sample attributes and data, through the IltmmMediaSampleDisp Interface.

 

c.

Deliver the sample to the stream by calling the DeliverSample function.

 

d.

Release the buffer Interface.

8.

Inform the object at the "end of stream" by calling DeliverEndOfStream.

9.

Stop the object by calling IltmmConvert::StopConvert or IltmmPlay::Stop.