Esempio n. 1
0
static int vf_open(vf_instance_t *vf, char *args){
    vf->config=config;
    vf->put_image=put_image;
    vf->get_image=get_image;
    vf->query_format=query_format;
    vf->uninit=uninit;

    if (vf->priv->file) {
        if (load_timed_rectangles(vf->priv))
            return 0;
        mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d from %s\n",
               vf->priv->n_timed_rect, vf->priv->file);
        vf->priv->cur_timed_rect = -1;
    }
    fix_band(vf->priv);

    // check csp:
    vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
    if(!vf->priv->outfmt)
    {
        uninit(vf);
        return 0; // no csp match :(
    }

    return 1;
}
Esempio n. 2
0
static int vf_open(vf_instance_t *vf, char *args){
    int i;

    vf->query_format=query_format;
    vf->control=control;
    vf->config=config;
    vf->filter=filter;
    vf->uninit=uninit;
    vf->priv=malloc(sizeof(struct vf_priv_s));
    vf->priv->context=NULL;

    // check csp:
    vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_420P);
    if(!vf->priv->outfmt) return 0; // no csp match :(

    char *name = args ? args : "de";

	for(i=0; i<=PP_QUALITY_MAX; i++){
            vf->priv->ppMode[i]= pp_get_mode_by_name_and_quality(name, i);
            if(vf->priv->ppMode[i]==NULL) return -1;
        }

    vf->priv->pp=PP_QUALITY_MAX;
    return 1;
}
Esempio n. 3
0
static int open(vf_instance_t *vf, char* args) {
    int res;

    vf->config=config;
    vf->put_image=put_image;
    vf->get_image=get_image;
    vf->query_format=query_format;
    vf->uninit=uninit;
    if (!vf->priv)
    {
        vf->priv=malloc(sizeof(struct vf_priv_s));
        memset(vf->priv, 0, sizeof(struct vf_priv_s));
    }

    if (args) res = sscanf(args, "%d:%d:%d:%d:%d",
                               &vf->priv->xoff, &vf->priv->yoff,
                               &vf->priv->lw, &vf->priv->lh,
                               &vf->priv->band);
    if (args && (res != 5)) {
        uninit(vf);
        return 0; // bad syntax
    }

    mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d x %d, %d x %d, band = %d\n",
           vf->priv->xoff, vf->priv->yoff,
           vf->priv->lw, vf->priv->lh,
           vf->priv->band);

    vf->priv->show = 0;

    if (vf->priv->band < 0) {
        vf->priv->band = 4;
        vf->priv->show = 1;
    }


    vf->priv->lw += vf->priv->band*2;
    vf->priv->lh += vf->priv->band*2;
    vf->priv->xoff -= vf->priv->band;
    vf->priv->yoff -= vf->priv->band;

    // check csp:
    vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
    if(!vf->priv->outfmt)
    {
        uninit(vf);
        return 0; // no csp match :(
    }

    return 1;
}