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.

Decode video demo adding loop functionality for FHD 1080p60

Guru 10685 points

I'm trying to add loop functionality to the decode demo as provided in the DVSDK for the DM6467 for the 1080p60 playback.

At present the source code only allows looping if you are trying to decode H264 at anything _less_ than 1080p60.

I've examined the source code and tried to copy the looping code from the videoThrFxn function to the videoThrFxnFHD function however when I compile and run the code it only plays back the first 21 frames of the video on the second loop and then crashes due to an "IO error".

The code changes I made were to add a label "primeFHD" to videoThrFxnFHD just after the "Initialize the state of the decode" comment, as is the same in videoThrFxn.

I then added the following code in videoThrFxnFHD just before the "Clip ended, exiting demo" text so that this too looked the same as in videoThrFxn.

/* Make sure the decoder has no state by recreating it */
Vdec2_delete(hVd2);    // looks appropriate for both non-FHD/FHD

 /* Make sure any buffers kept by the codec are freed */
BufTab_freeAll(hBufTab);    // looks appropriate for both non-FHD/FHD

/* Undo any previous chunking done */
BufTab_collapse(Vdec2_getBufTab(hVd2));    // only found in non-FHD

hVd2 = Vdec2_create(hEngine, envp->videoDecoder, params, dynParams);        // looks appropriate for both non-FHD/FHD

 if (hVd2 == NULL)
{
     ERR("Failed to create video decoder: %s\n",
         envp->videoDecoder);
     cleanup(THREAD_FAILURE);
 }

/* The codec is going to use this BufTab for output buffers */
Vdec2_setBufTab(hVd2, hBufTab);    // looks appropriate for both non-FHD/FHD

/* Halt the display thread for priming */
Pause_on(envp->hPausePrime);     // runs the same at present with or without this line

goto primeFHD;

printf("Clip ended, exiting demo..\n");
            gblSetQuit();

I've read the code over several times as well as the decode_demo_info.pdf document. Is there any other documentation that can help me understand where I'm going wrong?


Thanks,
Ralph

  • Okay, I've added some loop functionality to the 1080p60 demo and for the first 2 loops the video plays back fine. At the start of the 3rd loop the video becomes corrupted getting worse and worse until Ccv_execute crashes out with the following error:

     

    From CE_DEBUG=1: "ti.sdo.dmai - [Ccv] Failed VDCE_START"


    Also get the error following this regardless of CE_DEBUG:

    "DavinciHD_vdce DavinciHD_vdce.2:  invalid size"

     

    I see that perhaps the corruption of the video produces some strange parameters that are passed to the Ccv_execute thus causing it to fail.


    So my question is, what is causing the video to become corrupted after the second loop? Is this the true reason that the TI engineers did not put loop ("loopback") functionailty in their 1080p60 decode demo application?


    It would be very interesting to hear the answer.

    Thanks a lot,

    Ralph