[N9H26 Non-OS] How to decode H.264 repeatedly?

Post Reply
9chuckyoung
Posts: 96
Joined: 28 Jan 2019, 13:49

31 May 2024, 16:32

In BSP H.264 decode sample code, we modify it from decoding once to decode repeatedly.

In main(void) of h264d.c:

Code: Select all

VPE_entry();
while (1)
{
    memset((CHAR *)&tFileInfo, 0, sizeof(FILE_FIND_T));

    strcpy(fullPathName,INPUT_PATTERN_FOLDER);
    strcat(fullPathName,"pattern\\");
    fsAsciiToUnicode(fullPathName, suDirName, 1);
    nStatus = fsFindFirst(suDirName,NULL,&tFileInfo);

//    VPE_entry();

    if (nStatus < 0)
    {
        sysprintf("No file found in %s folder\n", fullPathName);
        return -1;
    }

    do
    {
        if (tFileInfo.ucAttrib & FA_ARCHIVE)
        {
            // Playback all C:\h264\patter\*.264 or *.jsv bitstream
            fsUnicodeToAscii(tFileInfo.suLongName, szLongName, 1);
            strcpy(fullPathName,"pattern\\");
            strcat(fullPathName,szLongName);

            strcpy(infoFile,"info\\");
            strcat(infoFile,szLongName);
            file_length = strlen(infoFile);

            if ((strcmp(&infoFile[file_length-3],"264") ==0) || (strcmp(&infoFile[file_length-3],"jsv") ==0))
            {
                strcpy(&infoFile[file_length-3],"txt");
                DecodeH264(fullPathName ,infoFile);
            }
        }			
    } while (!fsFindNext(&tFileInfo));

    fsFindClose(&tFileInfo);

    printf("All decode done\n");
}

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests