Exemple #1
0
/** @internal @This processes control commands on a file source pipe, and
 * checks the status of the pipe afterwards.
 *
 * @param upipe description structure of the pipe
 * @param command type of command
 * @param args arguments of the command
 * @return an error code
 */
static int upipe_audiobar_control(struct upipe *upipe, int command, va_list args)
{
    switch (command) {
        case UPIPE_REGISTER_REQUEST: {
            struct urequest *request = va_arg(args, struct urequest *);
            if (request->type == UREQUEST_UBUF_MGR ||
                request->type == UREQUEST_FLOW_FORMAT)
                return upipe_throw_provide_request(upipe, request);
            return upipe_audiobar_alloc_output_proxy(upipe, request);
        }
        case UPIPE_UNREGISTER_REQUEST: {
            struct urequest *request = va_arg(args, struct urequest *);
            if (request->type == UREQUEST_UBUF_MGR ||
                request->type == UREQUEST_FLOW_FORMAT)
                return UBASE_ERR_NONE;
            return upipe_audiobar_free_output_proxy(upipe, request);
        }
        case UPIPE_GET_FLOW_DEF: {
            struct uref **p = va_arg(args, struct uref **);
            return upipe_audiobar_get_flow_def(upipe, p);
        }
        case UPIPE_SET_FLOW_DEF: {
            struct uref *flow = va_arg(args, struct uref *);
            return upipe_audiobar_set_flow_def(upipe, flow);
        }
        case UPIPE_GET_OUTPUT: {
            struct upipe **p = va_arg(args, struct upipe **);
            return upipe_audiobar_get_output(upipe, p);
        }
        case UPIPE_SET_OUTPUT: {
            struct upipe *output = va_arg(args, struct upipe *);
            return upipe_audiobar_set_output(upipe, output);
        }

        case UPIPE_AUDIOBAR_GET_ALPHA: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_AUDIO_BAR_SIGNATURE);
            uint8_t *alpha_p = va_arg(args, uint8_t *);
            return _upipe_audiobar_get_alpha(upipe, alpha_p);
        }
        case UPIPE_AUDIOBAR_SET_ALPHA: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_AUDIO_BAR_SIGNATURE);
            unsigned alpha = va_arg(args, unsigned);
            return _upipe_audiobar_set_alpha(upipe, alpha);
        }
        default:
            return UBASE_ERR_UNHANDLED;
    }
}
Exemple #2
0
/** @internal @This handles the pipe control commands.
 *
 * @param upipe description structure of the pipe
 * @param command control command to handle
 * @param args optional arguments
 * @return an error code
 */
static int upipe_dvbcsa_enc_control(struct upipe *upipe,
                                    int command, va_list args)
{
    struct upipe_dvbcsa_enc *upipe_dvbcsa_enc =
        upipe_dvbcsa_enc_from_upipe(upipe);
    struct upipe_dvbcsa_common *common =
        upipe_dvbcsa_enc_to_common(upipe_dvbcsa_enc);

    UBASE_HANDLED_RETURN(upipe_dvbcsa_enc_control_output(upipe, command, args));
    switch (command) {
        case UPIPE_SET_FLOW_DEF: {
            struct uref *flow_def= va_arg(args, struct uref *);
            return upipe_dvbcsa_enc_set_flow_def(upipe, flow_def);
        }

        case UPIPE_DVBCSA_SET_KEY: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_DVBCSA_COMMON_SIGNATURE);
            const char *key = va_arg(args, const char *);
            return upipe_dvbcsa_enc_set_key(upipe, key);
        }

        case UPIPE_DVBCSA_ADD_PID:
        case UPIPE_DVBCSA_DEL_PID:
            return upipe_dvbcsa_common_control(common, command, args);
    }
    return UBASE_ERR_UNHANDLED;
}
Exemple #3
0
/** @internal @This processes control commands on a qt source pipe, and
 * checks the status of the pipe afterwards.
 * 
 * @param upipe description structure of the pipe
 * @param command type of command
 * @param args arguments of the command
 * @return an error code
 */
static int _upipe_qt_html_control(struct upipe *upipe, int command, va_list args)
{
    struct upipe_qt_html *html = upipe_qt_html_from_upipe(upipe);
    switch (command) {
        /* generic commands */
        case UPIPE_ATTACH_UPUMP_MGR: {
            upipe_qt_html_set_upump(upipe, NULL);
            upipe_qt_html_attach_upump_mgr(upipe);
            return UBASE_ERR_NONE;
        }
        case UPIPE_GET_OUTPUT: {
            struct upipe **p = va_arg(args, struct upipe **);
            return upipe_qt_html_get_output(upipe, p);
        }
        case UPIPE_SET_OUTPUT: {
            struct upipe *output = va_arg(args, struct upipe *);
            return upipe_qt_html_set_output(upipe, output);
        }
        case UPIPE_GET_FLOW_DEF: {
            struct uref **p = va_arg(args, struct uref **);
            return upipe_qt_html_get_flow_def(upipe, p);
        }
        case UPIPE_QT_HTML_SET_URL: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_QT_HTML_SIGNATURE);
            html->url = va_arg(args, const char*);
            return UBASE_ERR_NONE;
        }
        case UPIPE_QT_HTML_GET_URL: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_QT_HTML_SIGNATURE);
            *va_arg(args, const char **) = html->url;
            return UBASE_ERR_NONE;
        }
        case UPIPE_QT_HTML_SET_SIZE: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_QT_HTML_SIGNATURE);
            html->H = va_arg(args, int);
            html->V = va_arg(args, int);
            return UBASE_ERR_NONE;
        }
        case UPIPE_QT_HTML_GET_SIZE: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_QT_HTML_SIGNATURE);
            *va_arg(args, int *) = html->H;
            *va_arg(args, int *) = html->V;
            return UBASE_ERR_NONE;
        }
        case UPIPE_QT_HTML_SET_FRAMERATE: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_QT_HTML_SIGNATURE);
            html->fr = va_arg(args, int);
            return UBASE_ERR_NONE;
        }
        case UPIPE_QT_HTML_GET_FRAMERATE: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_QT_HTML_SIGNATURE);
            *va_arg(args, int *) = html->fr;
            return UBASE_ERR_NONE;
        }
        default:
            return UBASE_ERR_UNHANDLED;
    }
}
Exemple #4
0
/** @internal @This handles the pipe control commands.
 *
 * @param upipe description structure of the pipe
 * @param command control command to handle
 * @param args optional arguments
 * @return an error code
 */
static int upipe_vblk_control_real(struct upipe *upipe,
                                   int command, va_list args)
{
    UBASE_HANDLED_RETURN(upipe_vblk_control_output(upipe, command, args));

    switch (command) {
        case UPIPE_SET_FLOW_DEF: {
            struct uref *flow_def = va_arg(args, struct uref *);
            return upipe_vblk_set_flow_def(upipe, flow_def);
        }

        case UPIPE_VBLK_SET_PIC: {
            UBASE_SIGNATURE_CHECK(args, UPIPE_VBLK_SIGNATURE);
            struct uref *uref = va_arg(args, struct uref *);
            return upipe_vblk_set_pic_real(upipe, uref);
        }
    }
    return UBASE_ERR_UNHANDLED;
}
Exemple #5
0
static int upipe_dump_control(struct upipe *upipe, int command, va_list args)
{
    UBASE_HANDLED_RETURN(upipe_dump_control_output(upipe, command, args));
    switch (command) {
    case UPIPE_SET_FLOW_DEF: {
        struct uref *flow_def = va_arg(args, struct uref *);
        return upipe_dump_set_flow_def(upipe, flow_def);
    }

    case UPIPE_DUMP_SET_MAX_LEN: {
        UBASE_SIGNATURE_CHECK(args, UPIPE_DUMP_SIGNATURE)
        size_t max_len = va_arg(args, size_t);
        return _upipe_dump_set_max_len(upipe, max_len);
    }

    default:
        return UBASE_ERR_UNHANDLED;
    }
}