Zephyr Project API 4.4.99
A Scalable Open Source RTOS
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
36
37#include <zephyr/kernel.h>
38
39#include <zephyr/zbus/zbus.h>
40
43
45/*
46 * One entry of the player command queue. run_id names the run the command was
47 * posted from, so the worker can tell an end-of-run raised for the run in
48 * progress from one describing a run that has already been torn down.
49 */
50struct mpipe_player_cmd_msg {
52 uint8_t run_id;
53};
55
64 struct mpipe *pipeline;
66 struct k_msgq cmd_q;
68 char cmd_buf[CONFIG_MPIPE_PLAYER_CMD_QUEUE_DEPTH * sizeof(struct mpipe_player_cmd_msg)];
76 struct k_sem exited;
77};
78
94int mpipe_player_init(struct mpipe_player *player, struct mpipe *pipeline);
95
105int mpipe_player_play(struct mpipe_player *player);
106
116
127
136int mpipe_player_stop(struct mpipe_player *player);
137
147
157int mpipe_player_quit(struct mpipe_player *player);
158
174
185
187
188#endif /* ZEPHYR_INCLUDE_MPIPE_UTILS_MPIPE_PLAYER_H_ */
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
int mpipe_player_init(struct mpipe_player *player, struct mpipe *pipeline)
Initialize a player and start its worker thread.
int mpipe_player_replay(struct mpipe_player *player)
Restart playback from the beginning.
int mpipe_player_deinit(struct mpipe_player *player)
Wait for the worker to exit and release the player's resources.
int mpipe_player_wait_quit(struct mpipe_player *player)
Block until the player worker exits.
int mpipe_player_play(struct mpipe_player *player)
Request PLAYING.
int mpipe_player_stop(struct mpipe_player *player)
Request READY.
int mpipe_player_pause(struct mpipe_player *player)
Request PAUSED.
int mpipe_player_toggle(struct mpipe_player *player)
Toggle between PLAYING and PAUSED.
int mpipe_player_quit(struct mpipe_player *player)
Ask the worker to stop the pipeline and exit.
Public kernel APIs.
Bus message: what an element reports to the application.
Pipeline: the top-level bin that runs a graph.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Message Queue Structure.
Definition kernel.h:5259
Semaphore structure.
Definition kernel.h:3738
Thread Structure.
Definition thread.h:258
Message structure carrying type and origin of the message.
Definition mpipe_message.h:109
Player instance.
Definition mpipe_player.h:62
uint8_t run_id
Run counter, bumped by the worker each time a run starts.
Definition mpipe_player.h:70
struct mpipe * pipeline
Controlled pipeline.
Definition mpipe_player.h:64
struct k_thread worker
Worker thread control block.
Definition mpipe_player.h:74
struct k_msgq cmd_q
Command queue feeding the worker thread.
Definition mpipe_player.h:66
struct k_sem exited
Signaled by the worker just before it exits.
Definition mpipe_player.h:76
char cmd_buf[CONFIG_MPIPE_PLAYER_CMD_QUEUE_DEPTH *sizeof(struct mpipe_player_cmd_msg)]
Backing buffer for the command queue.
Definition mpipe_player.h:68
struct mpipe_message last_error
Last error the bus listener saw, reported by the worker.
Definition mpipe_player.h:72
A pipeline: the top-level bin that runs a graph.
Definition mpipe_pipeline.h:75