upipe/ufifo.h header reference

Upipe thread-safe first-in first-out data structure More

Header inclusion  

Members  

Type  

Functions  

  • 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  

Description  

Upipe thread-safe first-in first-out data structure

Members detail  

#define _UPIPE_UFIFO_H_  

This macro is declared in upipe/ufifo.h source file, line 31.

struct ufifo  

This struct is declared in upipe/ufifo.h source file, line 41.

This struct is the implementation of first-in first-out data structure.

FieldDescription
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

void ufifo_clean(struct ufifo *ufifo)  

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

void ufifo_init(struct ufifo *ufifo, uint8_t length, void *extra)  

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)  

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

bool ufifo_push(struct ufifo *ufifo, void *opaque)  

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)  

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

void * ufifo_pop_internal(struct ufifo *ufifo)  

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

Valid XHTML 1.0 StrictGenerated by cmassiot on Fri Feb 2 23:57:19 2018 using MkDoc