|
Zephyr Project API 4.5.0-rc2
A Scalable Open Source RTOS
|
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. | |
Pad structure.
The pad structure represents a connection point of an element. Pads are used to negotiate capabilities and transfer data between elements.
| struct mpipe_structure mpipe_pad::caps |
Pad's capability.
ANY until one is negotiated, reset back to ANY on PAUSED to READY
| enum mpipe_pad_direction mpipe_pad::direction |
Pad direction, cannot change after creating the pad.
| 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.
| pad | Pad to enumerate | |
| index | Zero-based index of the capability | |
| filter | Capability to narrow by, may be NULL | |
| [out] | out | Caller storage for the capability |
| 0 | Success. |
| -EAGAIN | This index cannot satisfy filter |
| -ENOENT | Past the last capability |
| int(* mpipe_pad::event_fn) (struct mpipe_pad *pad, struct mpipe_dispatch *event) |
Handle an event.
| pad | Pad the event arrives on |
| event | Event to act on and forward |
| atomic_t mpipe_pad::flushing |
Flushing gate.
While set, buffers are dropped instead of processed
| enum mpipe_pad_mode mpipe_pad::mode |
Operating mode.
| struct mpipe_object mpipe_pad::object |
Base object.
| struct mpipe_pad* mpipe_pad::peer |
Pointer to the peer pad this pad is linked to.
| enum mpipe_pad_presence mpipe_pad::presence |
Pad presence.
| 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.
| pad | Sink pad the buffer arrives on | |
| in_buf | Buffer to process | |
| [out] | out_buf | Buffer produced, or NULL when the input was consumed |
| int(* mpipe_pad::query_fn) (struct mpipe_pad *pad, struct mpipe_dispatch *query) |
Answer a query.
| pad | Pad the query arrives on |
| query | Query to answer in place |