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.

Input Video Frame property (FVID2_Format structure from input queue?)

Hi guys!

I have a trouble with MCFW under DM8168.

Please let me know what is the best way to get input video frame properties, I mean: width, height, offsets, scan format etc.

FVID2_FrameList returned by System_getLinksFullFrames() and frame descriptor itself (FVID2_Frame structure) aren't contains required info,

but in my application I need this information for proper processing.

 

I works with:

VPSS driver version - hdvpss_01_00_01_36

SysLink driver version - syslink_2_00_04_83

 

ThanX alot for any help.

  • Hi Marat

    The FVID2_Frame structure has a appData structure which can be type casted to System_FrameInfo structure. This structure has all the frame related information you require.

    Regards,

    Arun

  • ThanX alot :-)

    You mean cast appData to System_FrameInfo and use System_LinkChInfo filed from this strucutre?

  • Yes. Exactly

    Regards,

    Arun

  • Hi 

        What I want to know is that where is the Share Region defined!

       I want write my own algorithm refer to OSD link code in  \dvr_rdk\mcfw\src_bios6\links_c6xdsp\alg_link\swosd

       and the first i must find the in  buffer  and out buffer in  OSD link .  but in  \dvr_rdk\mcfw\src_bios6\links_c6xdsp\alg_link\swosd\osdLink_alg.c , i don't find the in       buffer and out buffer . so my own algorithm can't get the data from in buffer and also can't output the result to the out buffer.

    so where is the exact  in buffer and  out buffer??Thanks!

                                                                                                                                                                                                                                     

  • i will do the same task like you, and i wanna know how to add your algorithm in OSD link? i found the video data can be get by pFrame in  AlgLink_algProcessData(AlgLink_Obj * pObj),but when i do a simply test like to set the value of  uv to 0X80,  some prombles occured , the whole demo cannot display! 

     if you have finished the task of adding your own algorithm in OSD link, could you tell me how to do ? thanks a lot!

     

  • Can you share the code to update pFrame contents. If demo is not working after modifying pFrame content it must be some bug in the code modifications which can be found by reviewing your code.

  • Int32 IpcFramesInLink_processFrameBufs(IpcFramesInLink_Obj * pObj)

    {

        FVID2_Frame *pFrameBuf;

        SystemIpcFrames_ListElem *pListElem;

        UInt32 numFrameBufs;

        Int32 status;

        UInt32 curTime;

        Int32 p; 

        numFrameBufs = 0;

        curTime = Utils_getCurTimeInMsec();

        while (1)

        {

            pListElem = ListMP_getHead(pObj->listMPOutHndl);

            if (pListElem == NULL)

                break; 

            IpcFramesInLink_getFrameBuf(pObj, pListElem, &pFrameBuf);

           

     // the modified codes here

               for(p=0;p<1920*1080/4;p++)//yuyv

               {

                    

                     *((unsigned char*)(pFrameBuf->addr[0][0])+1+p*2)=0x80;//uv

               //   *((unsigned char*)(pFrame->addr[0][0])+p*2)=189;//Y                

               }   

            UTILS_assert(SYSTEM_IPC_FRAMES_GET_BUFSTATE(pListElem->bufState)

                         == IPC_FRAMEBUF_STATE_OUTQUE);

            pListElem->frameBuf.reserved[0] = curTime;

            SYSTEM_IPC_FRAMES_SET_BUFOWNERPROCID(pListElem->bufState);

            SYSTEM_IPC_FRAMES_SET_BUFSTATE(pListElem->bufState,

                                         IPC_FRAMEBUF_STATE_DEQUEUED);

            pObj->stats.recvCount++;

            status = Utils_quePut(&pObj->outFrameBufQue, pFrameBuf, BIOS_NO_WAIT);

            UTILS_assert(status == FVID2_SOK); 

            numFrameBufs++;

        } 

    #ifdef SYSTEM_DEBUG_IPC_RT

        Vps_printf(" %d: IPC_FRAMES_IN   : Recevived %d framebufs !!!\n",

                   Utils_getCurTimeInMsec(), numFrameBufs);

    #endif 

        if (numFrameBufs && pObj->createArgs.baseCreateParams.notifyNextLink)

        {

            UTILS_assert(pObj->createArgs.baseCreateParams.numOutQue == 1);

            System_sendLinkCmd(pObj->createArgs.baseCreateParams.outQueParams[0].

                               nextLink, SYSTEM_CMD_NEW_DATA);

        } 

        return IPC_FRAMES_IN_LINK_S_SUCCESS;

    }

    pay more attention :

    I think the data format of pFrame is SYSTEM_DF_YUV422I_YUYV as i see pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV in the funtion of chain_main.c,  i set the value of UV is 0x80 and the value of Y unchanged. When i done the work above (the codes modified in red type), the video can be displayed with 1/4 frame of video is black- white and the left is colorful. when i modified the codes like below:

               for(p=0;p<1920*1080;p++)//yuyv

               {               

                     *((unsigned char*)(pFrameBuf->addr[0][0])+1+p*2)=0x80;//uv

               //   *((unsigned char*)(pFrame->addr[0][0])+p*2)=189;//Y                

               }   

    the video can not be displayed. Please tell me how to add the alg in DSP of DM8168? thanks a lot!