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.

Updating Dynamically Display in vision SDK on TDA3x

Hello All,

I am using Vision SDK with TDA3x. i am using Vision SDK 2.9..

I am capturing video of 1280 * 720 and i am displaying only 640 *500 size of frame buffer.

i want to update displayed image based on user preference of X and Y coordinate so i am in a need to pass these dynamic parameters to display link.

I have explored there is DisplayLink_RtParams struct is defined inside DisplayLink_CreateParams structure in vision_sdk/include/DisplayLink.h file..

Can i use this DisplayLink_RtParams to update displayed image dynamically ?

  • Hello Kapil,

    I have pinged Vision SDK experts to comment here.

    thanks,
    Alex
  • Thanks for your quick response..

    I will wait for further response from VSDK expert.
  • Our current display link does not support runtime change in parameters, but you could use this structure and call set Set_dss_params ioctl to update x/y posisition.

    Regards,
    Brijesh
  • Hi Kapil,

    In current VisionSDK (versioned 2.10) or earlier this support is not present in the display driver. The structure that you are referring is the used for write-back path.

    In the next VisionSDK release, we will include the support for this in the driver.

    Regards,
    Sujith
  • Thanks sujith for response..

    Any date estimate on upcoming release ?
  • Hi Brijesh ,

    Thanks for your guidance, I could see DISPLAY_LINK_CMD_SET_WIN_SIZE_POS as run time command in display link which calls DisplayLink_drvSetWinSizePos to update parameters in displayLink_drv.c, will it work if i pass updated parameters in this.

    I couldn't find Set_dss_params iotcl call ?
  • Hi Sujith,

    Does it support zoom in and zoom out feature for display?
  • Hi Kapil,

    Display has a scalar in the pipeline, these features can be supported. 

    The only things, these parameters change is supported in ioctl. so you need to take care of synchronisation.

    Rgds,

    Brijesh

  • The exact ioctl name is IOCTL_VPS_DISP_SET_DSS_PARAMS and you could find it getting used in DisplayLink_drvDisplayCreate function.

    Regards,
    Brijesh
  • Hi Kapil,

    You could also consider using VPE to scale to achieve zoom. This will minimize/remove the synchronization needs but will result in additional read/write from/to memory, marginal CPU load as h/w scaler would be used.

    Regards,
    Sujith
  • Hi Brijesh,

    Exactly this is also what i discovered that if i send video of 640 * 500 resolution then it is being displayed on HDMI covering complete display..

    now what i am trying to find in VSDK is if i can give input source X , Y (i.e. 250 , 250) then if scalar/display link takes input buffer for display from this offset then i should be able to see zoom in effect considering it will cover all display area.
  • Kapil,

    X and Y Position in display is not for the input, it actually sets the position of the input frame onto output frame. If you want to have zoom in effect, then you should select the portion of the image and then upscale it using display scalar. i don't think changing X/Y position will help here.

    Regards,
    Brijesh
  • Yeah , correct..

    Please give more insights on how to select portion of input image to be displayed ?(I think it should be possible by giving inputs like startX,startY,height and width to be displayed, still couldn't find any relevant structure for it)..

    I believe rest will be automatically handled by scalar to have zoom in effect.

  • Hi Kapil,

    You need to provide the frame start pointer as offset into the buffer, lets say if the offset is at X and Y position, please provide buffer as 

    buffer start address + Y*pitch + X.

    Also everything is not automatically taken care by scalar, when you zoom in, you need to change input size and accordingly scaling factor. You could do this using the ioctl which i told you earlier.

    Regards,

    Brijesh

  • You need to provide the frame start pointer as offset into the buffer, lets say if the offset is at X and Y position, please provide buffer as

    buffer start address + Y*pitch + X.

    --> do i need to modify any registers for this ? or i just need to add offset of video buffer in display link ?

    Also everything is not automatically taken care by scalar, when you zoom in, you need to change input size and accordingly scaling factor. You could do this using the ioctl which i told you earlier.

    ---> Is there any predefined structure to pass this information to ioctl call ?

    I appreciate your help..
  • --> do i need to modify any registers for this ? or i just need to add offset of video buffer in display link ?
    As i said, cropping is not supported in the hardware, so you need to update the buffer address before queueing it to the driver in the display link

    ---> Is there any predefined structure to pass this information to ioctl call ?
    yes, you could use an instance of Vps_DispDssParams. There is already an instance of this structure in the capture object. It is better to use this already created instance as most of the variables are initialised to correct values, you will just to update input frame size and scaling information.

    Regards,
    Brijesh
  • Thanks Brijesh. This will surely help. I will try this and get back with specific queries.
  • Hi Sujith,

    are you talking about using VPE_LINK_CMD_SET_OUTPUTRESOLUTION command ?

    I believe i need to change input image resolution which is being send to display ..and by scalar i should get zoom in / out effect automatically..
  • No,

    VPE has support for cropping input image,
    use this to crop the image and then to upscale to display resolution..

    Crop parameters are changed in the API VpeLink_drvUpdateScCropPrm. It is getting called from VpeLink_drvUpdateInputRtPrm api. just follow this api, you will get the idea about it.

    Regards,
    Brijesh
  • Hi Brijesh ,
    Thanks for your input.
    I could see the crop effect after following changes in chains_lvdsVipMultiCam_Display.c file in chains_lvdsVipMultiCam_Display_SetVpePrm function..
    chPrms->scCropCfg.cropStartX = 800;
    chPrms->scCropCfg.cropStartY = 400;
    chPrms->scCropCfg.cropWidth = CAPTURE_SENSOR_WIDTH -800 ;
    chPrms->scCropCfg.cropHeight = CAPTURE_SENSOR_HEIGHT - 400;

    I could see on HDMI display image started from 800,400 coordinate and i could see zoom in effect as well..but this parameters are getting set only once at the start of the use case..

    Now what am i trying to achieve is to changing cropStartX, cropStartY at the run time while video pipeline is executing so for this i added
    VPE_LINK_CMD_ZOOM command in VpeLink_tsk.c file

    case VPE_LINK_CMD_ZOOM:
    Utils_tskAckOrFreeMsg(pMsg, status);
    flushCmds[0] = VPE_LINK_CMD_ZOOM;
    pPrm = Utils_msgGetPrm(pMsg);
    memcpy(&pObj->createArgs, pPrm, sizeof(*pPrm));
    Utils_tskFlushMsg(pTsk, flushCmds, 1U);
    Vps_printf("Calling sccroparams\n");
    VpeLink_drvUpdateScCropPrm(pObj, 0, FALSE);
    break; // I am sending VPE_LINK_CMD_ZOOM command from chains_lvdsVipMultiCam_Display.c file and it is being received as well

    and calling VpeLink_drvUpdateScCropPrm function as you suggested but i am not able to see the run time effect on display.

    Please suggest if i am missing anything.
  • Hi Kapil,

    Below statement is not correct,
    memcpy(&pObj->createArgs, pPrm, sizeof(*pPrm));

    Instead you should copy it to crop parameters
    memcpy(&pObj->createArgs.chParams[0].scCropCfg, pPrm, sizeof(*pPrm));

    I am assuming that you are passing crop cfg as argument to this ioctl in VPE.

    Rgds,
    Brijesh
  • Hi Brijesh,
    Thanks for your response..

    I hope you are talking about IOCTL_VPS_M2M_SET_VPE_PARAMS IOCTL call which currently getting called from VpeLink_drvCreateFvidObj function..
    retVal = Fvid2_control(pObj->fvidHandle,
    IOCTL_VPS_M2M_SET_VPE_PARAMS,
    &pObj->drvChArgs[chId], NULL);

    which i need to call at the run time whenever i receive VPE_LINK_CMD_ZOOM command in VPE link.. please correct me if i am wrong ..
  • Hi Kapil,

    I was talking about below code that you have newly added.

    case VPE_LINK_CMD_ZOOM:
    Utils_tskAckOrFreeMsg(pMsg, status);
    flushCmds[0] = VPE_LINK_CMD_ZOOM;
    pPrm = Utils_msgGetPrm(pMsg);
    memcpy(&pObj->createArgs, pPrm, sizeof(*pPrm));
    Utils_tskFlushMsg(pTsk, flushCmds, 1U);
    Vps_printf("Calling sccroparams\n");
    VpeLink_drvUpdateScCropPrm(pObj, 0, FALSE);
    break;

    Rgds,
    Brijesh
  • Yes I understood it and corrected it ..
    as you mentioned I am assuming that you are passing crop cfg as argument to this ioctl in VPE.
    so i am confirming i need to add something like below :

    Fvid2_control(pObj->fvidHandle,
    IOCTL_VPS_M2M_SET_VPE_PARAMS,
    &pObj->createArgs.chParams[0].scCropCfg, NULL);