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.

DM6437

I have load my output file in DM6437 .i have made only some changes in video preview code as follows (for background subtraction) .


FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);                                             /* grab a fresh video input frame */
copyframe( (void*)(frameBuffPtr->frame.frameBufferPtr));                            //store background frame

while ( status == 0 ) {

FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);                                            /* grab a fresh video input frame */

subtract( (void*)(frameBuffPtr->frame.frameBufferPtr));                                 //subtract background frame from current frame

writeframe( (void*)(frameBuffPtr->frame.frameBufferPtr));                           //give  this subtraction to output fame buffer

FVID_exchange(hGioVpbeVid0, &frameBuffPtr);                                          /* display the video frame */

}

But  it sometimes show correct output and sometimes only blue screen or video preview output. Why this is happening.Is it related to stack size?

please guide me.

detail copy ,subtraction,write function as follows:

void copyframe(void *currentFrame)
{ int xx = 0;
for( xx = 0; xx < 829440; xx+=1 )
arr[xx]=*( ( (unsigned char*)currentFrame+xx ));
}


void writeframe(void *currentFrame)
{
int xx = 0;
for( xx = 0; xx < 414719; xx+=1 )
*( ( (unsigned char*)currentFrame+(2*xx)+1 ))=arr1[xx];
*( ( (unsigned char*)currentFrame+(2*xx) ))=0x80;
}

void subtract(void *currentFrame)
{

int xx = 0;
for( xx = 0; xx < 829440; xx+=1 )
arr1[xx]=*( ( (unsigned char*)currentFrame+xx ))-arr[xx];

}

  • Hi,

    Thanks for your post.

    I have few suggestion below:

    1. Can you please ensure that previewer is cleared from busy state, every time you start the preview operation? I mean, one possible state could be that last preview operation might not complete and we initiated the next one. If previewer is busy, it means it is waiting for data from input source and is not getting the data. Kindly validate this.

    2. Can you compare previewer registers settings for the working and nonworking case and see there is no difference in the configuration? I do think, this will happen only if the configuration is wrong.

    3. Also please make sure that output from CCDC to previewer is never enabled and previewer input is always from memory and check whether CCDC output was enabled (FMTCFG.VPEN = 1), if enabled, please set it to 0, thereafter, previewer should work fine.

    Kindly validate the above check points.

    Also, you can  try to use the code from "dvsdk_1_01_00_15\psp_1_00_02_00\pspdrivers\system\dm6437\bios\dm6437_evm\src\video\sample\previewer_on_the_fly+

    While building the previewer on-the-fly application, you need to enable the macro "PSP_VIDEO_PATH_ENABLE". The details are available in the section 4.3 of the document

    "\psp_1_00_02_00\pspdrivers\drivers\previewer\docs\BIOS_PREVIEWER_Driver_UserGuide.pdf".

    Please follow the instructions in the above doc. which would yield the expected result.

    Do not modify anything in the driver or the application.

    Take the PSP as it is, modify the file "\psp_1_00_02_00\pspdrivers\inc\psp_vpfe.h"  to have the line,

    #define PSP_VIDEO_PATH_ENABLE     [ -- By default this line would be commentted].

    Then rebuild the driver as well as the application.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • sir ,I am new to dm6437. I always write code in video preview example between following two lines

    FVID_exchange(hGioVpfeCcdc, &frameBuffPtr); /* grab a fresh video input frame */


    FVID_exchange(hGioVpbeVid0, &frameBuffPtr); /*give frame to output buffer*/

    i have not understood video preview example yet thoroughly but sir, i am very eager to understand deeply dm6437 from both application and architecture point of view.i am unable to find right path.
    Please guide me which documents and references should i read.