xref: /OK3568_Linux_fs/external/mpp/mpp/codec/inc/rc_data_base.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2016 Rockchip Electronics Co. LTD
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __RC_DATA_BASE_H__
18 #define __RC_DATA_BASE_H__
19 
20 #include "rk_type.h"
21 #include "mpp_err.h"
22 
23 /*
24  * cyclic fifo buffer management
25  * Not use new [] for memory management with mpp_malloc/mpp_free
26  */
27 typedef struct NodeGroup_t {
28     /* size of the whole data node in byte */
29     RK_S32              node_size;
30 
31     /* max number of node */
32     RK_S32              node_count;
33 
34     void                *first;
35     void                *last;
36 } NodeGroup;
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 MPP_RET node_group_init(NodeGroup **grp, RK_S32 node_size, RK_S32 node_count);
43 MPP_RET node_group_deinit(NodeGroup *p);
44 
45 void *node_group_get(NodeGroup *p, RK_S32 idx);
46 MPP_RET node_group_check(NodeGroup *p, void *node);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif /* __RC_DATA_BASE_H__ */
53