13#ifndef ZEPHYR_INCLUDE_MPIPE_MPIPE_ELEMENT_H_
14#define ZEPHYR_INCLUDE_MPIPE_MPIPE_ELEMENT_H_
71#if defined(CONFIG_MPIPE_ELEMENT_NAME)
72#define MPIPE_ELEMENT_SET_NAME(e, n) ((e)->name = (n))
74#define MPIPE_ELEMENT_SET_NAME(e, n) ((void)0)
89#define MPIPE_STATE_GET_NEXT(cur, target) \
90 ((enum mpipe_state)((int)cur + SYS_SIGN((int)target - (int)cur)))
100#define MPIPE_STATE_TRANSITION(cur, next) (((cur) << 2) | (next))
112#define MPIPE_STATE_TRANSITION_CURRENT(trans) ((enum mpipe_state)((trans) >> 2))
124#define MPIPE_STATE_TRANSITION_NEXT(trans) ((enum mpipe_state)((trans) & 0x3))
171#if defined(CONFIG_MPIPE_ELEMENT_NAME) || defined(__DOXYGEN__)
231 MPIPE_ELEMENT_SET_NAME(self,
name);
Header file for the doubly-linked list API.
struct _dnode sys_dlist_t
Doubly-linked list structure.
Definition dlist.h:55
mpipe_state_change
Transition between two adjacent states.
Definition mpipe_element.h:143
void mpipe_element_reset_pad_caps(struct mpipe_element *element)
Reset every pad of an element to constraining nothing.
int mpipe_element_link(struct mpipe_element *element_1, struct mpipe_element *element_2,...)
Link elements together.
mpipe_state
States of an element.
Definition mpipe_element.h:131
static void mpipe_element_set_name(struct mpipe_element *self, const char *name)
Name an element for the pipeline dump.
Definition mpipe_element.h:226
int mpipe_element_init(struct mpipe_element *self, uint8_t id)
Initialize an element.
void mpipe_element_add_pad(struct mpipe_element *element, struct mpipe_pad *pad)
Attach a pad to an element.
#define MPIPE_STATE_TRANSITION(cur, next)
Create state transition value.
Definition mpipe_element.h:100
struct zbus_channel * mpipe_element_get_bus_chan(struct mpipe_element *element)
Get the bus channel of an element.
int mpipe_element_set_state(struct mpipe_element *element, enum mpipe_state state)
Set the state of an element.
@ MPIPE_STATE_CHANGE_PAUSED_TO_READY
State change from PAUSED to READY.
Definition mpipe_element.h:154
@ MPIPE_STATE_CHANGE_PLAYING_TO_PAUSED
State change from PLAYING to PAUSED.
Definition mpipe_element.h:151
@ MPIPE_STATE_CHANGE_READY_TO_PAUSED
State change from READY to PAUSED.
Definition mpipe_element.h:145
@ MPIPE_STATE_CHANGE_PAUSED_TO_PLAYING
State change from PAUSED to PLAYING.
Definition mpipe_element.h:148
@ MPIPE_STATE_PLAYING
The element is PLAYING, data is flowing through the element.
Definition mpipe_element.h:137
@ MPIPE_STATE_PAUSED
The element is PAUSED and ready to receive, process or transfer data.
Definition mpipe_element.h:135
@ MPIPE_STATE_READY
The element is initialized READY to go to PAUSED.
Definition mpipe_element.h:133
Object: the base that every mpipe type embeds.
state
Definition parser_state.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
A query or an event traveling a pad link.
Definition mpipe_dispatch.h:75
Element base class.
Definition mpipe_element.h:167
int(* set_state)(struct mpipe_element *element, enum mpipe_state state)
Set state function, 0 on success, negative errno otherwise.
Definition mpipe_element.h:190
struct mpipe_object object
Base object.
Definition mpipe_element.h:169
const char * name
Name of the element, set to its type by the element's init function and overridable per instance with...
Definition mpipe_element.h:178
sys_dlist_t sink_pads
List of sink pads.
Definition mpipe_element.h:184
enum mpipe_state current_state
Current state of the element.
Definition mpipe_element.h:187
int(* change_state)(struct mpipe_element *element, enum mpipe_state_change transition)
Change state function, 0 on success, negative errno otherwise.
Definition mpipe_element.h:192
sys_dlist_t src_pads
List of source pads.
Definition mpipe_element.h:182
Base object structure.
Definition mpipe_object.h:65
Pad structure.
Definition mpipe_pad.h:128
Type used to represent a channel.
Definition zbus.h:99