【文件属性】:
文件名称:RingBuffer.zip
文件大小:4KB
文件格式:ZIP
更新时间:2023-07-03 11:10:07
C 链表 图像编解码 常用缓冲区
基于链表的实现的环形缓冲,常用于编解码音视频数据环形缓冲区。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;
【文件预览】:
llist.h
main.c
ringbuf.h
ringbuf.c