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

Pad structure. More...

#include <mpipe_pad.h>

Data Fields

struct mpipe_object object
 Base object.
enum mpipe_pad_direction direction
 Pad direction, cannot change after creating the pad.
enum mpipe_pad_presence presence
 Pad presence.
enum mpipe_pad_mode mode
 Operating mode.
struct mpipe_pad * peer
 Pointer to the peer pad this pad is linked to.
struct mpipe_structure caps
 Pad's capability.
atomic_t flushing
 Flushing gate.
int(* process_fn )(struct mpipe_pad *pad, struct net_buf *in_buf, struct net_buf **out_buf)
 Process a buffer.
int(* query_fn )(struct mpipe_pad *pad, struct mpipe_dispatch *query)
 Answer a query.
int(* event_fn )(struct mpipe_pad *pad, struct mpipe_dispatch *event)
 Handle an event.
int(* enum_caps_fn )(struct mpipe_pad *pad, uint32_t index, const struct mpipe_structure *filter, struct mpipe_structure *out)
 Produce one of the pad's supported capabilities.

Detailed Description

Pad structure.

The pad structure represents a connection point of an element. Pads are used to negotiate capabilities and transfer data between elements.

Field Documentation

◆ caps

struct mpipe_structure mpipe_pad::caps

Pad's capability.

ANY until one is negotiated, reset back to ANY on PAUSED to READY

◆ direction

enum mpipe_pad_direction mpipe_pad::direction

Pad direction, cannot change after creating the pad.

◆ enum_caps_fn

int(* mpipe_pad::enum_caps_fn) (struct mpipe_pad *pad, uint32_t index, const struct mpipe_structure *filter, struct mpipe_structure *out)

Produce one of the pad's supported capabilities.

This is how an element says what it supports. The framework calls it with index 0, 1, 2 and so on, one capability per call, until it reports -ENOENT, so several formats live on the index rather than in a list. A capability known at build time is copied out of a static structure; one only known at run time is built by querying the driver. When filter is given, produce the capability narrowed by it, which mpipe_pad_enum_filter does, and report -EAGAIN when this index cannot satisfy it, so the walk moves on to the next one. The default produces the pad's own capability at index 0 and nothing past it.

Parameters
padPad to enumerate
indexZero-based index of the capability
filterCapability to narrow by, may be NULL
[out]outCaller storage for the capability
Return values
0Success.
-EAGAINThis index cannot satisfy filter
-ENOENTPast the last capability

◆ event_fn

int(* mpipe_pad::event_fn) (struct mpipe_pad *pad, struct mpipe_dispatch *event)

Handle an event.

Parameters
padPad the event arrives on
eventEvent to act on and forward
Returns
0 on success, negative errno on failure

◆ flushing

atomic_t mpipe_pad::flushing

Flushing gate.

While set, buffers are dropped instead of processed

◆ mode

enum mpipe_pad_mode mpipe_pad::mode

Operating mode.

◆ object

struct mpipe_object mpipe_pad::object

Base object.

◆ peer

struct mpipe_pad* mpipe_pad::peer

Pointer to the peer pad this pad is linked to.

◆ presence

enum mpipe_pad_presence mpipe_pad::presence

Pad presence.

◆ process_fn

int(* mpipe_pad::process_fn) (struct mpipe_pad *pad, struct net_buf *in_buf, struct net_buf **out_buf)

Process a buffer.

The element's processing function, called on its sink pad for every buffer pushed to it. It owns in_buf and releases it whether it succeeds or fails, and hands back what it produced: a new buffer from its pool, the same buffer transformed in place or passed through, or NULL when it consumed the input, which ends the push.

Parameters
padSink pad the buffer arrives on
in_bufBuffer to process
[out]out_bufBuffer produced, or NULL when the input was consumed
Returns
0 on success, negative errno on failure

◆ query_fn

int(* mpipe_pad::query_fn) (struct mpipe_pad *pad, struct mpipe_dispatch *query)

Answer a query.

Parameters
padPad the query arrives on
queryQuery to answer in place
Returns
0 on success, negative errno on failure

The documentation for this struct was generated from the following file: