Zephyr Project API 4.5.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

The top-level bin, and what actually runs a graph. More...

Files

file  mpipe_pipeline.h
 Pipeline: the top-level bin that runs a graph.

Data Structures

struct  mpipe
 A pipeline: the top-level bin that runs a graph. More...

Enumerations

enum  mpipe_prop_pipeline { MPIPE_PROP_PIPELINE_THREAD_PRIORITY }
 Properties for a pipeline. More...

Functions

int mpipe_pipeline_init (struct mpipe *pipe, uint8_t id)
 Initialize a pipeline.
int mpipe_push_buffer (struct mpipe_pad *src_pad, struct net_buf *buffer)
 Push a buffer downstream starting from a given source pad.

Detailed Description

The top-level bin, and what actually runs a graph.

A pipeline is the outermost Bins, which gives it three jobs no inner bin has. It owns the one thread that runs the graph: its state changes create, pause, resume and join it, and on it the loop acquires buffers from the source and pushes each one through every element's process function until a sink consumes it. A queue element gives a part of the graph a thread of its own. It orders the teardown: buffers still in flight are dropped before the children dismantle their pools, and the thread is joined only once the children have drained. A pause is not a teardown, so whatever is queued survives and a resume continues without loss. And it folds the end of the stream: a graph with several sinks produces one end-of-stream message per sink, and only the last one reaches the application.

Enumeration Type Documentation

◆ mpipe_prop_pipeline

#include <mpipe_pipeline.h>

Properties for a pipeline.

Enumeration of properties that can be configured for a pipeline

Enumerator
MPIPE_PROP_PIPELINE_THREAD_PRIORITY 

Thread scheduling priority used when the pipeline thread is created.

Defaults to

CONFIG_MPIPE_THREAD_DEFAULT_PRIORITY 

.

Function Documentation

◆ mpipe_pipeline_init()

int mpipe_pipeline_init ( struct mpipe * pipe,
uint8_t id )

#include <mpipe_pipeline.h>

Initialize a pipeline.

Initializes the pipeline structure, including the base bin and its message channel.

Parameters
pipePointer to the Multimedia Pipeline to initialize.
idUnique element identifier.
Returns
0 on success, negative errno otherwise.

◆ mpipe_push_buffer()

int mpipe_push_buffer ( struct mpipe_pad * src_pad,
struct net_buf * buffer )

#include <mpipe_pipeline.h>

Push a buffer downstream starting from a given source pad.

Walks downstream from an element's src_pad, calling each next element's process_fn until a sink is reached, a process_fn fails, or the output buffer is NULL.

The processing function owns the buffer it is given and releases it whether it succeeds or fails, so the walk does not release it on a processing error. The walk does release the buffer itself in the two cases where no processing function is reached: the source pad has no peer, and the peer pad is flushing.

Parameters
src_padSource pad to start pushing from (its peer's process_fn is first called)
bufferBuffer to push (ownership transferred)
Returns
0 on success, negative errno on failure