SMP865X广告机之test_rmfp

作者 QQ: 35327864,msn: fgwf1@hotmail.com,mail: agooou@gmail.com

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();

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值