Implementing an ltmmSampleTarget Object

To implement the ltmmSampleTarget Object you should use the following steps:

1.

Create an instance of the ltmmSampleTarget Object.

2.

Create an ltmmMediaType object.

3.

Set the media type attributes.

4.

Assign the accepted media type to the target by calling the SetAcceptedMediaType method.

5.

Assign the target to the ltmmCaptureCtrl or ltmmConvertCtrl objects using the ltmmCaptureCtrl.TargetObject or ltmmConvertCtrl.TargetObject properties.

6.

Run the object’s (ltmmCaptureCtrl.StartCapture or ltmmConvertCtrl.StartConvert) methods.

7.

Fetch a sample until "end of stream" or until desired amount read:

 

a.

Get a delivered sample by calling the GetSample method.

 

b.

If GetSample returned S_FALSE, then "end of stream". Otherwise, read sample data and release the sample interface.

8.

Stop the object by calling ltmmCaptureCtrl.StopCapture or ltmmConvertCtrl.StopConvert.

See Also

ltmmCaptureCtrl Object

ltmmConvertCtrl Object

ltmmMediaSample Object

ltmmMediaType Object