xref: /rockchip-linux_mpp/kmpp/base/inc/kmpp_meta.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */
2 /*
3  * Copyright (c) 2025 Rockchip Electronics Co., Ltd.
4  */
5 
6 #ifndef __KMPP_META_H__
7 #define __KMPP_META_H__
8 
9 #include "mpp_meta.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #define KmppMetaKey MppMetaKey
16 
17 #define kmpp_meta_get_f(meta)   kmpp_meta_get(meta, __FUNCTION__)
18 #define kmpp_meta_put_f(meta)   kmpp_meta_put(meta, __FUNCTION__)
19 #define kmpp_meta_size_f(meta)  kmpp_meta_size(meta, __FUNCTION__)
20 #define kmpp_meta_dump_f(meta)  kmpp_meta_dump(meta, __FUNCTION__)
21 
22 rk_s32 kmpp_meta_get(KmppMeta *meta, const char *caller);
23 rk_s32 kmpp_meta_put(KmppMeta meta, const char *caller);
24 rk_s32 kmpp_meta_size(KmppMeta meta, const char *caller);
25 rk_s32 kmpp_meta_dump(KmppMeta meta, const char *caller);
26 rk_s32 kmpp_meta_dump_all(const char *caller);
27 
28 rk_s32 kmpp_meta_set_s32(KmppMeta meta, KmppMetaKey key, rk_s32 val);
29 rk_s32 kmpp_meta_set_s64(KmppMeta meta, KmppMetaKey key, rk_s64 val);
30 rk_s32 kmpp_meta_set_ptr(KmppMeta meta, KmppMetaKey key, void  *val);
31 rk_s32 kmpp_meta_get_s32(KmppMeta meta, KmppMetaKey key, rk_s32 *val);
32 rk_s32 kmpp_meta_get_s64(KmppMeta meta, KmppMetaKey key, rk_s64 *val);
33 rk_s32 kmpp_meta_get_ptr(KmppMeta meta, KmppMetaKey key, void  **val);
34 rk_s32 kmpp_meta_get_s32_d(KmppMeta meta, KmppMetaKey key, rk_s32 *val, rk_s32 def);
35 rk_s32 kmpp_meta_get_s64_d(KmppMeta meta, KmppMetaKey key, rk_s64 *val, rk_s64 def);
36 rk_s32 kmpp_meta_get_ptr_d(KmppMeta meta, KmppMetaKey key, void  **val, void *def);
37 
38 rk_s32 kmpp_meta_set_obj(KmppMeta meta, KmppMetaKey key, KmppObj obj);
39 rk_s32 kmpp_meta_get_obj(KmppMeta meta, KmppMetaKey key, KmppObj *obj);
40 rk_s32 kmpp_meta_get_obj_d(KmppMeta meta, KmppMetaKey key, KmppObj *obj, KmppObj def);
41 rk_s32 kmpp_meta_set_shm(KmppMeta meta, KmppMetaKey key, KmppShmPtr *sptr);
42 rk_s32 kmpp_meta_get_shm(KmppMeta meta, KmppMetaKey key, KmppShmPtr *sptr);
43 rk_s32 kmpp_meta_get_shm_d(KmppMeta meta, KmppMetaKey key, KmppShmPtr *sptr, KmppShmPtr *def);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /*__KMPP_META_H__*/
50