upipe/upipe_helper_sink.h header reference
Upipe helper functions for sinks More
Header inclusion
Members
Macro
Description
It allows to block a source pump, and to bufferize incoming urefs.
Members detail
This macro is declared in upipe/upipe_helper_sink.h source file, line 145.
This macro declares eight functions helping a sink 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_sink_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.
Outputs urefs that have been held.
Typically called from your upipe_foo_control() handler, such as:
case UPIPE_SINK_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_SINK_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 sink. Returns true if the sink was previsouly blocked.
Parameters 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
This macro is declared in upipe/upipe_helper_sink.h source file, line 32.