My Project
mmal_graph.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2012, Broadcom Europe Ltd
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the copyright holder nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef MMAL_GRAPH_H
29 #define MMAL_GRAPH_H
30 
31 #include "util/mmal_connection.h"
32 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
45 typedef enum
46 {
51 
53 
55 typedef struct MMAL_GRAPH_T
56 {
58  struct MMAL_GRAPH_USERDATA_T *userdata;
59 
61  void (*pf_destroy)(struct MMAL_GRAPH_T *);
62 
74  MMAL_STATUS_T (*pf_payload_alloc)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, uint32_t payload_size, uint8_t **);
76  MMAL_STATUS_T (*pf_payload_free)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, uint8_t *payload);
91 
92 } MMAL_GRAPH_T;
93 
101 MMAL_STATUS_T mmal_graph_create(MMAL_GRAPH_T **graph, unsigned int userdata_size);
102 
111 
128  MMAL_GRAPH_TOPOLOGY_T topology, int8_t *input, unsigned int input_num,
129  int8_t *output, unsigned int output_num);
130 
140 
149 
158 MMAL_STATUS_T mmal_graph_new_component(MMAL_GRAPH_T *graph, const char *name,
159  MMAL_COMPONENT_T **component);
160 
172  uint32_t flags, MMAL_CONNECTION_T **connection);
173 
181 typedef void (*MMAL_GRAPH_EVENT_CB)(MMAL_GRAPH_T *graph, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer,
182  void *cb_data);
183 
193 
195 
206  const char *name,
207  MMAL_PORT_TYPE_T type,
208  unsigned index);
209 
220  const char *name, MMAL_COMPONENT_T **component);
221 
230 
236 
237 #ifdef __cplusplus
238 }
239 #endif
240 
243 #endif /* MMAL_GRAPH_H */
MMAL_STATUS_T mmal_graph_component_constructor(const char *name, MMAL_COMPONENT_T *component)
MMAL_STATUS_T(* pf_payload_alloc)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, uint32_t payload_size, uint8_t **)
Definition: mmal_graph.h:74
MMAL_STATUS_T mmal_graph_component_topology(MMAL_GRAPH_T *graph, MMAL_COMPONENT_T *component, MMAL_GRAPH_TOPOLOGY_T topology, int8_t *input, unsigned int input_num, int8_t *output, unsigned int output_num)
MMAL_STATUS_T mmal_graph_new_component(MMAL_GRAPH_T *graph, const char *name, MMAL_COMPONENT_T **component)
MMAL_STATUS_T(* pf_parameter_get)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, MMAL_PARAMETER_HEADER_T *param)
Definition: mmal_graph.h:66
MMAL_STATUS_T(* pf_control_callback)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
Definition: mmal_graph.h:85
MMAL_STATUS_T(* pf_enable)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port)
Definition: mmal_graph.h:81
MMAL_STATUS_T mmal_graph_add_component(MMAL_GRAPH_T *graph, MMAL_COMPONENT_T *component)
MMAL_STATUS_T(* pf_return_buffer)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
Definition: mmal_graph.h:72
MMAL_STATUS_T mmal_graph_create(MMAL_GRAPH_T **graph, unsigned int userdata_size)
MMAL_STATUS_T(* pf_flush)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port)
Definition: mmal_graph.h:78
MMAL_PORT_TYPE_T
Definition: mmal_port.h:45
MMAL_STATUS_T mmal_graph_enable(MMAL_GRAPH_T *graph, MMAL_GRAPH_EVENT_CB cb, void *cb_data)
MMAL_STATUS_T mmal_graph_add_port(MMAL_GRAPH_T *graph, MMAL_PORT_T *port)
MMAL_STATUS_T(* pf_graph_enable)(struct MMAL_GRAPH_T *, MMAL_BOOL_T enable)
Definition: mmal_graph.h:87
MMAL_STATUS_T mmal_graph_new_connection(MMAL_GRAPH_T *graph, MMAL_PORT_T *out, MMAL_PORT_T *in, uint32_t flags, MMAL_CONNECTION_T **connection)
MMAL_STATUS_T mmal_graph_add_connection(MMAL_GRAPH_T *graph, MMAL_CONNECTION_T *connection)
MMAL_PORT_T * mmal_graph_find_port(MMAL_GRAPH_T *graph, const char *name, MMAL_PORT_TYPE_T type, unsigned index)
MMAL_STATUS_T(* pf_send_buffer)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
Definition: mmal_graph.h:70
struct MMAL_GRAPH_USERDATA_T * userdata
Definition: mmal_graph.h:58
void(* MMAL_GRAPH_EVENT_CB)(MMAL_GRAPH_T *graph, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer, void *cb_data)
Definition: mmal_graph.h:181
MMAL_STATUS_T(* pf_payload_free)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, uint8_t *payload)
Definition: mmal_graph.h:76
struct MMAL_GRAPH_T MMAL_GRAPH_T
MMAL_STATUS_T mmal_graph_disable(MMAL_GRAPH_T *graph)
MMAL_GRAPH_TOPOLOGY_T
Definition: mmal_graph.h:45
void(* pf_destroy)(struct MMAL_GRAPH_T *)
Definition: mmal_graph.h:61
MMAL_STATUS_T mmal_graph_destroy(MMAL_GRAPH_T *ctx)
int32_t MMAL_BOOL_T
Definition: mmal_common.h:60
MMAL_STATUS_T(* pf_disable)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port)
Definition: mmal_graph.h:83
MMAL_STATUS_T(* pf_parameter_set)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port, const MMAL_PARAMETER_HEADER_T *param)
Definition: mmal_graph.h:64
MMAL_STATUS_T(* pf_connection_buffer)(struct MMAL_GRAPH_T *, MMAL_CONNECTION_T *connection, MMAL_BUFFER_HEADER_T *buffer)
Definition: mmal_graph.h:90
MMAL_STATUS_T
Definition: mmal_types.h:46
MMAL_STATUS_T mmal_graph_build(MMAL_GRAPH_T *ctx, const char *name, MMAL_COMPONENT_T **component)
MMAL_STATUS_T(* pf_format_commit)(struct MMAL_GRAPH_T *, MMAL_PORT_T *port)
Definition: mmal_graph.h:68