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.

8168 Get the ChInfoFromWinId

Hello,

       I'm working on demo_vdec_vdis use case on DM8168, DVR_RDK_3.5.

I have some confusion over the function of SwMsLink_drvGetInputChInfoFromWinId()  in file swMsLink_drv.c;

1)

I don't understand the code of  pCropInfo->height   /= 2,  why need to divided by two  ? can I delete this line of code ?

2)

In the function, I find the code is always pCropInfo->startX=32,pCropInfo->startY=24 , and whether the value is assigned in the function of DecLink_codecCreateOutChObj() or not .  can I modify the value 

pOutChInfo->startX = 32;
pOutChInfo->startY = 24;

to 

pOutChInfo->startX = 0;
pOutChInfo->startY = 0;

Pls tell me the detail of this  assignment ? 

Thank you!

  • This function has a bug which is fixed in DVR RDK 4.0. Refer implementation in DVR RDK 4.0

    Int32 SwMsLink_drvGetInputChInfoFromWinId(SwMsLink_Obj * pObj,SwMsLink_WinInfo * pCropInfo)
    {
        UInt32  chnl;
    
        SwMsLink_drvLock(pObj);
    
        chnl = pObj->layoutParams.winInfo[pCropInfo->winId].channelNum;
    
        pCropInfo->startX   = pObj->rtChannelInfo[chnl].startX;
        pCropInfo->startY   = pObj->rtChannelInfo[chnl].startY;
        pCropInfo->width    = pObj->rtChannelInfo[chnl].width;
        pCropInfo->height   = pObj->rtChannelInfo[chnl].height;
    
        if ((FVID2_SF_PROGRESSIVE == pObj->rtChannelInfo[chnl].scanFormat) &&
            pObj->layoutParams.winInfo[pCropInfo->winId].bypass &&
            VPS_VPDMA_MT_NONTILEDMEM == pObj->rtChannelInfo[chnl].memType
            )
        {
            pCropInfo->height   /= 2;
        }
    
        SwMsLink_drvUnlock(pObj);
        return FVID2_SOK;
    }
    
     
    The pCropInfo / 2 is because when low cost scaling is enabled, alternate lines are skipped by halving height and doubling the pitch.
     

  • Hi,

       I have modified the function of SwMsLink_drvGetInputChInfoFromWinId(),   but In the function, I find the code is always pCropInfo->startX=32,pCropInfo->startY=24 , and whether the value is assigned in the function of DecLink_codecCreateOutChObj() or not .  can I modify the value 

    pOutChInfo->startX = 32;
    pOutChInfo->startY = 24;

    to 

    pOutChInfo->startX = 0;
    pOutChInfo->startY = 0;

    Can you tell me the reason?

    Another question:

       I want to crop the picture, I call the function of Vdis_SetCropParam(),  I need to modify the  local variable of inputInfo. but when I set  inputInfo.width  = 10 and  inputInfo.height=10, the demo can not run normally.

    I want to know whether there is some limits about the width and height when do crop?

    thank you.

    Thank you. 

  • If decoder output is connected to SwMs input then crop startX,startY of 32,24 is correct.

    This is because H264 decoders pads the output frames and the valid image starts at 32,24 coordinate. Changing input crop to 10 is wrong.

  • Hi, thank you for your replay.

       So, if I want to do crop which the crop area of the pic is startx =0, starty=0, wxh = 10x10 .How should I set the local variable of  inputInfo in function Vdis_SetCropParam() ( Maybe inputInfo.width  = 32+10 and  inputInfo.height=24+10),  when decoder output is connected to SwMs.


    Thank you!

  • Yes that is correct. You should get the inputInfo from swms and add the offset required.

  • But when  I set the function of   Vdis_SetCropParam()  (inputInfo->width  = 32+10 , inputInfo->height=24+10, inputInfo->startX=0, inputInfo->startY =0),  I get the  image's width and height  equal (32+10, 24+10)  .

    If I want to crop a image to get the area of 10x10 from start (0,0).  what should i do ?

    when I set inputInfo->width  =10 , inputInfo->height=10, inputInfo->startX=0, inputInfo->startY =0,

    I get the error "Assertion @ Line: 3688 in links_m3vpss/swMs/swMsLink_drv.c: status == FVID2_SOK : failed !!!"

    Thank you!

  • Hi,Badri

        How can I use the croping funtion with RDK3.0?

        How can I use the struct of  SwMsLink_WinInfo?

     

        Thanks.