xref: /rockchip-linux_mpp/mpp/inc/mpp_cfg.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */
2 /*
3  * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
4  */
5 
6 #ifndef __MPP_CFG_H__
7 #define __MPP_CFG_H__
8 
9 #include "mpp_internal.h"
10 
11 /* header size 128 byte */
12 typedef struct MppCfgInfoHead_t {
13     char            version[116];
14     RK_S32          info_size;
15     RK_S32          info_count;
16     RK_S32          node_count;
17 } MppCfgInfoHead;
18 
19 #ifdef  __cplusplus
20 extern "C" {
21 #endif
22 
23 MPP_RET mpp_cfg_set_s32(MppCfgInfo *info, void *cfg, RK_S32 val);
24 MPP_RET mpp_cfg_get_s32(MppCfgInfo *info, void *cfg, RK_S32 *val);
25 MPP_RET mpp_cfg_set_u32(MppCfgInfo *info, void *cfg, RK_U32 val);
26 MPP_RET mpp_cfg_get_u32(MppCfgInfo *info, void *cfg, RK_U32 *val);
27 MPP_RET mpp_cfg_set_s64(MppCfgInfo *info, void *cfg, RK_S64 val);
28 MPP_RET mpp_cfg_get_s64(MppCfgInfo *info, void *cfg, RK_S64 *val);
29 MPP_RET mpp_cfg_set_u64(MppCfgInfo *info, void *cfg, RK_U64 val);
30 MPP_RET mpp_cfg_get_u64(MppCfgInfo *info, void *cfg, RK_U64 *val);
31 MPP_RET mpp_cfg_set_st(MppCfgInfo *info, void *cfg, void *val);
32 MPP_RET mpp_cfg_get_st(MppCfgInfo *info, void *cfg, void *val);
33 MPP_RET mpp_cfg_set_ptr(MppCfgInfo *info, void *cfg, void *val);
34 MPP_RET mpp_cfg_get_ptr(MppCfgInfo *info, void *cfg, void **val);
35 
36 #define MPP_CFG_SET_s32(info, cfg, val) (mpp_cfg_set_s32)(info, cfg, val)
37 #define MPP_CFG_GET_s32(info, cfg, val) (mpp_cfg_get_s32)(info, cfg, (RK_S32 *)(val))
38 #define MPP_CFG_SET_u32(info, cfg, val) (mpp_cfg_set_u32)(info, cfg, val)
39 #define MPP_CFG_GET_u32(info, cfg, val) (mpp_cfg_get_u32)(info, cfg, (RK_U32 *)(val))
40 #define MPP_CFG_SET_s64(info, cfg, val) (mpp_cfg_set_s64)(info, cfg, val)
41 #define MPP_CFG_GET_s64(info, cfg, val) (mpp_cfg_get_s64)(info, cfg, (RK_S64 *)(val))
42 #define MPP_CFG_SET_u64(info, cfg, val) (mpp_cfg_set_u64)(info, cfg, val)
43 #define MPP_CFG_GET_u64(info, cfg, val) (mpp_cfg_get_u64)(info, cfg, (RK_U64 *)(val))
44 #define MPP_CFG_SET_st(info, cfg, val)  (mpp_cfg_set_st )(info, cfg, val)
45 #define MPP_CFG_GET_st(info, cfg, val)  (mpp_cfg_get_st )(info, cfg, (void *)(val))
46 #define MPP_CFG_SET_ptr(info, cfg, val) (mpp_cfg_set_ptr)(info, cfg, val)
47 #define MPP_CFG_GET_ptr(info, cfg, val) (mpp_cfg_get_ptr)(info, cfg, (void **)(val))
48 
49 const char *strof_cfg_type(CfgType type);
50 
51 #define CHECK_CFG_INFO(node, name, type) \
52     check_cfg_info(node, name, type, __FUNCTION__)
53 
54 MPP_RET check_cfg_info(MppCfgInfo *node, const char *name, CfgType type,
55                        const char *func);
56 
57 #ifdef  __cplusplus
58 }
59 #endif
60 
61 #endif /*__MPP_CFG_H__*/
62