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.

OMX NF about 8168

(EZSDK505, DM8168)

In the example of capture-dei-encode, I add the NF component (capture-nf-dei-display).

If there is no nf, the display is normal. If there is nf, the display is no normal and there is a gray rectangle in the bottom of screen.

Who also appeared in this case?  I am looking forward for your help.

Thanks.

 

  • There is a gray rectangle in the bottom of screen.

    The configuration  of NF is as following:

    OMX_ERRORTYPE eError = OMX_ErrorNone;
      OMX_PARAM_BUFFER_MEMORYTYPE memTypeCfg;
      OMX_PARAM_PORTDEFINITIONTYPE paramPort;
      OMX_PARAM_VFPC_NUMCHANNELPERHANDLE sNumChPerHandle;
      OMX_CONFIG_ALG_ENABLE algEnable;
      OMX_CONFIG_SUBSAMPLING_FACTOR   para;
      OMX_CONFIG_VIDCHANNEL_RESOLUTION chResolution;

      OMX_INIT_PARAM (&memTypeCfg);
      memTypeCfg.nPortIndex = OMX_VFPC_INPUT_PORT_START_INDEX; //0,VFPC comp index
      memTypeCfg.eBufMemoryType = OMX_BUFFER_MEMORY_DEFAULT;
      eError =
        OMX_SetParameter (pAppData->pNfHandle, OMX_TI_IndexParamBuffMemType,
                          &memTypeCfg);

      if (eError != OMX_ErrorNone)
      {
        ERROR ("failed to set memory Type at input port\n");
      }

      /* Setting Memory type at output port to Raw Memory */
      OMX_INIT_PARAM (&memTypeCfg);
      memTypeCfg.nPortIndex = OMX_VFPC_OUTPUT_PORT_START_INDEX;
      memTypeCfg.eBufMemoryType = OMX_BUFFER_MEMORY_DEFAULT;
      eError = OMX_SetParameter (pAppData->pNfHandle, OMX_TI_IndexParamBuffMemType,
                          &memTypeCfg);

      if (eError != OMX_ErrorNone)
      {
        ERROR ("failed to set memory Type at output port\n");
      }

      /* set input height/width and color format */
      OMX_INIT_PARAM (&paramPort);
      paramPort.nPortIndex = OMX_VFPC_INPUT_PORT_START_INDEX; //0

      eError=OMX_GetParameter (pAppData->pNfHandle, OMX_IndexParamPortDefinition,
                        &paramPort);
      if (eError!= OMX_ErrorNone)
      {
       printf("IL_ClientSetNfParams( ): OMX_GetParameter( ) Error\n");
      }
      /////////////////////////////////////////////
      // input

      paramPort.nPortIndex = OMX_VFPC_INPUT_PORT_START_INDEX; //0
      paramPort.eDir = OMX_DirInput;
      paramPort.format.video.nFrameWidth  = pAppData->nWidth;
      paramPort.format.video.nFrameHeight = pAppData->nHeight;
      paramPort.nBufferCountActual = IL_CLIENT_NF_INPUT_BUFFER_COUNT;//IL_CLIENT_CAPTURE_OUTPUT_BUFFER_COUNT
      /* Scalar is connceted to H264 decoder, whose stride is different than width*/
      paramPort.format.video.nStride =pAppData->nWidth * 2;
      paramPort.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
      paramPort.format.video.eColorFormat = OMX_COLOR_FormatYCbYCr;
      paramPort.nBufferSize = paramPort.format.video.nStride *
                               paramPort.format.video.nFrameHeight;

      printf("Buffer Size computed: %d\n", (int)paramPort.nBufferSize);
      paramPort.nBufferAlignment = 128;
      paramPort.bBuffersContiguous = 0;
      paramPort.nBufferCountActual = IL_CLIENT_NF_INPUT_BUFFER_COUNT;
      printf ("set input port params (width = %u, height = %u) \n",
              (unsigned int) pAppData->nWidth, (unsigned int) pAppData->nHeight);
     
      eError = OMX_SetParameter (pAppData->pNfHandle, OMX_IndexParamPortDefinition,
                        &paramPort);
       if (eError != OMX_ErrorNone) 
       {
           printf("IL_ClientSetNfParams(): OMX_GetParameter() Error %s\n", IL_ClientErrorToStr(eError));
        }

       //////////////////////////////////
      /* set output height/width and color format */
      OMX_INIT_PARAM (&paramPort);
      paramPort.nPortIndex = OMX_VFPC_OUTPUT_PORT_START_INDEX;
      OMX_GetParameter (pAppData->pNfHandle, OMX_IndexParamPortDefinition,
                        &paramPort);

      paramPort.nPortIndex = OMX_VFPC_OUTPUT_PORT_START_INDEX;
      paramPort.eDir = OMX_DirOutput;
      paramPort.format.video.nFrameWidth  = pAppData->nWidth;
      paramPort.format.video.nFrameHeight = pAppData->nHeight;
      paramPort.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
      paramPort.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
      paramPort.nBufferAlignment = 128;
      paramPort.bBuffersContiguous = 0;
      paramPort.nBufferCountActual = IL_CLIENT_NF_OUTPUT_BUFFER_COUNT;
      /* scalar buffer pitch should be multiple of 16 */
      paramPort.format.video.nStride = pAppData->nWidth;

      paramPort.nBufferSize =
       (paramPort.format.video.nStride * paramPort.format.video.nFrameHeight * 3 )>> 1;
      printf("Buffer Size computed: %d\n", (int)paramPort.nBufferSize);
      printf ("set output port params (width = %d, height = %d) \n",
              (int) paramPort.format.video.nFrameWidth,
              (int) paramPort.format.video.nFrameHeight);

      eError = OMX_SetParameter (pAppData->pNfHandle, OMX_IndexParamPortDefinition,
                        &paramPort);

      if (eError != OMX_ErrorNone)
      {
          printf("IL_ClientSetNfParams(): OMX_GetParameter() Error %s\n", IL_ClientErrorToStr(eError));
       }
     
      /* set number of channles */
       printf ("set number of channels \n");

      OMX_INIT_PARAM (&sNumChPerHandle);
      sNumChPerHandle.nNumChannelsPerHandle = 1;
      eError =
        OMX_SetParameter (pAppData->pNfHandle,
                          (OMX_INDEXTYPE) OMX_TI_IndexParamVFPCNumChPerHandle,
                          &sNumChPerHandle);
      if (eError != OMX_ErrorNone)
      {
        ERROR ("failed to set num of channels\n");
      }

      /* set VFPC input and output resolution information */
      printf ("set input resolution \n");

      OMX_INIT_PARAM (&chResolution);
      chResolution.Frm0Width =  pAppData->nWidth;
      chResolution.Frm0Height = pAppData->nHeight;
      chResolution.Frm0Pitch =  pAppData->nWidth * 2;
      chResolution.Frm1Width = 0;
      chResolution.Frm1Height = 0;
      chResolution.Frm1Pitch = 0;
      chResolution.FrmStartX = 0;
      chResolution.FrmStartY = 0;
      chResolution.FrmCropWidth = pAppData->nWidth;
      chResolution.FrmCropHeight = pAppData->nHeight;
      chResolution.eDir = OMX_DirInput;
      chResolution.nChId = 0;

      eError =
        OMX_SetConfig (pAppData->pNfHandle,
                       (OMX_INDEXTYPE) OMX_TI_IndexConfigVidChResolution,
                       &chResolution);
      if (eError != OMX_ErrorNone)
      {
        ERROR ("failed to set input channel resolution\n");
      }

      printf ("set output resolution \n");
      OMX_INIT_PARAM (&chResolution);
      chResolution.Frm0Width  = pAppData->nWidth;
      chResolution.Frm0Height = pAppData->nHeight;
      chResolution.Frm0Pitch  = pAppData->nWidth;
      chResolution.Frm1Width = 0;
      chResolution.Frm1Height = 0;
      chResolution.Frm1Pitch = 0;
      chResolution.FrmStartX = 0;
      chResolution.FrmStartY = 0;
      chResolution.FrmCropWidth = pAppData->nWidth;
      chResolution.FrmCropHeight = pAppData->nHeight;
      chResolution.eDir = OMX_DirOutput;
      chResolution.nChId = 0;

      eError =
        OMX_SetConfig (pAppData->pNfHandle,
                       (OMX_INDEXTYPE) OMX_TI_IndexConfigVidChResolution,
                       &chResolution);
      if (eError != OMX_ErrorNone)
      {
        ERROR ("failed to set output channel resolution\n");
      }

      /* disable algo bypass mode */
      OMX_INIT_PARAM (&algEnable);
      algEnable.nPortIndex = 0;
      algEnable.nChId = 0;
      algEnable.bAlgBypass = 0;

      eError =
        OMX_SetConfig (pAppData->pNfHandle,
                       (OMX_INDEXTYPE) OMX_TI_IndexConfigAlgEnable, &algEnable);
      if (eError != OMX_ErrorNone)
        ERROR ("failed to disable algo by pass mode\n");

      OMX_INIT_PARAM (&para);
      para.nPortIndex = OMX_VFPC_OUTPUT_PORT_START_INDEX;   /**< Index of the port */
      para. nSubSamplingFactor = 1;                         /**< Video frame rate sub sampling factor */
           
      eError = OMX_SetConfig (pAppData->pNfHandle, (OMX_INDEXTYPE) OMX_TI_IndexConfigSubSamplingFactor, &para);
      if (eError != OMX_ErrorNone)
          ERROR ("failed to (Nf) OMX_TI_IndexConfigSubSamplingFactor\n");
      
      return (eError);
    }

    why the display is no normal ? someone can help me?

  • This thread is discussed here:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/222531/791086.aspx

    Regards,

    Pavel