Zephyr API Documentation 4.5.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
40
41#include <zephyr/kernel.h>
42
43#include <zephyr/zbus/zbus.h>
44
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 */
54struct mpipe_player_cmd_msg {
56 uint8_t run_id;
57};
59
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
104int mpipe_player_init(struct mpipe_player *player, struct mpipe *pipeline);
105
115int mpipe_player_play(struct mpipe_player *player);
116
126
137
146int mpipe_player_stop(struct mpipe_player *player);
147
157
167int mpipe_player_quit(struct mpipe_player *player);
168
184
195
197
198#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:5271
Semaphore structure.
Definition kernel.h:3752
Thread Structure.
Definition thread.h:258
Message structure carrying type and origin of the message.
Definition mpipe_message.h:116
Player instance.
Definition mpipe_player.h:66
A pipeline: the top-level bin that runs a graph.
Definition mpipe_pipeline.h:66