My Project
|
00001 /* 00002 Copyright (c) 2012, Broadcom Europe Ltd 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are met: 00007 * Redistributions of source code must retain the above copyright 00008 notice, this list of conditions and the following disclaimer. 00009 * Redistributions in binary form must reproduce the above copyright 00010 notice, this list of conditions and the following disclaimer in the 00011 documentation and/or other materials provided with the distribution. 00012 * Neither the name of the copyright holder nor the 00013 names of its contributors may be used to endorse or promote products 00014 derived from this software without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00028 #ifndef MMAL_GRAPH_H 00029 #define MMAL_GRAPH_H 00030 00031 #include "util/mmal_connection.h" 00032 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00045 typedef struct MMAL_GRAPH_T 00046 { 00048 struct MMAL_GRAPH_USERDATA_T *userdata; 00049 00051 void (*pf_destroy)(struct MMAL_GRAPH_T *); 00052 00054 MMAL_STATUS_T (*pf_parameter_set)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, const MMAL_PARAMETER_HEADER_T *param); 00056 MMAL_STATUS_T (*pf_parameter_get)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, MMAL_PARAMETER_HEADER_T *param); 00058 MMAL_STATUS_T (*pf_format_commit)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port); 00060 MMAL_STATUS_T (*pf_send_buffer)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); 00062 MMAL_STATUS_T (*pf_return_buffer)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); 00064 MMAL_STATUS_T (*pf_payload_alloc)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, uint32_t payload_size, uint8_t **); 00066 MMAL_STATUS_T (*pf_payload_free)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, uint8_t *payload); 00068 MMAL_STATUS_T (*pf_flush)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port); 00069 00070 } MMAL_GRAPH_T; 00071 00079 MMAL_STATUS_T mmal_graph_create(MMAL_GRAPH_T **graph, unsigned int userdata_size); 00080 00088 MMAL_STATUS_T mmal_graph_add_component(MMAL_GRAPH_T *graph, MMAL_COMPONENT_T *component); 00089 00098 MMAL_STATUS_T mmal_graph_add_port(MMAL_GRAPH_T *graph, MMAL_PORT_T *port); 00099 00107 MMAL_STATUS_T mmal_graph_add_connection(MMAL_GRAPH_T *graph, MMAL_CONNECTION_T *connection); 00108 00117 MMAL_STATUS_T mmal_graph_new_component(MMAL_GRAPH_T *graph, const char *name, 00118 MMAL_COMPONENT_T **component); 00119 00130 MMAL_STATUS_T mmal_graph_new_connection(MMAL_GRAPH_T *graph, MMAL_PORT_T *out, MMAL_PORT_T *in, 00131 uint32_t flags, MMAL_CONNECTION_T **connection); 00132 00140 typedef void (*MMAL_GRAPH_EVENT_CB)(MMAL_GRAPH_T *graph, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer, 00141 void *cb_data); 00142 00151 MMAL_STATUS_T mmal_graph_enable(MMAL_GRAPH_T *graph, MMAL_GRAPH_EVENT_CB cb, void *cb_data); 00152 00153 MMAL_STATUS_T mmal_graph_disable(MMAL_GRAPH_T *graph); 00154 00164 MMAL_PORT_T *mmal_graph_find_port(MMAL_GRAPH_T *graph, 00165 const char *name, 00166 MMAL_PORT_TYPE_T type, 00167 unsigned index); 00168 00178 MMAL_STATUS_T mmal_graph_build(MMAL_GRAPH_T *ctx, 00179 const char *name, MMAL_COMPONENT_T **component); 00180 00188 MMAL_STATUS_T mmal_graph_component_constructor(const char *name, MMAL_COMPONENT_T *component); 00189 00194 MMAL_STATUS_T mmal_graph_destroy(MMAL_GRAPH_T *ctx); 00195 00196 #ifdef __cplusplus 00197 } 00198 #endif 00199 00202 #endif /* MMAL_GRAPH_H */