SMP865X廣告機之test_rmfp

作者 QQ: 35327864,msn: [email protected],mail: [email protected]

main ()
    pMainContext = (struct rmfp_main_thread_context_type *) RMMalloc(sizeof(struct rmfp_main_thread_context_type));
    pMainContextCopy = (struct rmfp_main_thread_context_type *) RMMalloc(sizeof(struct rmfp_main_thread_context_type));
    status = RMFPInitProfile(&profile);
    status = RMFPInitOptions(pMainContext->pOptions);
    status = RMFPInitStreamType(&streamType);
    status = init_application_options(&(pMainContext->AppOptions));
    status = parse_command_line(pMainContext, argc, argv, &streamType, &fileName);
    RMTermInit(TRUE, pMainContext->AppOptions.Playback.UseTerminal);
    RMTermDisableEcho();
    status = RUACreateInstance(&(pMainContext->pRUA), pMainContext->AppOptions.Playback.BoardIndex);
    status = DCCOpen(pMainContext->pRUA, &(pMainContext->pDCC));
    status = DCCSetMemoryManager(pMainContext->pDCC, Options.playback_options.DRAMIndex);
    if (pMainContext->AppOptions.Playback.LoadUCODE)
        status = DCCInitMicroCodeEx(pMainContext->pDCC, DCCInitMode_LeaveDisplay);
    /*begin create RMFP profile*/
    status = init_font_rendering(pMainContext, argv[0], &profile.pDefaultFontName, &profile.pCCFontName, &profile.pForcedFontName);
    status = RMFPOpenHandle(&profile, &pHandle);/*open handle using created profile.*/
    /* Check if osd scaler support VideoNonInterleaved mode */
    /* Seek all files to zero */
    init_rmfp_file_specific_context(pMainContext);

    fileHandle = open_url(pMainContext, fileName);
        Status = RMDTCPAPIGetParametersFromURL(fileName, &DTCPConnectionParameters);
        if (Status == RM_OK) open_dtcp_url(pMainContext, fileName, &DTCPConnectionParameters);
        else RMFPOpenURL(pMainContext->pHandle, fileName);
    Options.demux_options.second_file_handle = open_url(pMainContext, fileName);/* For index creation */

    status = detect_and_setup_stream(pMainContext, fileHandle, fileName, &Options, &streamType);
        status = RMFPGetStreamInfo(pMainContext->pHandle, fileHandle, fileName, pMainContext->AppOptions.Playback.detect_limit, FALSE, pStreamType, &pStreamInfo);
        status = RMFPApplyStreamInfoToOptions(pMainContext->pHandle, fileHandle, pStreamType, pStreamInfo, pOptions);
        RMFPReleaseStreamInfo(pMainContext->pHandle, pStreamInfo);

    /* Check that the outports have been configured, Wait for a vsync on the routing  */
    RUAResetEvent(pMainContext->pRUA, &event);
    status = RUAWaitForMultipleEvents(pMainContext->pRUA, &event, 1, 500000, NULL);

    status = RUAGetProperty(pMainContext->pRUA, EngineModuleID, RMAudioEnginePropertyID_StoreOutputMode, &StoredOutputMode, sizeof(StoredOutputMode));

    /*Now, launch the RMFP runtime main.*/
#ifndef WITH_THREADS
    status = RMFPMain(pHandle, fileHandle, &streamType, &Options);
#else
    // TODO: must use 'MainContext', add it to the parameters
    status = run_threading_test(pMainContext, fileHandle, &streamType, &Options);
#endif

    /*close all file*/
    CLOSE_FILE(Options.demux_options.index2create_file_handle);

    status = RMFPCloseHandle(pHandle);
    status = close_font_rendering(pMainContext);
    status = DCCClose(pMainContext->pDCC);
    status = RUAGetAvailableMemory(pMainContext->pRUA, 0, RUA_DRAM_UNPROTECTED, &RUAMemAvail);
    status = RUAGetAvailableMemory(pMainContext->pRUA, 1, RUA_DRAM_UNPROTECTED, &RUAMemAvail);
    status = RUADestroyInstance(pMainContext->pRUA);
    RMFree(pMainContext->pAlreadySetOptions);
    RMFree(pMainContext);
    RMFree(pMainContextCopy);
    RMCheckAndReleaseMemory(TRUE);
    RMTermEnableEcho();

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章