13#ifndef ZEPHYR_INCLUDE_MPIPE_MPIPE_ELEMENT_H_
14#define ZEPHYR_INCLUDE_MPIPE_MPIPE_ELEMENT_H_
71#if defined(CONFIG_MPIPE_DUMP)
72#define MPIPE_ELEMENT_SET_NAME(e, n) ((e)->name = (n))
74#define MPIPE_ELEMENT_SET_NAME(e, n) ((void)0)
88#define MPIPE_STATE_GET_NEXT(cur, target) \
89 ((enum mpipe_state)((int)cur + SYS_SIGN((int)target - (int)cur)))
98#define MPIPE_STATE_TRANSITION(cur, next) (((cur) << 2) | (next))
109#define MPIPE_STATE_TRANSITION_CURRENT(trans) ((enum mpipe_state)((trans) >> 2))
120#define MPIPE_STATE_TRANSITION_NEXT(trans) ((enum mpipe_state)((trans) & 0x3))
169#if defined(CONFIG_MPIPE_DUMP) || defined(__DOXYGEN__)
229 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
enum mpipe_state_change
Definition mpipe_element.h:141
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:127
static void mpipe_element_set_name(struct mpipe_element *self, const char *name)
Name an element for the pipeline dump.
Definition mpipe_element.h:224
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:98
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:152
@ MPIPE_STATE_CHANGE_PLAYING_TO_PAUSED
State change from PLAYING to PAUSED.
Definition mpipe_element.h:149
@ MPIPE_STATE_CHANGE_READY_TO_PAUSED
State change from READY to PAUSED.
Definition mpipe_element.h:143
@ MPIPE_STATE_CHANGE_PAUSED_TO_PLAYING
State change from PAUSED to PLAYING.
Definition mpipe_element.h:146
@ MPIPE_STATE_PLAYING
The element is PLAYING, data is flowing through the element.
Definition mpipe_element.h:133
@ MPIPE_STATE_PAUSED
The element is PAUSED and ready to receive, process or transfer data.
Definition mpipe_element.h:131
@ MPIPE_STATE_READY
The element is initialized READY to go to PAUSED.
Definition mpipe_element.h:129
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:77
Element base class.
Definition mpipe_element.h:165
int(* set_state)(struct mpipe_element *element, enum mpipe_state state)
Set state function, 0 on success, negative errno otherwise.
Definition mpipe_element.h:188
struct mpipe_object object
Base object.
Definition mpipe_element.h:167
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:176
sys_dlist_t sink_pads
List of sink pads.
Definition mpipe_element.h:182
enum mpipe_state current_state
Current state of the element.
Definition mpipe_element.h:185
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:190
sys_dlist_t src_pads
List of source pads.
Definition mpipe_element.h:180
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