This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2HF: How to change vpe params when usecase is running?

Part Number: TDA2HF

In VISION_SDK_03_08,i want to use vpe_link to  scale and crop data from capture_link.

When i set vpe_link VpeLink_ChannelParams ,it achieves the desired effect.

Now i want to change  scCropCfg  params to dispaly different area when usecase is running.

I serched on e2e website ,and there is a related question:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/894080/tda2evm5777-vpe-runtime-control-from-linux-side/3306051?tisearch=e2e-sitesearch&keymatch=vision%20vpe%20runtime#3306051

I add some cmd in vpeLink_tsk.c:VpeLink_tskMain

case VPE_LINK_CMD_SET_PORT1:
                        Vps_printf("wwlog:vpe get port1(0,0,1280x800)\n");
                           
                            for (outId = 0U; outId < VPE_LINK_OUT_QUE_ID_MAX; outId++)
                            {
                                pObj->createArgs.chParams[0].scCropCfg.cropStartX=0;
                                pObj->createArgs.chParams[0].scCropCfg.cropStartY=0;
                                pObj->createArgs.chParams[0].scCropCfg.cropWidth=1280;
                                pObj->createArgs.chParams[0].scCropCfg.cropHeight=800;
                            }
                            VpeLink_drvUpdateScCropPrm(pObj,0,TRUE);
                            Utils_tskAckOrFreeMsg(pMsg, status);
                             Vps_printf("wwlog: vpe set flag %d\n",wwFlag); 
                             wwFlag=TRUE;
                            break; 
                    case VPE_LINK_CMD_SET_PORT2:
                        Vps_printf("wwlog:vpe get port2(0,0,800x400)\n");
                            
                            for (outId = 0U; outId < VPE_LINK_OUT_QUE_ID_MAX; outId++)
                            {
                                pObj->createArgs.chParams[0].scCropCfg.cropStartX=0;
                                pObj->createArgs.chParams[0].scCropCfg.cropStartY=0;
                                pObj->createArgs.chParams[0].scCropCfg.cropWidth=800;
                                pObj->createArgs.chParams[0].scCropCfg.cropHeight=400;
                            }
                            VpeLink_drvUpdateScCropPrm(pObj,0,TRUE);
                            Utils_tskAckOrFreeMsg(pMsg, status);
                            Vps_printf("wwlog: vpe set flag %d\n",wwFlag);
                            wwFlag=TRUE;
                            break; 
                    case VPE_LINK_CMD_SET_PORT3:
                    Vps_printf("wwlog:vpe get port3(500,400,800*400)\n");
                           
                            for (outId = 0U; outId < VPE_LINK_OUT_QUE_ID_MAX; outId++)
                            {
                                pObj->createArgs.chParams[0].scCropCfg.cropStartX=500;
                                pObj->createArgs.chParams[0].scCropCfg.cropStartY=400;
                                pObj->createArgs.chParams[0].scCropCfg.cropWidth=800;
                                pObj->createArgs.chParams[0].scCropCfg.cropHeight=400;
                            }
                            VpeLink_drvUpdateScCropPrm(pObj,0,TRUE);
                            Utils_tskAckOrFreeMsg(pMsg, status);     
                            Vps_printf("wwlog: vpe set flag %d\n",wwFlag);
                            wwFlag=TRUE;
                            break;  

These code doesn`t work ,please tell me   how to change vpe params when usecase is running.

Regards

  • Hi tang hao,

    The implementation of the control command seems to be correct from the above code. Are you calling this control command from usecase? Could you please put breakpoint and updateCropPrms API and see if it is getting called? or may be put some debug prints using Vps_printf to see if control command is really getting called? 

    Regards,

    Brijesh

  • Thanks for your reply.

    I think what you mean is  VpeLink_drvUpdateScCropPrm,not updateCropPrms .

    I have added print info ,and the  log proved API was called.

    Int32 VpeLink_drvUpdateScCropPrm(VpeLink_Obj * pObj, UInt32 chId,
                                     Bool rtPrmUpdate)
    {
        VpeLink_ChObj *pChObj;
        System_LinkChInfo *pInQueChInfo;
        UInt32 outId;
        VpeLink_ChannelParams *chParams;
        System_CropConfig *scCropCfg;
    
        pChObj = &pObj->chObj[chId];
        pInQueChInfo = &pObj->inQueInfo.chInfo[chId];
        chParams = &pObj->createArgs.chParams[chId];
    
        for (outId = 0U; outId < VPE_LINK_OUT_QUE_ID_MAX; outId++)
        {
            scCropCfg = &chParams->scCropCfg;
    
            if ((scCropCfg->cropStartX != 0U) || (!rtPrmUpdate))
            {
                pChObj->scCropCfg[outId].cropStartX = scCropCfg->cropStartX;
            }
            else
            {
                pChObj->scCropCfg[outId].cropStartX = pInQueChInfo->startX;
            }
    
            if ((scCropCfg->cropWidth != 0U) || (!rtPrmUpdate))
            {
                pChObj->scCropCfg[outId].cropWidth = scCropCfg->cropWidth;
            }
            else
            {
                pChObj->scCropCfg[outId].cropWidth = pInQueChInfo->width;
            }
    
            if ((scCropCfg->cropStartY != 0U) || (!rtPrmUpdate))
            {
                pChObj->scCropCfg[outId].cropStartY = scCropCfg->cropStartY;
            }
            else
            {
                pChObj->scCropCfg[outId].cropStartY = pInQueChInfo->startY;
            }
    
            if ((scCropCfg->cropHeight != 0U) || (!rtPrmUpdate))
            {
                pChObj->scCropCfg[outId].cropHeight = scCropCfg->cropHeight;
                Vps_printf("wwlog:scCropCfg->cropHeight set to %d\n",scCropCfg->cropHeight);
            }
            else
            {
                pChObj->scCropCfg[outId].cropHeight = pInQueChInfo->height;
            }
    
            if ((System_Link_Ch_Info_Get_Flag_Scan_Format(pInQueChInfo->flags) ==
                                                         SYSTEM_SF_INTERLACED) &&
                (pObj->createArgs.chParams[chId].deiCfg.bypass != 0U))
            {
                pChObj->scCropCfg[outId].cropStartY *= 2U;
                pChObj->scCropCfg[outId].cropHeight *= 2U;
            }
    
            if (rtPrmUpdate)
            {
                pChObj->vpeRtPrm.scCropCfg = &pChObj->scCropCfg[outId];
            }
        }
    
        return SYSTEM_LINK_STATUS_SOK;
    }

  • Hi hao,

    Looking at the VPE code, it sets up the RT params in VpeLink_drvMakeFrameLists API, below statement.

    pInFrame->perFrameCfg = &pChObj->vpeRtPrm;

    This is set only if chRtOutInfoUpdate flag is set to TRUE. But flag is not set to TRUE in VpeLink_drvUpdateScCropPrm API. So this is why crop parameters are not getting updated.

    After calling VpeLink_drvUpdateScCropPrm, can you try setting this flag to TRUE?

    Regards,

    Brijesh

  • I found flag was only used as a local variables,so i skip that ,and it worked. 

    Thanks for your reply.

  • Thanks for the update, closing this thread.