1 /* 2 * Copyright 2017 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_EVENT_TRIGGER_H__ 18 #define __MPP_EVENT_TRIGGER_H__ 19 20 typedef void (*event_trigger)(void *parent, void *event); 21 22 struct ievent { 23 int idx; 24 void *event; 25 }; 26 27 struct event_packet { 28 int cnt; 29 int loop; 30 struct ievent e[128]; 31 }; 32 33 struct event_ctx { 34 int (*notify)(void *param); 35 }; 36 37 struct event_ctx* event_ctx_create(struct event_packet *e, 38 event_trigger trigger, void *parent); 39 void event_ctx_release(struct event_ctx *ictx); 40 41 #endif 42