• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef SAMPLE_IVE_QUEUE_H
16 #define SAMPLE_IVE_QUEUE_H
17 
18 #include "hi_type.h"
19 
20 #ifdef __cplusplus
21 #if __cplusplus
22 extern "C" {
23 #endif
24 #endif /* __cplusplus */
25 
26 typedef struct hiSAMPLE_IVE_NODE_S {
27     VIDEO_FRAME_INFO_S stFrameInfo;
28     struct hiSAMPLE_IVE_NODE_S *next;
29 } SAMPLE_IVE_NODE_S;
30 
31 typedef struct hiSAMPLE_IVE_QUEUE_S {
32     SAMPLE_IVE_NODE_S *front, *rear;
33 } SAMPLE_IVE_QUEUE_S;
34 
35 
36 #define QUEUE_CORE_ERROR_BASE     (1)
37 #define QUEUE_CORE_FRAMEWORK_ERROR_BASE (QUEUE_CORE_ERROR_BASE + 10000)
38 
39 #define QUEUE_NULL_POINTER        (QUEUE_CORE_FRAMEWORK_ERROR_BASE + 1)
40 #define QUEUE_ILLEGAL_STATE       (QUEUE_CORE_FRAMEWORK_ERROR_BASE + 2)
41 #define QUEUE_OUT_OF_MEMORY       (QUEUE_CORE_FRAMEWORK_ERROR_BASE + 3)
42 
43 SAMPLE_IVE_QUEUE_S* SAMPLE_IVE_QueueCreate(HI_S32 s32Len);
44 HI_VOID SAMPLE_IVE_QueueDestory(SAMPLE_IVE_QUEUE_S* pstQueueHead);
45 HI_VOID SAMPLE_IVE_QueueClear(SAMPLE_IVE_QUEUE_S* pstQueueHead);
46 HI_BOOL SAMPLE_IVE_QueueIsEmpty(SAMPLE_IVE_QUEUE_S* pstQueueHead);
47 HI_S32 SAMPLE_IVE_QueueSize(SAMPLE_IVE_QUEUE_S* pstQueueHead);
48 HI_S32 SAMPLE_IVE_QueueAddNode(SAMPLE_IVE_QUEUE_S* pstQueueHead, VIDEO_FRAME_INFO_S *pstFrameInfo);
49 SAMPLE_IVE_NODE_S* SAMPLE_IVE_QueueGetHeadNode(SAMPLE_IVE_QUEUE_S* pstQueueHead);
50 SAMPLE_IVE_NODE_S* SAMPLE_IVE_QueueGetNode(SAMPLE_IVE_QUEUE_S* pstQueueHead);
51 HI_VOID SAMPLE_IVE_QueueFreeNode(SAMPLE_IVE_NODE_S *pstNode);
52 
53 #ifdef __cplusplus
54 #if __cplusplus
55 }
56 #endif
57 #endif /* __cplusplus */
58 
59 #endif /* SAMPLE_IVE_QUEUE_H */
60