sdla_render.h

来自「这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数」· C头文件 代码 · 共 81 行

H
81
字号
/*//////////////////////////////////////////////////////////////////////////////////                  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.//*/#ifndef __SDLAUDIO_RENDER_H__#define __SDLAUDIO_RENDER_H__#if defined(SDL_ON) && (defined(LINUX32) || defined(WIN32))#include <SDL/SDL.h>#include "uimc_structures.h"#include "uimc_audio_render.h"#include "vm_semaphore.h"#include "vm_time.h"#define NUM_SND_BUFFER 32class SDLAudioRender :public AudioRender {public:    /* Initialize the audio device. The playback is paused */    UMC_Status Init(AudioRenderParams* pInit);    /* Write sound data to sound buffer */    UMC_Status SendFrame(sMediaData* in);    /* Send EOF to sound buffer */    void SendEOF(void);    /* Toggle pause mode. Return current pts */    UMC_Status Pause(bool pause);    /* Close the sound device */    UMC_Status Close(void);    float SetVolume(float volume) { return volume;};   /* 0-silence 1-max, return previous volume */    float GetVolume() { return 0.;};    UMC_Status Reset(void) { return UMC_OPERATION_FAILED; };    SDLAudioRender(void);    ~SDLAudioRender(void);    // Audio Reference Clock    double GetTime(void);    // Estimated value of device latency    double GetDelay(void);    // Estimated value of difference between independent ref clock and pts    double GetClockOffset(void);    void   AudioThreadFunc(Uint8 *stream, int nbytes);protected:    bool    m_bInitSemaphore;    struct SndBuffer {        unsigned char *buffer;        int nbytes;        double pts;    };    SDL_AudioSpec spec;    SndBuffer buffers[NUM_SND_BUFFER];    int read_index, read_position, write_index, nbuffer;    vm_semaphore sm_read_buffer, sm_write_buffer;    double prev_rpts, prev_pts, offset;    double    GetPTS(void);};#endif    //    defined(SDL_ON) && (defined(LINUX32) || defined(WIN32))#endif    //    __SDLAUDIO_RENDER_H__

⌨️ 快捷键说明

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