xref: /OK3568_Linux_fs/external/mpp/mpp/base/inc/mpp_meta_impl.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2015 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 __MPP_META_IMPL_H__
18 #define __MPP_META_IMPL_H__
19 
20 #include "mpp_common.h"
21 
22 #include "mpp_list.h"
23 #include "mpp_meta.h"
24 
25 typedef struct MppMetaDef_t {
26     MppMetaKey          key;
27     MppMetaType         type;
28 } MppMetaDef;
29 
30 typedef struct MppMetaVal_t {
31     RK_U32              state;
32     union {
33         RK_S32          val_s32;
34         RK_S64          val_s64;
35         void            *val_ptr;
36         MppFrame        frame;
37         MppPacket       packet;
38         MppBuffer       buffer;
39     };
40 } MppMetaVal;
41 
42 typedef struct MppMetaImpl_t {
43     char                tag[MPP_TAG_SIZE];
44     const char          *caller;
45     RK_S32              meta_id;
46     RK_S32              ref_count;
47 
48     struct list_head    list_meta;
49     RK_S32              node_count;
50     MppMetaVal          vals[];
51 } MppMetaImpl;
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 RK_S32 mpp_meta_size(MppMeta meta);
58 MPP_RET mpp_meta_dump(MppMeta meta);
59 MPP_RET mpp_meta_inc_ref(MppMeta meta);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /*__MPP_META_IMPL_H__*/
66