xref: /rockchip-linux_mpp/mpp/base/inc/mpp_meta_impl.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
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 #include "rk_venc_cmd.h"
25 
26 typedef struct MppMetaVal_t {
27     RK_U32              state;
28     union {
29         RK_S32          val_s32;
30         RK_S64          val_s64;
31         void            *val_ptr;
32         MppFrame        frame;
33         MppPacket       packet;
34         MppBuffer       buffer;
35         RK_U64          val_kptr;   /* kernel object userspace address */
36     };
37 } MppMetaVal;
38 
39 typedef struct MppMetaImpl_t {
40     char                tag[MPP_TAG_SIZE];
41     const char          *caller;
42     RK_S32              meta_id;
43     RK_S32              ref_count;
44 
45     struct list_head    list_meta;
46     RK_S32              node_count;
47     MppEncUserData      user_data;
48     MppEncUserDataSet   user_data_set;
49     RK_U32              datas_buf_size;
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 RK_S32 mpp_meta_s32_read(MppMeta meta, RK_S32 index, RK_S32 *val);
62 
63 extern RK_S32 meta_hdr_offset_index;
64 extern RK_S32 meta_hdr_size_index;
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /*__MPP_META_IMPL_H__*/
71