Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Pipeline-level threading element. More...

Files

file  mpipe_queue.h
 Queue element for pipeline-level threading.

Data Structures

struct  mpipe_queue
 Queue Element Structure. More...

Enumerations

enum  { MPIPE_PROP_BASE_QUEUE_SIZE = MPIPE_PROP_TRANSFORM_LAST , MPIPE_PROP_BASE_QUEUE_THREAD_PRIORITY , MPIPE_PROP_BASE_QUEUE_LEAK }
 Queue Property Identifiers. More...
enum  mpipe_base_queue_leak { MPIPE_BASE_QUEUE_LEAK_NONE = 0 , MPIPE_BASE_QUEUE_LEAK_OLDEST , MPIPE_BASE_QUEUE_LEAK_NEWEST }
 What a full queue does with a new buffer. More...

Functions

int mpipe_queue_init (struct mpipe_queue *queue, uint8_t id)
 Initialize a queue element.

Detailed Description

Pipeline-level threading element.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

#include <mpipe_queue.h>

Queue Property Identifiers.

Enumerator
MPIPE_PROP_BASE_QUEUE_SIZE 

Number of buffers the queue can hold.

MPIPE_PROP_BASE_QUEUE_THREAD_PRIORITY 

Scheduling priority of the queue's thread.

MPIPE_PROP_BASE_QUEUE_LEAK 

What a full queue does with a new buffer, an mpipe_base_queue_leak.

◆ mpipe_base_queue_leak

#include <mpipe_queue.h>

What a full queue does with a new buffer.

A queue is first a thread boundary that loses nothing, so by default a full queue holds the producer until the consumer frees a slot. A live source feeding a slower branch would rather drop: a leak policy bounds the latency instead of the producer. End of stream is never dropped.

Enumerator
MPIPE_BASE_QUEUE_LEAK_NONE 

Block the producer until a slot is free.

MPIPE_BASE_QUEUE_LEAK_OLDEST 

Drop the oldest queued buffer: the consumer always gets the freshest.

MPIPE_BASE_QUEUE_LEAK_NEWEST 

Drop the arriving buffer: the queued ones are delivered in order.

Function Documentation

◆ mpipe_queue_init()

int mpipe_queue_init ( struct mpipe_queue * queue,
uint8_t id )

#include <mpipe_queue.h>

Initialize a queue element.

Parameters
queuePointer to the element to initialize.
idUnique element identifier.
Returns
0 on success, negative errno otherwise.