upipe/upipe_helper_output.h header reference
Upipe helper functions for output More
Header inclusion [link]
Members [link]
Type [link]
Macro [link]
Description [link]
It allows to deal with flow definitions, output requests, and output pipes.
Members detail [link]
#define UPIPE_HELPER_OUTPUT(STRUCTURE, OUTPUT, FLOW_DEF, OUTPUT_STATE, REQUEST_LIST) [link]
This macro is declared in upipe/upipe_helper_output.h source file, line 184.
This macro declares functions dealing with the output of a pipe, and an associated uref which is the flow definition on the output.
You must add four members to your private upipe structure, for instance:
struct upipe *output;
struct uref *flow_def;
enum upipe_helper_output_state output_state;
struct uchain request_list;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.
Called whenever you need to send a packet to your output. It takes care of sending the flow definition if necessary.
Registers a request on the output. The request will be replayed if the output changes. If there is no output, the request is sent via a probe.
Unregisters a request on the output.
Internal function used to receive answers to proxy requests.
Allocates a proxy request to forward a request downstream.
Frees a proxy request.
Called whenever you change the flow definition on this output.
Typically called from your upipe_foo_control() handler, such as:
case UPIPE_GET_FLOW_DEF: {
struct uref **p = va_arg(args, struct uref **);
return upipe_foo_get_flow_def(upipe, p);
}Typically called from your upipe_foo_control() handler, such as:
case UPIPE_GET_OUTPUT: {
struct upipe **p = va_arg(args, struct upipe **);
return upipe_foo_get_output(upipe, p);
}Typically called from your upipe_foo_control() handler, such as:
case UPIPE_SET_OUTPUT: {
struct upipe *output = va_arg(args, struct upipe *);
return upipe_foo_set_output(upipe, output);
}This function handles the output helper control commands (upipe_foo_get_flow_def, upipe_foo_get_output, upipe_foo_set_output, ...). Typically called from your upipe_foo_control() handler, such as:
int upipe_foo_control(struct upipe *upipe, int command, va_list args)
{
...
UBASE_HANDLED_RETURN(upipe_foo_control_output(upipe, command, args));
...
}Typically called from your upipe_foo_free() function.
Parameter list:
- STRUCTURE: name of your private upipe structure
- OUTPUT: name of the struct upipe * field of your private upipe structure
- FLOW_DEF: name of the struct uref * field of your private upipe structure
- OUTPUT_STATE: name of the enum upipe_helper_output_state field of your private upipe structure
- REQUEST_LIST: name of the struct uchain field of your private upipe structure
#define _UPIPE_UPIPE_HELPER_OUTPUT_H_ [link]
This macro is declared in upipe/upipe_helper_output.h source file, line 32.
enum upipe_helper_output_state [link]
This enum is declared in upipe/upipe_helper_output.h source file, line 49.
This enum represents the state of the output.
| Identifier | Value | Description |
|---|---|---|
| UPIPE_HELPER_OUTPUT_NONE | 0 | no output defined, or no flow def sent |
| UPIPE_HELPER_OUTPUT_VALID | 1 | output defined and flow def accepted |
| UPIPE_HELPER_OUTPUT_INVALID | 2 | output defined but flow def rejected |