Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mpipe_pad.h
Go to the documentation of this file.
1/*
2 * Copyright 2025-2026 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_MPIPE_MPIPE_PAD_H_
14#define ZEPHYR_INCLUDE_MPIPE_MPIPE_PAD_H_
15
69
70#include <stdbool.h>
71#include <stdint.h>
72
73#include <zephyr/sys/atomic.h>
74#include <zephyr/sys/util.h>
75
76#include <zephyr/kernel.h>
77
81
82struct mpipe_dispatch;
83
95
109
121
128struct mpipe_pad {
143
148 int (*chain_fn)(struct mpipe_pad *pad, struct net_buf *in_buf, struct net_buf **out_buf);
150 int (*query_fn)(struct mpipe_pad *pad, struct mpipe_dispatch *query);
152 int (*event_fn)(struct mpipe_pad *pad, struct mpipe_dispatch *event);
165 int (*enum_caps_fn)(struct mpipe_pad *pad, uint32_t index,
166 const struct mpipe_structure *filter, struct mpipe_structure *out);
167};
168
181int mpipe_pad_enum_caps(struct mpipe_pad *pad, uint32_t index, const struct mpipe_structure *filter,
182 struct mpipe_structure *out);
183
194int mpipe_pad_enum_first(struct mpipe_pad *pad, const struct mpipe_structure *filter,
195 struct mpipe_structure *out);
196
211
226int mpipe_pad_enum_filter(const struct mpipe_structure *candidate,
227 const struct mpipe_structure *filter, struct mpipe_structure *out);
228
239void mpipe_pad_init(struct mpipe_pad *pad, uint8_t id, enum mpipe_pad_direction direction,
240 enum mpipe_pad_presence presence);
241
253int mpipe_pad_set_caps(struct mpipe_pad *pad, const struct mpipe_structure *caps);
254
266int mpipe_pad_link(struct mpipe_pad *src_pad, struct mpipe_pad *sink_pad);
267
278int mpipe_pad_send_event(struct mpipe_pad *pad, struct mpipe_dispatch *event);
279
300
320int mpipe_pad_query(struct mpipe_pad *pad, struct mpipe_dispatch *query);
321
323
324#endif /* ZEPHYR_INCLUDE_MPIPE_MPIPE_PAD_H_ */
long atomic_t
Atomic integer variable.
Definition atomic_types.h:31
int mpipe_pad_set_caps(struct mpipe_pad *pad, const struct mpipe_structure *caps)
Set the pad's capability.
int mpipe_pad_send_event_default(struct mpipe_pad *pad, struct mpipe_dispatch *event)
Default event handler for pads.
int mpipe_pad_answer_caps_query(struct mpipe_pad *pad, struct mpipe_dispatch *query)
Answer a caps query with the first capability its filter accepts.
int mpipe_pad_query(struct mpipe_pad *pad, struct mpipe_dispatch *query)
Send a query to a pad.
int mpipe_pad_enum_filter(const struct mpipe_structure *candidate, const struct mpipe_structure *filter, struct mpipe_structure *out)
Narrow one enumerated capability by an enumeration filter.
int mpipe_pad_link(struct mpipe_pad *src_pad, struct mpipe_pad *sink_pad)
Link two pads together.
mpipe_pad_mode
The operating mode of a Pad.
Definition mpipe_pad.h:101
int mpipe_pad_enum_caps(struct mpipe_pad *pad, uint32_t index, const struct mpipe_structure *filter, struct mpipe_structure *out)
Produce one of the pad's supported caps.
int mpipe_pad_enum_first(struct mpipe_pad *pad, const struct mpipe_structure *filter, struct mpipe_structure *out)
Produce the pad's first supported capability that a filter accepts.
void mpipe_pad_init(struct mpipe_pad *pad, uint8_t id, enum mpipe_pad_direction direction, enum mpipe_pad_presence presence)
Initialize a pad.
int mpipe_pad_send_event(struct mpipe_pad *pad, struct mpipe_dispatch *event)
Send an event to a pad.
mpipe_pad_direction
The direction of a pad.
Definition mpipe_pad.h:87
mpipe_pad_presence
The presence of a pad.
Definition mpipe_pad.h:113
@ MPIPE_PAD_MODE_PUSH
Pad handles dataflow in push mode.
Definition mpipe_pad.h:105
@ MPIPE_PAD_MODE_PULL
Pad handles dataflow in pull mode.
Definition mpipe_pad.h:107
@ MPIPE_PAD_MODE_NONE
Pad will not handle dataflow.
Definition mpipe_pad.h:103
@ MPIPE_PAD_SRC
The pad is a source pad.
Definition mpipe_pad.h:91
@ MPIPE_PAD_SINK
The pad is a sink pad.
Definition mpipe_pad.h:93
@ MPIPE_PAD_UNKNOWN
Direction is unknown.
Definition mpipe_pad.h:89
@ MPIPE_PAD_ALWAYS
The pad is always present.
Definition mpipe_pad.h:115
@ MPIPE_PAD_SOMETIMES
The pad will be present depending on the media stream.
Definition mpipe_pad.h:117
@ MPIPE_PAD_REQUEST
The pad is only available on request.
Definition mpipe_pad.h:119
Public kernel APIs.
Buffer and buffer pool APIs.
Object: the base that every mpipe type embeds.
Structure: one media capability, held by value.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
A query or an event traveling a pad link.
Definition mpipe_dispatch.h:77
Base object structure.
Definition mpipe_object.h:65
Pad structure.
Definition mpipe_pad.h:128
struct mpipe_pad * peer
Pointer to the peer pad this pad is linked to.
Definition mpipe_pad.h:138
int(* enum_caps_fn)(struct mpipe_pad *pad, uint32_t index, const struct mpipe_structure *filter, struct mpipe_structure *out)
Enumerate the pad's supported caps one structure at a time into caller storage.
Definition mpipe_pad.h:165
int(* query_fn)(struct mpipe_pad *pad, struct mpipe_dispatch *query)
Query function for handling queries.
Definition mpipe_pad.h:150
enum mpipe_pad_presence presence
Pad presence.
Definition mpipe_pad.h:134
enum mpipe_pad_direction direction
Pad direction, cannot change after creating the pad.
Definition mpipe_pad.h:132
int(* event_fn)(struct mpipe_pad *pad, struct mpipe_dispatch *event)
Event function for handling events.
Definition mpipe_pad.h:152
struct mpipe_structure caps
Pad's capability.
Definition mpipe_pad.h:140
atomic_t flushing
Flushing gate.
Definition mpipe_pad.h:142
int(* chain_fn)(struct mpipe_pad *pad, struct net_buf *in_buf, struct net_buf **out_buf)
Chain function for handling buffers.
Definition mpipe_pad.h:148
enum mpipe_pad_mode mode
Operating mode.
Definition mpipe_pad.h:136
struct mpipe_object object
Base object.
Definition mpipe_pad.h:130
Fixed-size container holding the fields of one capability.
Definition mpipe_structure.h:179
Network buffer representation.
Definition net_buf.h:1054
Header file for the Atomic operations API.
Misc utilities.