|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Queue Element Structure. More...
#include <mpipe_queue.h>
Data Fields | |
| struct mpipe_transform | transform |
| Base transform element. | |
| struct mpipe_thread | thread |
| Dedicated thread for downstream processing. | |
| struct k_msgq | msgq |
| Queue for storing incoming buffer pointers. | |
| char | msgq_buffer [(CONFIG_MPIPE_BASE_QUEUE_MAX_SIZE+2) *sizeof(void *)] |
| Backing storage for the message queue, sized for the largest queue plus the EOS and pause sentinels. | |
| uint8_t | size |
| Number of buffers the queue can hold, bounded by CONFIG_MPIPE_BASE_QUEUE_MAX_SIZE and applied on READY -> PAUSED. | |
| uint8_t | leak |
| Leak policy of a full queue, an mpipe_base_queue_leak. | |
| atomic_t | flushing |
| Flushing flag. | |
Queue Element Structure.
The queue element acts as a thread boundary in a pipeline. Its chain_fn enqueues buffers into an internal buffer queue. A dedicated thread then dequeues buffers and drives downstream elements.
| atomic_t mpipe_queue::flushing |
Flushing flag.
When set (on PAUSED -> READY), the chain_fn drops incoming buffers instead of enqueuing them. This releases any upstream producer blocked in k_msgq_put() during teardown and prevents a late buffer from leaking into an already-drained queue (e.g. behind a tee).
| uint8_t mpipe_queue::leak |
Leak policy of a full queue, an mpipe_base_queue_leak.
| struct k_msgq mpipe_queue::msgq |
Queue for storing incoming buffer pointers.
A k_fifo would not do here as it keeps no storage of its own: it chains its items through a link field inside each item, so a given buffer can be on one fifo at a time. A tee pushes the same buffer to every branch, and a branch may start with a queue, so one buffer must be able to wait in several queues at once. The k_msgq stores its own copy of the pointer which makes that possible.
| char mpipe_queue::msgq_buffer[(CONFIG_MPIPE_BASE_QUEUE_MAX_SIZE+2) *sizeof(void *)] |
Backing storage for the message queue, sized for the largest queue plus the EOS and pause sentinels.
| uint8_t mpipe_queue::size |
Number of buffers the queue can hold, bounded by CONFIG_MPIPE_BASE_QUEUE_MAX_SIZE and applied on READY -> PAUSED.
| struct mpipe_thread mpipe_queue::thread |
Dedicated thread for downstream processing.
| struct mpipe_transform mpipe_queue::transform |
Base transform element.