upipe/ufifo.h header reference
Upipe thread-safe first-in first-out data structure More
Header inclusion [link]
Members [link]
Type [link]
- struct ufifo
Functions [link]
- void ufifo_clean(struct ufifo *ufifo)
- void ufifo_init(struct ufifo *ufifo, uint8_t length, void *extra)
- bool ufifo_push(struct ufifo *ufifo, void *opaque)
Macros [link]
Description [link]
Upipe thread-safe first-in first-out data structure
Members detail [link]
#define _UPIPE_UFIFO_H_ [link]
This macro is declared in upipe/ufifo.h source file, line 31.
struct ufifo [link]
This struct is declared in upipe/ufifo.h source file, line 41.
This struct is the implementation of first-in first-out data structure.
| Field | Description |
|---|---|
| struct uring uring; | ring structure |
| uring_fifo fifo_carrier; | uring FIFO of elements carrying a uchain |
| uring_lifo lifo_empty; | uring LIFO of elements not carrying a uchain |
This function is declared in upipe/ufifo.h source file, line 120.
This function cleans up the ufifo data structure. Please note that it is the caller's responsibility to empty the FIFO first.
Parameter list:
- ufifo: pointer to a ufifo structure
This function is declared in upipe/ufifo.h source file, line 65.
This function initializes a ufifo.
Parameter list:
- ufifo: pointer to a ufifo structure
- length: maximum number of elements in the FIFO (max 255)
- extra: mandatory extra space allocated by the caller, with the size returned by ufifo_sizeof
#define ufifo_pop(ufifo, type) [link]
This macro is declared in upipe/ufifo.h source file, line 111.
This macro pops an element with type checking.
Parameter list:
- ufifo: pointer to a ufifo structure
- type: type of the opaque pointer
The return value is pointer to opaque, or NULL if the FIFO is empty
This function is declared in upipe/ufifo.h source file, line 79.
This function pushes a new element.
Parameter list:
- ufifo: pointer to a ufifo structure
- opaque: opaque to associate with element (not NULL)
The return value is false if the maximum number of elements was reached and the element couldn't be queued
#define ufifo_sizeof(length) [link]
This macro is declared in upipe/ufifo.h source file, line 54.
This macro returns the required size of extra data space for ufifo.
Parameter list:
- length: maximum number of elements in the FIFO
The return value is size in octets to allocate
This function is for internal use only.
This function is declared in upipe/ufifo.h source file, line 95.
This function pops an element.
Parameter list:
- ufifo: pointer to a ufifo structure
The return value is pointer to opaque, or NULL if the FIFO is empty