upipe/upipe_helper_output.h header reference

Upipe helper functions for output More

Header inclusion  

Members  

Type  

Macro  

Description  

It allows to deal with flow definitions, output requests, and output pipes.

Members detail  

#define UPIPE_HELPER_OUTPUT(STRUCTURE, OUTPUT, FLOW_DEF, OUTPUT_STATE, REQUEST_LIST)  

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:

  • void upipe_foo_init_output(struct upipe *upipe)

    Typically called in your upipe_foo_alloc() function.

  • void upipe_foo_output(struct upipe *upipe, struct uref *uref,
    struct upump **upump_p)

    Called whenever you need to send a packet to your output. It takes care of sending the flow definition if necessary.

  • int upipe_foo_register_output_request(struct upipe *upipe,
    struct urequest *urequest)

    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.

  • int upipe_foo_unregister_output_request(struct upipe *upipe,
    struct urequest *urequest)

    Unregisters a request on the output.

  • int upipe_foo_provide_output_proxy(struct urequest *urequest, va_list args)

    Internal function used to receive answers to proxy requests.

  • int upipe_foo_alloc_output_proxy(struct upipe *upipe,
    struct urequest *urequest)

    Allocates a proxy request to forward a request downstream.

  • int upipe_foo_free_output_proxy(struct upipe *upipe,
    struct urequest *urequest)

    Frees a proxy request.

  • void upipe_foo_store_flow_def(struct upipe *upipe, struct uref *flow_def)

    Called whenever you change the flow definition on this output.

  • int upipe_foo_get_flow_def(struct upipe *upipe, struct uref **p)

    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);
    }
  • int upipe_foo_get_output(struct upipe *upipe, struct 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);
    }
  • int upipe_foo_set_output(struct upipe *upipe, struct upipe *output)

    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);
    }
  • int upipe_foo_control_output(struct upipe *upipe,
    int command, va_list args)

    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));
    ...
    }
  • void upipe_foo_clean_output(struct upipe *upipe)

    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_  

This macro is declared in upipe/upipe_helper_output.h source file, line 32.

enum upipe_helper_output_state  

This enum is declared in upipe/upipe_helper_output.h source file, line 49.

This enum represents the state of the output.

IdentifierValueDescription
UPIPE_HELPER_OUTPUT_NONE0no output defined, or no flow def sent
UPIPE_HELPER_OUTPUT_VALID1output defined and flow def accepted
UPIPE_HELPER_OUTPUT_INVALID2output defined but flow def rejected

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