Zephyr API
4.5.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
mpipe_player.h
Go to the documentation of this file.
1
/*
2
* Copyright 2026 NXP
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
12
13
#ifndef ZEPHYR_INCLUDE_MPIPE_UTILS_MPIPE_PLAYER_H_
14
#define ZEPHYR_INCLUDE_MPIPE_UTILS_MPIPE_PLAYER_H_
15
40
41
#include <
zephyr/kernel.h
>
42
43
#include <
zephyr/zbus/zbus.h
>
44
45
#include <
zephyr/mpipe/mpipe_message.h
>
46
#include <
zephyr/mpipe/mpipe_pipeline.h
>
47
49
/*
50
* One entry of the player command queue. run_id names the run the command was
51
* posted from, so the worker can tell an end-of-run raised for the run in
52
* progress from one describing a run that has already been torn down.
53
*/
54
struct
mpipe_player_cmd_msg {
55
uint8_t
cmd
;
56
uint8_t
run_id;
57
};
59
66
struct
mpipe_player
{
69
struct
mpipe
*pipeline;
71
struct
k_msgq
cmd_q;
73
char
cmd_buf[CONFIG_MPIPE_PLAYER_CMD_QUEUE_DEPTH *
sizeof
(
struct
mpipe_player_cmd_msg)];
75
uint8_t
run_id;
77
struct
mpipe_message
last_error;
79
struct
k_thread
worker;
81
uint8_t
slot;
83
struct
k_sem
exited;
85
};
86
104
int
mpipe_player_init
(
struct
mpipe_player
*player,
struct
mpipe
*pipeline);
105
115
int
mpipe_player_play
(
struct
mpipe_player
*player);
116
125
int
mpipe_player_pause
(
struct
mpipe_player
*player);
126
136
int
mpipe_player_toggle
(
struct
mpipe_player
*player);
137
146
int
mpipe_player_stop
(
struct
mpipe_player
*player);
147
156
int
mpipe_player_replay
(
struct
mpipe_player
*player);
157
167
int
mpipe_player_quit
(
struct
mpipe_player
*player);
168
183
int
mpipe_player_wait_quit
(
struct
mpipe_player
*player);
184
194
int
mpipe_player_deinit
(
struct
mpipe_player
*player);
195
197
198
#endif
/* ZEPHYR_INCLUDE_MPIPE_UTILS_MPIPE_PLAYER_H_ */
cmd
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition
ft8xx_reference_api.h:153
mpipe_player_init
int mpipe_player_init(struct mpipe_player *player, struct mpipe *pipeline)
Initialize a player and start its worker thread.
mpipe_player_replay
int mpipe_player_replay(struct mpipe_player *player)
Restart playback from the beginning.
mpipe_player_deinit
int mpipe_player_deinit(struct mpipe_player *player)
Wait for the worker to exit and release the player's resources.
mpipe_player_wait_quit
int mpipe_player_wait_quit(struct mpipe_player *player)
Block until the player worker exits.
mpipe_player_play
int mpipe_player_play(struct mpipe_player *player)
Request PLAYING.
mpipe_player_stop
int mpipe_player_stop(struct mpipe_player *player)
Request READY.
mpipe_player_pause
int mpipe_player_pause(struct mpipe_player *player)
Request PAUSED.
mpipe_player_toggle
int mpipe_player_toggle(struct mpipe_player *player)
Toggle between PLAYING and PAUSED.
mpipe_player_quit
int mpipe_player_quit(struct mpipe_player *player)
Ask the worker to stop the pipeline and exit.
kernel.h
Public kernel APIs.
mpipe_message.h
Bus message: what an element reports to the application.
mpipe_pipeline.h
Pipeline: the top-level bin that runs a graph.
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
k_msgq
Message Queue Structure.
Definition
kernel.h:5271
k_sem
Semaphore structure.
Definition
kernel.h:3752
k_thread
Thread Structure.
Definition
thread.h:258
mpipe_message
Message structure carrying type and origin of the message.
Definition
mpipe_message.h:116
mpipe_player
Player instance.
Definition
mpipe_player.h:66
mpipe
A pipeline: the top-level bin that runs a graph.
Definition
mpipe_pipeline.h:66
zbus.h
zephyr
mpipe
utils
mpipe_player.h
Generated on
for Zephyr API by
1.17.0