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.

TDA4VM: Could display parameter be dynamically modified while graph is running?

Part Number: TDA4VM


Hi TI Experts,

I create a simple graph to show the camera image on the display with following nodes.

GRAPH: cam_graph_85 (#nodes = 4, #executions = 61)
NODE: CAPTURE2: capture_node: avg = 33272 usecs, min/max = 33261 / 33538 usecs, #executions = 61
NODE: VPAC_LDC1: ldc_node: avg = 3973 usecs, min/max = 3956 / 4034 usecs, #executions = 61
NODE: VPAC_MSC1: scaler_node: avg = 6098 usecs, min/max = 6054 / 6295 usecs, #executions = 61
NODE: DISPLAY1: DisplayNode: avg = 14000 usecs, min/max = 80 / 14395 usecs, #executions = 61

My purpose is to show the variable sub-region of camera image to the different position on the display.

For example, the original camera image is 1920x1080, and display resolution is 1920x1080
0 secs: show full camera image (0,0) - (1920,1080) to display (0,0) - (1920,1080)
10 secs: show the region (0,0) - (960,1080) to display (0,0) - (960,1080)
24 secs: show the region (960,0) - (1920,1080) to display (100,0) - (1060,1080)
30 secs: show the region (0,0) - (960,540) to display (960,540) - (1920,1080)
...

This could be done by enabling display cropping and setting following variables.
display_params.enableCropping = 1;
display_params.cropPrms.startX
display_params.cropPrms.startY
display_params.cropPrms.width
display_params.cropPrms.height
display_params.outWidth
display_params.outHeight
display_params.posX
display_params.posY

But I don't know how to make it changed and effect dynamically during graph is running.

I tried to map the display_param_obj out and made modification, but I can not see the change unless I re-create the whole graph..

I have thought about to use TIVX_DISPLAY_SET_CROP_PARAMS command, but it can not made modification to variables out of cropPrms

Thanks for the guidance

Regards,
Christopher

  • Hi Christopher,

    Yes, using this ioctl, you can change the crop parameter dynamically at runtime..  When using this ioctl, please create a separate cropPrms and pass it to this control command. Pease refer to existing implementation to understand how to call control command in TIOVX. 

    Regards,

    Brijesh 

  • Hi Brijesh,

    Thanks for the guidance.

    But I still need to modify following variables which do not belong to cropPrms sturcture.

    display_params.outWidth
    display_params.outHeight
    display_params.posX
    display_params.posY

    How can I do this?

    Thank a lot.

    Regards,
    Christopher

  • Hi,

    But why do you require to change these parameters? Please create an instance of tivx_display_crop_params_t struct and pass it on with this control command to change the crop configuration.

    Regards,

    Brijesh 

  • Hi Brijesh, 

    I need to show the cropped image to the different position and size on the display.

    For example, the original camera image is 1920x1080, and display resolution is 1920x1080
    0 secs: show full camera image (0,0) - (1920,1080) to display (0,0) - (1920,1080)
    10 secs: show the region (0,0) - (960,1080) to display (0,0) - (960,1080)
    24 secs: show the region (960,0) - (1920,1080) to display (100,0) - (1060,1080)
    30 secs: show the region (0,0) - (960,540) to display (960,540) - (1920,1080)

    so these parameters need to be changed.

    Or is there any recommend way to do this ?

    Thanks.

    Regards,

    Christopher

  • Hi Brijesh, 

    The use case should like this: 

    Create two display nodes, one for camera image and another for surround view output image.

    Sometimes I need to show full size of surround view output like below

    (Sorry that the cameras are not installed and calibrated)

    And sometimes I need to show single camera and cropped surround view image together.

    This is why I need to change not only cropParam, but also posX/posY/outWidth/outHeight.

    Because the destination x/y/w/h for surround view display node is different.

    Thanks.

    Regards,

    Christopher

  • Hi Christopher,

    Crop parameters can be dynamically changed in the display. Display node supports this feature.. You can also change the start position, keeping the size same.. Essentially, cropping includes start position and size and both of these parameters can be changed dynamically. 

    Can you please refer to sample example in tiovx/kernels_j7/hwa/test/test_display.c file to understand how to set these parameters using this ioctl? 

    Regards,

    Brijesh

  • Hi Brijesh,

    Sorry I am a bit confused about display parameters setting ..

    Blow images shows two display modes I need to switch during graph is running.

    The first display mode shows full size image of surround view output

    In this display mode, the parameter setting of srv display node is as below

        display_params.cropPrms.startX = 0;
        display_params.cropPrms.startY = 0;
        display_params.cropPrms.width = 1920;
        display_params.cropPrms.height = 1080;
        display_params.outWidth = 1920;
        display_params.outHeight = 1080;
        display_params.posX= 0;
        display_params.posY= 0;

    And the second display mode shows both camera view and cropped srv view

    (Please ignore the left side camera view which is controlled by another display node)

    In 2nd display mode, the paremter settings of srv display node is as below:

        display_params.cropPrms.startX = 660;
        display_params.cropPrms.startY = 0;
        display_params.cropPrms.width = 600;
        display_params.cropPrms.height = 1080;
        display_params.outWidth = 600;
        display_params.outHeight = 1080;
        display_params.posX= 1320;
        display_params.posY= 0;

    So if I want to swich to 2nd display mode from 1st display mode, the posX need to be changed from 0 to 1320, and outWidth need to be changed from 1920 to 600.

    Since posX and outWidth are not belong to tivx_display_crop_params_t  sturct, they are not able to be update by TIVX_DISPLAY_SET_CROP_PARAMS ioctl..

    If I have any misunderstanding, please feel free to correct me.

    Thanks for the help.

    Regards,

    Christopher

  • Hi Brijesh,

    Just like cropping function on other platform, I am expected that the rect of both source and destination could be configured.
    In this case, I can keep the posX/posY/outWidth/outHeight as the entire display (0/0/1920/1080), and the rect of destination will decide the position and size on the display.

    But there are only 4 member variables in tivx_display_crop_params_t sturct. and that should be the cropped region of source image.

    If I did not set display_params.posX/posY/outWidth/outHeight as well, the cropped image should be scaled to full screen on the display?

    Please correct me if I have any misunderstanding for the parameter setting.

    Thanks.
    Regards,
    Christopher

  • Christopher,

    Sorry, did not get it.

    Cropping is always in source, what do you mean by destination cropping? 

    You need to enable the cropping at the time of display node creation and then at the time of create, you can set the full size cropped window, 

    Then at the timetime, you can change the cropping window by calling above control command. 

     If you want to put them at a specific position on display and also wants to control the display position at runtime. this might not be supported in the current display node, although HW can support this feature. 

    Regards,

    Brijesh

  • Hi Brijesh,

    Sorry for the confusion.

    What I mean for destination rectangle is the final region of the display that the cropped image will be put on.

    In some other platform, the dest. rect is configurable.

    Now I understand that the display position could not be changed at runtime in the current display node.

    Thank again for your detailed explanation and guidance.

    Regards,

    Christopher

  • Thanks Christopher, no further questions, so closing this ticket.