1 /* 2 * Copyright 2021 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_CLUSTER_H__ 18 #define __MPP_CLUSTER_H__ 19 20 #include "mpp_err.h" 21 #include "mpp_list.h" 22 #include "mpp_thread.h" 23 #include "mpp_dev_defs.h" 24 25 #define MAX_PRIORITY 1 26 27 typedef void* MppNode; 28 29 typedef MPP_RET (*TaskProc)(void *param); 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 MPP_RET mpp_node_init(MppNode *node); 36 MPP_RET mpp_node_deinit(MppNode node); 37 38 MPP_RET mpp_node_set_func(MppNode node, TaskProc proc, void *param); 39 40 MPP_RET mpp_node_attach(MppNode node, MppClientType type); 41 MPP_RET mpp_node_detach(MppNode node); 42 43 #define mpp_node_trigger(node, trigger) mpp_node_trigger_f(__FUNCTION__, node, trigger) 44 45 MPP_RET mpp_node_trigger_f(const char *caller, MppNode node, RK_S32 trigger); 46 47 #ifdef __cplusplus 48 } 49 #endif 50 51 #endif /*__MPP_CLUSTER_H__*/ 52