⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 void_audio_render.cpp

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 CPP
字号:
/*//////////////////////////////////////////////////////////////////////////////////                  INTEL CORPORATION PROPRIETARY INFORMATION//     This software is supplied under the terms of a license agreement or//     nondisclosure agreement with Intel Corporation and may not be copied//     or disclosed except in accordance with the terms of that agreement.//          Copyright(c) 2003-2005 Intel Corporation. All Rights Reserved.//*/#include "void_audio_render.h"UMC::NULLAudioRender::NULLAudioRender(double dfDelay,                                      UMC_FFMODE_MULTIPLIER mult):    m_lliFreq(0),    m_lliLastStartTime(0),    m_lliPrePauseTime(0),    m_bPaused(true),    m_uiFFModeMult(1){    m_lliFreq = vm_time_get_frequency();    m_dInitialDelay = dfDelay;    switch(mult)    {    case UMC_1X_FFMODE:        m_uiFFModeMult  = 1;        break;    case UMC_2X_FFMODE:        m_uiFFModeMult  = 2;        break;    case UMC_4X_FFMODE:        m_uiFFModeMult  = 4;        break;    case UMC_8X_FFMODE:        m_uiFFModeMult  = 8;        break;    case UMC_16X_FFMODE:    default:        m_uiFFModeMult  = 16;        break;   }}doubleUMC::NULLAudioRender::GetTimeTick(){    double dfRes = ((m_bPaused) ? (double)(vm_var64s)(m_lliPrePauseTime):        (double)(vm_var64s)(vm_time_get_tick() -                    m_lliLastStartTime +                    m_lliPrePauseTime)) / (vm_var64s)m_lliFreq;    dfRes += m_dInitialDelay;    return dfRes * m_uiFFModeMult;}UMC::StatusUMC::NULLAudioRender::Init(MediaReceiverParams* pInit){    Status umcRes = UMC_OK;    umcRes = BasicAudioRender::Init(pInit);    return umcRes;}UMC::StatusUMC::NULLAudioRender::Pause(bool bPause){    if (bPause && !m_bPaused)    {        m_lliPrePauseTime += vm_time_get_tick() - m_lliLastStartTime;        m_bPaused = true;    }    else if (!bPause && m_bPaused)    {        m_lliLastStartTime = vm_time_get_tick();        m_bPaused = false;    }    return UMC_OK;}floatUMC::NULLAudioRender::SetVolume(float /*volume*/){   return -1;    }floatUMC::NULLAudioRender::GetVolume(){   return -1;    }UMC::StatusUMC::NULLAudioRender::Close (){    m_lliLastStartTime = 0;    m_lliPrePauseTime = 0;    m_bPaused = true;    return BasicAudioRender::Close();}UMC::StatusUMC::NULLAudioRender::Reset (){    m_lliLastStartTime = 0;    m_lliPrePauseTime = 0;    m_bPaused = true;    return BasicAudioRender::Reset();}UMC::StatusUMC::NULLAudioRender::SendFrame(MediaData* in){    double dfStart = 0.0;    double dfEnd = 0.0;    Status umcRes = UMC_OK;    if (UMC_OK == umcRes)    {   umcRes = in->GetTime(dfStart, dfEnd);   }    //  If we "render" first frame and PTS starts    if (0 == m_lliLastStartTime && 0 == m_lliPrePauseTime)    {        if (0 != dfStart)        {   m_lliPrePauseTime = (vm_tick)(dfStart * (vm_var64s)m_lliFreq); }    }    if (UMC_OK == umcRes)    {   umcRes = Pause(false);  }    while (GetTimeTick() < dfEnd - 0.1)    {   vm_time_sleep(500);    }    return umcRes;}UMC::StatusUMC::NULLAudioRender::SetParams(MediaReceiverParams *pMedia){    UMC::Status umcRes = UMC::UMC_OK;    AudioRenderParams* pParams =        DynamicCast<AudioRenderParams, MediaReceiverParams>(pMedia);    if (NULL == pParams)    {   umcRes = UMC_NULL_PTR;  }    return UMC_OK;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -