📄 buffer.h
字号:
/* Copyright (C) 2007 ROCK-CHIPS FUZHOU . All Rights Reserved. */
/*
File : \Audio\buffer\
Desc : Buffer
Author : FSH
Date : 2007-06-01
Notes :
$Log :
* FSH 2007/06/01 建立此文件
*
* Vincent 2007/08/xx 少量改动
*/
/****************************************************************/
#ifndef _BUFFER_H_
#define _BUFFER_H_
//****************************************************************************
//
// 环形缓冲区的当前状态
//
//****************************************************************************
typedef struct sbs
{
//
// A pointer to the circular buffer containing the left channel data.
//
short *psLeft;
//
// A pointer to the circular buffer containing the right channel data.
//
short *psRight;
//
// The length of the circular buffer.
//
long lLength;
//
// The next point in the circular buffer where data will be read.
//
long lReadPtr;
//
// The next point in the circular buffer where data will be written.
//
long lWritePtr;
//
// The instance data for this buffer.
//
long lInstanceData;
} BufferState;
//****************************************************************************
//
// Function prototypes.
//
//****************************************************************************
extern void BufferInit(BufferState *psBuffer,
long(*pfnIoctl)(unsigned long ulIoctl,
BufferState *psBuffer,
unsigned long ulParam1,
unsigned long ulParam2,
unsigned long ulParam3),
long lInstanceData);
extern long BufferSetBuffer(BufferState *psBuffer, short *psLeft,
short *psRight, long lLength);
extern long BufferDataAvailable(BufferState *psBuffer);
extern long BufferSpaceAvailable(BufferState *psBuffer, int skip);
extern long BufferIsEmpty(BufferState *psBuffer);
extern long BufferGetWritePointer(BufferState *psBuffer, short **ppsLeft,
short **ppsRight, long *plLength, int skip);
extern long BufferUpdateWritePointer(BufferState *psBuffer, long lLength, int skip);
extern long BufferGetReadPointer(BufferState *psBuffer, short **ppsLeft,
short **ppsRight, long *plLength);
extern long BufferUpdateReadPointer(BufferState *psBuffer, long lLength);
extern long BufferUpdateReadPointerJS(BufferState *psBuffer, long lLength);
extern long BufferSetSampleRate(BufferState *psBuffer, long lSampleRate);
#endif // #ifndef _BUFFER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -