My Project
Classes | Typedefs | Functions
Graph Utility
Utility functions

Classes

struct  MMAL_GRAPH_T

Typedefs

typedef struct MMAL_GRAPH_T MMAL_GRAPH_T
typedef void(* MMAL_GRAPH_EVENT_CB )(MMAL_GRAPH_T *graph, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer, void *cb_data)

Functions

MMAL_STATUS_T mmal_graph_create (MMAL_GRAPH_T **graph, unsigned int userdata_size)
MMAL_STATUS_T mmal_graph_add_component (MMAL_GRAPH_T *graph, MMAL_COMPONENT_T *component)
MMAL_STATUS_T mmal_graph_add_port (MMAL_GRAPH_T *graph, MMAL_PORT_T *port)
MMAL_STATUS_T mmal_graph_add_connection (MMAL_GRAPH_T *graph, MMAL_CONNECTION_T *connection)
MMAL_STATUS_T mmal_graph_new_component (MMAL_GRAPH_T *graph, const char *name, MMAL_COMPONENT_T **component)
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_enable (MMAL_GRAPH_T *graph, MMAL_GRAPH_EVENT_CB cb, void *cb_data)
MMAL_STATUS_T mmal_graph_disable (MMAL_GRAPH_T *graph)
MMAL_PORT_Tmmal_graph_find_port (MMAL_GRAPH_T *graph, const char *name, MMAL_PORT_TYPE_T type, unsigned index)
MMAL_STATUS_T mmal_graph_build (MMAL_GRAPH_T *ctx, const char *name, MMAL_COMPONENT_T **component)
MMAL_STATUS_T mmal_graph_component_constructor (const char *name, MMAL_COMPONENT_T *component)
MMAL_STATUS_T mmal_graph_destroy (MMAL_GRAPH_T *ctx)

Detailed Description

The graph utility functions allows one to easily create graphs of MMAL components.


Typedef Documentation

typedef void(* MMAL_GRAPH_EVENT_CB)(MMAL_GRAPH_T *graph, MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer, void *cb_data)

Definition of the callback used by a graph to send events to the client.

Parameters:
graphthe graph sending the event
portthe port which generated the event
bufferthe buffer header containing the event data
cb_datadata passed back to the client when the callback is invoked
typedef struct MMAL_GRAPH_T MMAL_GRAPH_T

Structure describing a graph


Function Documentation

Add a component to a graph. Allows the client to add a component to the graph.

Parameters:
graphinstance of the graph
componentcomponent to add to a graph
Returns:
MMAL_SUCCESS on success

Add a connection to a graph. Allows the client to add an internal connection to a graph.

Parameters:
graphinstance of the graph
connectionconnection to add to the graph
Returns:
MMAL_SUCCESS on success

Add a port to a graph. Allows the client to add an input or output port to a graph. The given port will effectively become an end point for the graph.

Parameters:
graphinstance of the graph
portport to add to the graph
Returns:
MMAL_SUCCESS on success
MMAL_STATUS_T mmal_graph_build ( MMAL_GRAPH_T ctx,
const char *  name,
MMAL_COMPONENT_T **  component 
)

Create an instance of a component from a graph. The newly created component will expose input and output ports to the client. Not that all the exposed ports will be in a disabled state by default.

Parameters:
graphgraph to create the component from
namename of the component to create
componentreturned component
Returns:
MMAL_SUCCESS on success
MMAL_STATUS_T mmal_graph_component_constructor ( const char *  name,
MMAL_COMPONENT_T component 
)

Component constructor for a graph. FIXME: private function

Parameters:
namename of the component to create
componentcomponent
Returns:
MMAL_SUCCESS on success
MMAL_STATUS_T mmal_graph_create ( MMAL_GRAPH_T **  graph,
unsigned int  userdata_size 
)

Create an instance of a graph. The newly created graph will need to be populated by the client.

Parameters:
graphreturned graph
userdata_sizesize to be allocated for the userdata field
Returns:
MMAL_SUCCESS on success

Destroy a previously created graph

Parameters:
graphgraph to destroy
Returns:
MMAL_SUCCESS on success
MMAL_STATUS_T mmal_graph_enable ( MMAL_GRAPH_T graph,
MMAL_GRAPH_EVENT_CB  cb,
void *  cb_data 
)

Enable the graph and start processing.

Parameters:
graphthe graph to enable
cbthe callback to invoke when an event occurs on any of the internal control ports
cb_datadata passed back to the client when the callback is invoked
Returns:
MMAL_SUCCESS on success
MMAL_PORT_T* mmal_graph_find_port ( MMAL_GRAPH_T graph,
const char *  name,
MMAL_PORT_TYPE_T  type,
unsigned  index 
)

Find a port in the graph.

Parameters:
graphgraph instance
namename of the component of interest
typetype of port (in/out)
indexwhich port index within the component
Returns:
port, or NULL if not found
MMAL_STATUS_T mmal_graph_new_component ( MMAL_GRAPH_T graph,
const char *  name,
MMAL_COMPONENT_T **  component 
)

Create a new component and add it to a graph. Allows the client to create and add a component to the graph.

Parameters:
graphinstance of the graph
namename of the component to create
componentif not NULL, will contain a pointer to the created component
Returns:
MMAL_SUCCESS on success
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 
)

Create and add a connection to a graph. Allows the client to create and add an internal connection to a graph.

Parameters:
graphinstance of the graph
outthe output port to use for the connection
inthe input port to use for the connection
flagsthe flags specifying which type of connection should be created
connectionif not NULL, will contain a pointer to the created connection
Returns:
MMAL_SUCCESS on success
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines