- 博客(0)
- 资源 (5)
- 收藏
- 关注
RingBuffer.zip
基于链表的实现的环形缓冲,常用于编解码音视频数据环形缓冲区。typedef enum {
O_R_BLOCK,
O_W_BLOCK,
RW_BLOCK,
RW_UNBLOCK,
}RW_MODE;
typedef struct __NodeData{
unsigned char *data;
unsigned int len;
T_LLIST node;
}T_NODE_DATA,*PT_NODE_DATA;
typedef struct __RingBuf{
int node_max;
int node_num;
RW_MODE rw_mode;
pthread_mutex_t mutex; /* Lock the structure */
pthread_cond_t not_full; /* Full -> not full condition */
pthread_cond_t not_empty; /* Empty -> not empty condition */
T_NODE_DATA node_head;
}T_RING_BUFFER,*PT_RING_BUFFER;
2020-06-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人