xref: /rockchip-linux_mpp/osal/inc/mpp_callback.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */
2 /*
3  * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
4  */
5 
6 #ifndef __MPP_CALLBACK_H__
7 #define __MPP_CALLBACK_H__
8 
9 #include "rk_type.h"
10 #include "mpp_err.h"
11 
12 typedef MPP_RET (*MppCallBack)(const char *caller, void *ctx, RK_S32 cmd, void *param);
13 
14 typedef struct DecCallBackCtx_t {
15     MppCallBack callBack;
16     void        *ctx;
17     RK_S32      cmd;
18 } MppCbCtx;
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #define mpp_callback(ctx, param)  mpp_callback_f(__FUNCTION__, ctx, param)
25 
26 MPP_RET mpp_callback_f(const char *caller, MppCbCtx *ctx, void *param);
27 
28 #ifdef __cplusplus
29 }
30 #endif
31 
32 #endif /* __MPP_CALLBACK_H__ */
33