Hi,
I am trying to add window masking (a rectangular portion of the video is always masked) feature to IPNC ( v1.5 ) in addition to face masking feature. My logic is this - Apply window masking before face detection logic runs.
To this end, I added a 'DRV_frameCopy' function call to the function 'VIDEO_fdTskRun' in the file 'videoFaceDetectThr.c ' . I am using the virtual address provided to the variable 'pBufInfo' in the function 'VIDEO_fdTskRun' by 'OSA_bufGetFull' function . But when I use the virtual address as argument to 'DRV_frameCopy' , video is garbled.
1. My function call - VIDEO_windowMasking(pBufInfo);
2. Assigning the Virtual address to be used in -DRV_frameCopy' -> frameCopy.dstVirtAddr = pBufInfo->virtAddr + VIDEO_BUF_HEADER_SIZE;
3. Calling 'DRV_frameCopy' function - DRV_frameCopy(NULL,&frameCopy);
Can you please tell me what I am doing wrong?
Sudheesh
Logically, your code seems to be correct. I would recommend that you refer to alg_swosd.c file in the source tree (framework\alg\src). If you look for "(privacyMask==TRUE)" condition, you will be able to see the code which is used to draw the privacy masked rectangles. You can call the same API "ALG_swosdDrawRect()" from your application code with the correct set of parameters and it will draw the masked rectangle.
Regards,
Anshuman
PS: Please mark this post as verified, if you think it has answered your question. Thanks.
Anshuman,
Thank you very much for your reply. But as I have explained, I am using the same function (kind of) 'DRV_frameCopy' which is used inside 'ALG_swosdDrawRect' function. I created an instance of 'DRV_FrameCopyPrm' and filled in all the parameters. But when I use the virtual address supplied by ''OSA_bufGetFull'' function, the video is getting garbled. Is there any difference with the address returned by 'OSA_bufGetFull' and what is inside 'ALG_SwosdRunPrm *bufInfo' ?
Regards