Exemplo n.º 1
0
static int vf_open(vf_instance_t *vf)
{
    struct vf_priv_s *p = vf->priv;

#if LIBAVFILTER_VERSION_MICRO >= 100
    const char *mode[] = {"send_frame", "send_field", "send_frame_nospatial",
                          "send_field_nospatial"};

    if (vf_lw_set_graph(vf, p->lw_opts, "yadif", "mode=%s:deint=%s", mode[p->mode],
                        p->interlaced_only ? "interlaced" : "all") >= 0)
    {
        return 1;
    }
#else
    // Libav numeric modes happen to match ours, but keep it explicit.
    const char *mode[] = {"0", "1", "2", "3"};
    if (vf_lw_set_graph(vf, p->lw_opts, "yadif", "mode=%s:auto=%d", mode[p->mode],
                        p->interlaced_only) >= 0)
    {
        return 1;
    }
#endif

    MP_FATAL(vf, "This version of libavfilter has no 'yadif' filter.\n");
    return 0;
}
Exemplo n.º 2
0
static void lavfi_init(vf_instance_t *vf)
{
    if (vf->priv->in_fmt == STEREO_AUTO &&
        vf_lw_set_graph(vf, vf->priv->lw_opts, "stereo3d", "null") >= 0)
    {
        vf_lw_set_reconfig_cb(vf, lavfi_reconfig);
        return;
    }

    if (vf_lw_set_graph(vf, vf->priv->lw_opts, "stereo3d", "%s:%s",
                        m_opt_choice_str(stereo_code_names, vf->priv->in_fmt),
                        m_opt_choice_str(stereo_code_names, vf->priv->out_fmt)) >= 0)
        return;
}
Exemplo n.º 3
0
static int vf_open(vf_instance_t *vf)
{
    struct vf_priv_s *p = vf->priv;

    if (vf_lw_set_graph(vf, p->lw_opts, NULL, "%s", rot[p->angle]) >= 0) {
        vf_lw_set_reconfig_cb(vf, lavfi_reconfig);
        return 1;
    }

    return 0;
}
Exemplo n.º 4
0
static int vf_open(vf_instance_t *vf)
{
    struct vf_priv_s *p = vf->priv;
    const char *pname[3] = {"y", "u", "v"};
    if (vf_lw_set_graph(vf, p->lw_opts, "pullup", "%d:%d:%d:%d:%d:%s",
                        p->junk_left, p->junk_right, p->junk_top, p->junk_bottom,
                        p->strict_breaks, pname[p->metric_plane]) >= 0)
    {
        return 1;
    }

    MP_FATAL(vf, "This version of libavfilter has no 'pullup' filter.\n");
    return 0;
}
Exemplo n.º 5
0
static int vf_open(vf_instance_t *vf)
{
    struct vf_priv_s *p = vf->priv;

    static const char *const rot[] = {
        "null",
        "transpose=clock",
        "vflip,hflip",
        "transpose=cclock",
    };

    if (vf_lw_set_graph(vf, p->lw_opts, NULL, "%s", rot[p->angle]) >= 0)
        return 1;

    MP_FATAL(vf, "Requires libavfilter.\n");
    return 1;
}
Exemplo n.º 6
0
static int vf_open(vf_instance_t *vf)
{
    struct vf_priv_s *p = vf->priv;

    p->lumaParam.msizeX |= 1;
    p->lumaParam.msizeY |= 1;
    p->chromaParam.msizeX |= 1;
    p->chromaParam.msizeY |= 1;

    if (vf_lw_set_graph(vf, p->lw_opts, "unsharp", "%d:%d:%f:%d:%d:%f",
                        p->lumaParam.msizeX, p->lumaParam.msizeY, p->lumaParam.amount,
                        p->chromaParam.msizeX, p->chromaParam.msizeY, p->chromaParam.amount)
                       >= 0)
    {
        return 1;
    }

    MP_FATAL(vf, "This version of libavfilter has no 'unsharp' filter.\n");
    return 0;
}