-
Notifications
You must be signed in to change notification settings - Fork 2
/
queue.h
53 lines (43 loc) · 1.41 KB
/
queue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
//------------------cache-start--------------------
//定义函数结果状态码
#define OK 1
#define ERROR 0
#define TRUE 1
#define FALSE 0
//定义循环队列空间大小
#define QUEUESIZE 100
typedef struct _frame
{
//unsigned char *data;//存储队列元素
uint8_t *data;
//int len;//队列头指针
size_t len;
unsigned long pts;
unsigned long start_pts;
//unsigned long dts;
uint32_t timestamp;
uint16_t seqnum;
int64_t start_timestamp;
}frame; //frame
//定义数据类型
typedef frame ElemType ;
//循环队列存储结构
typedef struct _CircleQueue
{
ElemType data[QUEUESIZE];//存储队列元素
int front;//队列头指针
int rear;//队列尾指针
int count;//队列元素个数
}CircleQueue;
int InitQueue(CircleQueue *queue) ;
int IsQueueEmpty(CircleQueue *queue) ;
int IsQueueFull(CircleQueue *queue) ;
int EnQueue(CircleQueue *queue, ElemType e) ;
ElemType DeQueue(CircleQueue *queue) ;
ElemType GetHead(CircleQueue *queue) ;
int ClearQueue(CircleQueue *queue ) ;
int GetLength(CircleQueue *queue) ;
//---------------cache-end------------