Esempio n. 1
0
static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts) {
    mp_image_t *dmpi;

    if(!(mpi->flags&MP_IMGFLAG_DIRECT)) {
        // no DR, so get a new image! hope we'll get DR buffer:
        vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
                              MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
                              mpi->w,mpi->h);
    }
    dmpi= vf->dmpi;

    delogo(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h,
           vf->priv->xoff, vf->priv->yoff, vf->priv->lw, vf->priv->lh, vf->priv->band, vf->priv->show,
           mpi->flags&MP_IMGFLAG_DIRECT);
    delogo(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2,
           vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
           mpi->flags&MP_IMGFLAG_DIRECT);
    delogo(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2,
           vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show,
           mpi->flags&MP_IMGFLAG_DIRECT);

    vf_clone_mpi_attributes(dmpi, mpi);

    return vf_next_put_image(vf,dmpi, pts);
}
uint8_t ADMVideoMPdelogo::getFrameNumberNoAlloc(uint32_t frame,
                                uint32_t *len,
                                ADMImage *data,
                                uint32_t *flags)
{
                        if(frame>=_info.nb_frames) 
                        {
                                printf("MPdelogo : Filter : out of bound!\n");
                                return 0;
                        }
        
                        ADM_assert(_param);

ADMImage *curImage;
char txt[256];
                        curImage=vidCache->getImage(frame);
                        if(!curImage)
                        {
                                printf("MPdelogo : error getting frame\n");
                                return 0;
                        }
                delogo(YPLANE(data), YPLANE(curImage), _info.width, _info.width, _info.width, _info.height,
                        _param->xoff, _param->yoff, _param->lw, _param->lh, _param->band, _param->show,0);
                delogo(UPLANE(data), UPLANE(curImage), _info.width>>1, _info.width>>1, _info.width>>1,
                 _info.height>>1,_param->xoff>>1, _param->yoff>>1, _param->lw>>1,
                 _param->lh>>1, _param->band>>1, _param->show,0);
                delogo(VPLANE(data), VPLANE(curImage), _info.width>>1, _info.width>>1, _info.width>>1,
                 _info.height>>1,_param->xoff>>1, _param->yoff>>1, _param->lw>>1,
                 _param->lh>>1, _param->band>>1, _param->show,0);
                
                        vidCache->unlockAll();
        return 1;
}