Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mpipe_transform Struct Reference

Transform element structure. More...

#include <mpipe_transform.h>

Data Fields

struct mpipe_element element
 Base element structure.
struct mpipe_pad sink_pad
 Sink pad for receiving input data.
struct mpipe_pad src_pad
 Source pad for sending output data.
struct mpipe_buffer_pool * in_pool
 Pointer to the input buffer pool for allocating input buffers.
struct mpipe_buffer_pool * out_pool
 Pointer to the output buffer pool for allocating output buffers.
enum mpipe_transform_mode mode
 Operating mode determining buffer handling strategy.
int(* set_caps )(struct mpipe_transform *transform, enum mpipe_pad_direction direction, const struct mpipe_structure *caps)
 Set a given caps to an element's pad.
int(* transform_caps )(struct mpipe_transform *self, enum mpipe_pad_direction direction, const struct mpipe_structure *in, uint32_t index, struct mpipe_structure *out)
 Produce one transformation of a capability across the element.
int(* propose_buffer_pool )(struct mpipe_transform *self, struct mpipe_dispatch *query)
 Propose a buffer pool to upstream.
int(* decide_buffer_pool )(struct mpipe_transform *self, struct mpipe_dispatch *query)
 Decide the buffer pool for downstream.

Detailed Description

Transform element structure.

Base structure for all transform elements in the media pipeline. Transform elements process data from their sink pad and output the result to their source pad.

Field Documentation

◆ decide_buffer_pool

int(* mpipe_transform::decide_buffer_pool) (struct mpipe_transform *self, struct mpipe_dispatch *query)

Decide the buffer pool for downstream.

The downstream proposal is either an entire pool (the query's pool pointer; its config is the proposal) or a bare config (the query's pool_cfg). Apply a demand to a proposed pool only through mpipe_buffer_pool_set_config, which the pool may refuse - keep a fallback. An element deciding for its own pool rebuilds its config baseline here on every negotiation before absorbing the query's demands, so nothing accumulates across replays.

Parameters
selfPointer to the transform element
queryAllocation query (Dispatches)
Returns
0 on success, negative errno on failure

◆ element

struct mpipe_element mpipe_transform::element

Base element structure.

◆ in_pool

struct mpipe_buffer_pool* mpipe_transform::in_pool

Pointer to the input buffer pool for allocating input buffers.

◆ mode

enum mpipe_transform_mode mpipe_transform::mode

Operating mode determining buffer handling strategy.

◆ out_pool

struct mpipe_buffer_pool* mpipe_transform::out_pool

Pointer to the output buffer pool for allocating output buffers.

◆ propose_buffer_pool

int(* mpipe_transform::propose_buffer_pool) (struct mpipe_transform *self, struct mpipe_dispatch *query)

Propose a buffer pool to upstream.

The transform element may propose either its entire input buffer pool (set the query's pool pointer; the pool's own config is the proposal) or a bare config (write the query's pool_cfg). A proposed pool's ops are then intended to be called by the upstream element. Before proposing a pool, rebuild its config baseline from your source of truth: the live config is the previous negotiation's applied result, and proposing it as-is makes peer demands accumulate across replays.

For in-place transform, the same pool may be used for both input and output. If the pool is proposed to upstream, the element has to use mpipe_transform::in_pool to point to the pool and leave mpipe_transform::out_pool as NULL so that the pool is configured / started only by the upstream and not by the transform element itself.

Parameters
selfPointer to the transform element
queryAllocation query (Dispatches)
Returns
0 on success, negative errno on failure

◆ set_caps

int(* mpipe_transform::set_caps) (struct mpipe_transform *transform, enum mpipe_pad_direction direction, const struct mpipe_structure *caps)

Set a given caps to an element's pad.

Parameters
transformPointer to the transform element
directionDirection of the pad (mpipe_pad_direction)
capsCapability to set (Capability Structure)
Returns
0 on success, negative errno on failure

◆ sink_pad

struct mpipe_pad mpipe_transform::sink_pad

Sink pad for receiving input data.

◆ src_pad

struct mpipe_pad mpipe_transform::src_pad

Source pad for sending output data.

◆ transform_caps

int(* mpipe_transform::transform_caps) (struct mpipe_transform *self, enum mpipe_pad_direction direction, const struct mpipe_structure *in, uint32_t index, struct mpipe_structure *out)

Produce one transformation of a capability across the element.

An element commonly maps a single input capability to several output ones: a decoder that can emit any of N pixel formats, a converter with N reachable formats. Those alternatives live on index rather than in a returned set, so a negotiation walks them one at a time and the fan out is never materialized.

Parameters
selfPointer to the transform element
directionDirection of the pad to transform the capability to (mpipe_pad_direction)
inCapability on the opposite pad to transform
indexIndex of the transformation to produce, starting at 0
[out]outCaller storage receiving the transformation
Returns
0 when out holds a transformation, another negative errno on failure
Return values
-EAGAINThis index produces none but a later one may
-ENOENTPast the last transformation

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