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 Programmatically Inserting a Processor Filter tutorial.

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

    C API
    IUnknown *pUnk;   
    IltmmPlay_GetSubObject(pPlay, ltmmPlay_Object_SelVideoProcessor, &pUnk); 
    C++
    IUnknown *pUnk;   
    pPlay->GetSubObject(ltmmPlay_Object_SelVideoProcessor, &pUnk); 

  2. Retrieve the mosaic interface as follows:

    C API
    ILMVMosaic *pVMF;   
    IUnknown_QueryInterface(pUnk, &IID_ILMVMosaic, (void**) &pVMF);   
    IUnknown_Release(pUnk); 
    C++
    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 API
    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++
    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 API
    IUnknown_Release(pPlay); 
    C++
    pPlay->Release(); 

Help Version 22.0.2023.1.26
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.