Access a Filter Interface

The example shows how to access the mosaic filter that was inserted as the first filter to the play object in the tutorial Programmatically Inserting a Processor Filter.

 

1.

Call the play object to retrieve the first selected video processor as follows:

C Source

IUnknown *pUnk;

IltmmPlay_GetSubObject(pPlay, ltmmPlay_Object_SelVideoProcessor, &pUnk);

C++ Source

IUnknown *pUnk;

pPlay->GetSubObject(ltmmPlay_Object_SelVideoProcessor, &pUnk);

2.

Retrieve the mosaic interface as follows:

C Source

ILMVMosaic *pVMF;

IUnknown_QueryInterface(pUnk, &IID_ILMVMosaic, (void**) &pVMF);
IUnknown_Release(pUnk);

C++ Source

ILMVMosaic *pVMF;

pUnk->QueryInterface(&IID_ILMVMosaic, (void**) &pVMF);
pUnk->Release();

3.

Access the mosaic filter. For example, set the mosaic filter effect area rectangle.

C Source

CROP_ATTRIBUTES CropAttrib;

CropAttrib.lLeft = 0;
CropAttrib.lTop = 0;
CropAttrib.lRight = 0;
CropAttrib.lBottom = 0;
CropAttrib.bEnabled = TRUE;

ILMVMosaic_SetCropAttributes(pVMF, CropAttrib);

IUnknown_Release(pVMF);

C++ Source

CROP_ATTRIBUTES CropAttrib;

CropAttrib.lLeft = 0;
CropAttrib.lTop = 0;
CropAttrib.lRight = 0;
CropAttrib.lBottom = 0;
CropAttrib.bEnabled = TRUE;

pVMF->SetCropAttributes(CropAttrib);

pVMF->Release();

4.

Clean up the play object.

C Source

IUnknown_Release(pPlay);

C++ Source

pPlay->Release();