upipe/upipe_helper_input.h header reference
Upipe helper functions for input More
Header inclusion [link]
Members [link]
Macro [link]
Description [link]
It allows to block a source pump, and to bufferize incoming urefs.
Members detail [link]
#define UPIPE_HELPER_INPUT(STRUCTURE, UREFS, NB_UREFS, MAX_UREFS, BLOCKERS, OUTPUT) [link]
This macro is declared in upipe/upipe_helper_input.h source file, line 150.
This macro declares nine functions helping a pipe to block source pumps, and to hold urefs that can't be immediately output.
You must add four members to your private upipe structure, for instance:
You must also declare UPIPE_HELPER_UPIPE prior to using this macro.
Supposing the name of your structure is upipe_foo, it declares:
Typically called in your upipe_foo_alloc() function.
void upipe_foo_block_input_cb(struct upump_blocker *blocker)Used internally as the callback of the blocker, called when the source pump is released.
Called when you need to block a source pump.
Called when you want to restart the source pump(s).
Returns true if no uref has been held.
Holds the given uref that can't be immediately output.
Returns the first buffered uref.
Pushes an uref back into the buffered urefs.
Outputs urefs that have been held.
Typically called from your upipe_foo_control() handler, such as:
case UPIPE_GET_MAX_LENGTH: {
unsigned int *p = va_arg(args, unsigned int *);
return upipe_foo_get_max_length(upipe, p);
}Typically called from your upipe_foo_control() handler, such as:
case UPIPE_SET_MAX_LENGTH: {
unsigned int max_length = va_arg(args, unsigned int);
return upipe_foo_set_max_length(upipe, max_length);
}Free all urefs that have been held, and unblocks all pumps.
Free all urefs that have been held, unblocks all pumps, and reinitializes the input. Returns true if the input was previously blocked.
Parameter list:
- STRUCTURE: name of your private upipe structure
- UREFS: name of the struct uchain field of your private upipe structure, corresponding to a list of urefs
- BLOCKERS: name of the struct uchain field of your private upipe structure, corresponding to a list of blockers
- OUTPUT: function to use to output urefs (struct upipe *, struct uref *, struct upump **), returns false when the uref can't be written
#define _UPIPE_UPIPE_HELPER_INPUT_H_ [link]
This macro is declared in upipe/upipe_helper_input.h source file, line 32.