CPI_CircleBuffer.h
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:1k
源码类别:
VC书籍
开发平台:
Visual C++
- typedef void* CP_HCIRCLEBUFFER;
- typedef void (*pfn_CircleBufferUninitialise)(CP_HCIRCLEBUFFER bBuffer);
- //
- typedef void (*pfn_CircleBufferWrite)(CP_HCIRCLEBUFFER bBuffer, const void* pSourceBuffer, const unsigned int iNumBytes);
- typedef BOOL (*pfn_CircleBufferRead)(CP_HCIRCLEBUFFER bBuffer, void* pDestBuffer, const unsigned int iBytesToRead, unsigned int* pbBytesRead);
- typedef unsigned int (*pfn_CircleGetUsedSpace)(CP_HCIRCLEBUFFER bBuffer);
- typedef unsigned int (*pfn_CircleGetFreeSpace)(CP_HCIRCLEBUFFER bBuffer);
- typedef void (*pfn_CircleFlush)(CP_HCIRCLEBUFFER bBuffer);
- typedef void (*pfn_CircleSetComplete)(CP_HCIRCLEBUFFER bBuffer);
- typedef BOOL (*pfn_CircleIsComplete)(CP_HCIRCLEBUFFER bBuffer);
- //
- typedef struct _CPs_CircleBuffer
- {
- pfn_CircleBufferUninitialise Uninitialise;
- pfn_CircleBufferWrite Write;
- pfn_CircleBufferRead Read;
- pfn_CircleFlush Flush;
- pfn_CircleGetUsedSpace GetUsedSize;
- pfn_CircleGetFreeSpace GetFreeSize;
- pfn_CircleSetComplete SetComplete;
- pfn_CircleIsComplete IsComplete;
- BYTE* m_pBuffer;
- unsigned int m_iBufferSize;
- unsigned int m_iReadCursor;
- unsigned int m_iWriteCursor;
- HANDLE m_evtDataAvailable;
- CRITICAL_SECTION m_csCircleBuffer;
- BOOL m_bComplete;
- } CPs_CircleBuffer;
- //
- ////////////////////////////////////////////////////////////////////////////////
- CPs_CircleBuffer* CP_CreateCircleBuffer(const unsigned int iBufferSize);