Пример #1
0
static int lavfi_reconfig(struct vf_instance *vf,
                          struct mp_image_params *in,
                          struct mp_image_params *out)
{
    struct vf_priv_s *p = vf_lw_old_priv(vf);
    if (p->angle == 4) { // "auto"
        int r = in->rotate;
        if (r < 0 || r >= 360) {
            MP_ERR(vf, "Can't apply rotation of %d degrees.\n", r);
            return -1;
        }
        if (r % 90) {
            double a = r / 180.0 * M_PI;
            vf_lw_update_graph(vf, NULL, "rotate=%f:ow=rotw(%f):oh=roth(%f)",
                               a, a, a);
        } else {
            vf_lw_update_graph(vf, NULL, "%s", rot[(r / 90) % 360]);
        }
        out->rotate = 0;
    }
    return 0;
}
Пример #2
0
static int lavfi_reconfig(struct vf_instance *vf,
                          struct mp_image_params *in,
                          struct mp_image_params *out)
{
    struct vf_priv_s *p = vf_lw_old_priv(vf);
    if (p->angle == 4) { // "auto"
        int r = in->rotate;
        if (r < 0 || r >= 360 || (r % 90) != 0) {
            MP_ERR(vf, "Can't apply rotation of %d degrees.\n", r);
            return -1;
        }
        vf_lw_update_graph(vf, NULL, "%s", rot[(r / 90) % 360]);
        out->rotate = 0;
    }
    return 0;
}
Пример #3
0
static int lavfi_reconfig(struct vf_instance *vf,
                          struct mp_image_params *in,
                          struct mp_image_params *out)
{
    struct vf_priv_s *p = vf_lw_old_priv(vf);
    if (p->auto_in) {
        const char *inf = MP_STEREO3D_NAME(in->stereo_in);
        if (!inf) {
            MP_ERR(vf, "Unknown/unsupported 3D mode.\n");
            return -1;
        }
        vf_lw_update_graph(vf, "stereo3d", "%s:%s",
                           inf, m_opt_choice_str(stereo_code_names, p->out_fmt));
        out->stereo_in = out->stereo_out = opt_to_stereo3dmode(p->out_fmt);
    }
    return 0;
}