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