RingBuffer.h
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:1k
- /**************************************************************************************
- * *
- * *
- **************************************************************************************/
- #ifndef RING_BUFFER_H
- #define RING_BUFFER_H
- #include <stdlib.h>
- #include <string.h>
- #define RING_SIZE 128000
- class MediaRingBuffer {
- private:
- char *ring;
- unsigned int read_pos;
- unsigned int write_pos;
- public:
- MediaRingBuffer();
- ~MediaRingBuffer();
- void Init();
- void Read(char *outData, unsigned int size);
- void Write(char *inData, unsigned int size);
- int IsFullFor(unsigned int size);
- };
- #endif