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.

Why my video on the display is black and white? has anybody meet it ?

HI everyone:

                  I am WangJiang,I  want to   display  the  decoded   On the display,  But  The image is black and white, ,now the LCD'drive is right ,,The LCD is 800*480.  The code is below,If somebody  know ,please help me   ,Thakns very muck

while (!gblGetQuit()) {

        Pause_test(envp->hPauseProcess);

        Pause_test(envp->hPausePrime);

        fifoRet = Fifo_get(envp->hInFifo, &hSrcBuf);

 CapNum_Data = Buffer_getNumBytesUsed(hSrcBuf);
 printf("The Capplay data DisNum_Data = %d\n",CapNum_Data);


        if (fifoRet < 0) {
            ERR("Failed to get buffer from video thread\n");
            cleanup(THREAD_FAILURE);
        }

        if (fifoRet == Dmai_EFLUSH) {
            cleanup(THREAD_SUCCESS);
        }
        BufferGfx_getDimensions(hSrcBuf, &srcDim);

        if (Display_get(hDisplay, &hDstBuf) < 0) {
            ERR("Failed to get display buffer\n");
            cleanup(THREAD_FAILURE);
        }

        BufferGfx_getDimensions(hDstBuf, &dstDim);

       
        if (srcDim.width != clipWidth || srcDim.height != clipHeight) {
            clipWidth = srcDim.width;
            clipHeight = srcDim.height;

            gblSetImageWidth(srcDim.width);
            gblSetImageHeight(srcDim.height);

            if (srcDim.width > dstDim.width) {
                dstWidth   = dstDim.width;
                srcWidth   = dstDim.width;
                dstX       = 0;
            }
            else {
                dstWidth   = srcDim.width;
                srcWidth   = srcDim.width;
                dstX       = ((dstDim.width - srcDim.width) / 2) & ~0xf;
            }

            if (srcDim.height > dstDim.height) {
                dstHeight  = dstDim.height;
                srcHeight  = dstDim.height;
                dstY       = 0;
            }
            else {
                dstHeight  = srcDim.height;
                srcHeight  = srcDim.height;
                dstY       = (dstDim.height - srcDim.height) / 2;
            }

            dstDim.x       = dstX;
            dstDim.y       = dstY;
     /*dstDim.x       = -400;
            dstDim.y       = -1000;*/

            dstDim.width   = dstWidth;
            dstDim.height  = dstHeight;

            BufferGfx_setDimensions(hDstBuf, &dstDim);

            srcDim.width    = srcWidth;
            srcDim.height   = srcHeight;
             BufferGfx_setDimensions(hSrcBuf, &srcDim);

            if (Framecopy_config(hFc, hSrcBuf, hDstBuf) < 0) {
                ERR("Failed to configure frame copy job\n");
                cleanup(THREAD_FAILURE);
            }
        }

        srcDim.width    = srcWidth;
        srcDim.height   = srcHeight;
  printf("srcDim.width = %d\n",srcDim.width);
 printf("srcDim.height = %d\n",srcDim.height);
 printf("srcDim.x = %d\n",srcDim.x);
 printf("srcDim.y = %d\n",srcDim.y);
 printf("srcDim.lineLength = %d\n",srcDim.lineLength);
        BufferGfx_setDimensions(hSrcBuf, &srcDim);

        dstDim.width    = dstWidth;
        dstDim.height    = dstHeight;
         dstDim.x        = dstX;
        dstDim.y        = dstY;
 
 dstDim.lineLength    = 800;////////add by wangjian  height*width*3/2
 printf("dstDim.width = %d\n",dstDim.width);
 printf("dstDim.height = %d\n",dstDim.height);
 printf("dstDim.x = %d\n",dstDim.x);
 printf("dstDim.y = %d\n",dstDim.y);
 printf("dstDim.lineLength = %d\n",dstDim.lineLength);
        BufferGfx_setDimensions(hDstBuf, &dstDim);

        if (Framecopy_execute(hFc, hSrcBuf, hDstBuf) < 0) {
            ERR("Failed to execute frame copy job\n");
            cleanup(THREAD_FAILURE);
        }

        if(envp->videoStd == VideoStd_720P_60) {
            if (Time_delta(hTime, (UInt32*)&time) < 0) {
                ERR("Failed to get timer delta\n");
                cleanup(THREAD_FAILURE);
            }
            waitTime = DISPLAYLOOPLATENCY - time;
            if(waitTime > 0) {
                usleep(waitTime);
            }
            if(Time_reset(hTime) != Dmai_EOK) {
                ERR("Failed to reset timer\n");
                cleanup(THREAD_FAILURE);
            }
        }
       
        BufferGfx_resetDimensions(hSrcBuf);           

        if (Fifo_put(envp->hOutFifo, hSrcBuf) < 0) {
            ERR("Failed to send buffer to video thread\n");
            cleanup(THREAD_FAILURE);
        }
       
        gblIncFrames();          
       
        BufferGfx_resetDimensions(hDstBuf);

 DisNum_Data = Buffer_getNumBytesUsed(hDstBuf);
 printf("The Display data DisNum_Data = %d\n",DisNum_Data);

        if (Display_put(hDisplay, hDstBuf) < 0) {
            ERR("Failed to put display buffer\n");
            cleanup(THREAD_FAILURE);
        }
       
        frameCnt++;
    }