ports/multimedia/mplayer2/files/patch-libmpcodecs_vf__lavcdeint.c
Carlos J. Puga Medina b45df0e7db multimedia/mplayer2: Fix build with ffmpeg 3.x
screenshot.c:60:5: error: implicit declaration of function 'avcodec_free_frame' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
    avcodec_free_frame(&ctx->pic);
    ^
screenshot.c:72:20: error: implicit declaration of function 'avcodec_alloc_frame' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
        ctx->pic = avcodec_alloc_frame();
                   ^
screenshot.c:97:22: error: use of undeclared identifier 'PIX_FMT_RGB24'; did you mean
      'AV_PIX_FMT_RGB24'?
    avctx->pix_fmt = PIX_FMT_RGB24;
                     ^~~~~~~~~~~~~
                     AV_PIX_FMT_RGB24
/usr/local/include/libavutil/pixfmt.h:64:5: note: 'AV_PIX_FMT_RGB24' declared here
    AV_PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
    ^
screenshot.c:113:5: error: implicit declaration of function 'avcodec_get_frame_defaults' is invalid
      in C99 [-Werror,-Wimplicit-function-declaration]
    avcodec_get_frame_defaults(pic);
    ^
screenshot.c:118:16: error: implicit declaration of function 'avcodec_encode_video' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
    int size = avcodec_encode_video(avctx, outbuffer, outbuffer_size, pic);
               ^

PR:		214896
Reported by:	jbeich
Reviewed by:	jbeich, junovitch (mentor)
Approved by:	jbeich, junovitch (mentor)
2016-12-09 15:10:37 +00:00

155 lines
3.6 KiB
C

--- libmpcodecs/vf_lavcdeint.c.orig 2013-07-09 16:33:16 UTC
+++ libmpcodecs/vf_lavcdeint.c
@@ -27,135 +27,6 @@
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
-#include "libavcodec/avcodec.h"
-
-
-struct vf_priv_s
-{
- int width, height;
- int pix_fmt;
-};
-
-/* Support for avcodec's built-in deinterlacer.
- * Based on vf_lavc.c
- */
-
-//===========================================================================//
-
-
-/* Convert mplayer's IMGFMT_* to avcodec's PIX_FMT_* for the supported
- * IMGFMT's, and return -1 if the deinterlacer doesn't support
- * that format (-1 because 0 is a valid PIX_FMT).
- */
-/* The deinterlacer supports planer 4:2:0, 4:2:2, and 4:4:4 YUV */
-static int
-imgfmt_to_pixfmt (int imgfmt)
-{
- switch(imgfmt)
- {
- /* I hope I got all the supported formats */
-
- /* 4:2:0 */
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- return PIX_FMT_YUV420P;
- break;
-
-#if 0
- /* 4:2:2 */
- case IMGFMT_UYVY:
- case IMGFMT_UYNV:
- case IMGFMT_Y422:
- case IMGFMT_YUY2:
- case IMGFMT_YUNV:
- case IMGFMT_YVYU:
- case IMGFMT_Y42T:
- case IMGFMT_V422:
- case IMGFMT_V655:
- return PIX_FMT_YUV422P;
- break;
-#endif
-
- /* Are there any _planar_ YUV 4:4:4 formats? */
-
- default:
- return -1;
- }
-}
-
-
-static int
-config (struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
-{
- struct vf_priv_s *priv = vf->priv;
-
- priv->pix_fmt = imgfmt_to_pixfmt(outfmt);
- if(priv->pix_fmt == -1)
- return 0;
-
- /* The deinterlacer will fail if this is false */
- if ((width & 3) != 0 || (height & 3) != 0)
- return 0;
-
- /* If we get here, the deinterlacer is guaranteed not to fail */
-
- priv->width = width;
- priv->height = height;
-
- return vf_next_config(vf,
- width, height,
- d_width, d_height,
- flags, outfmt);
-}
-
-static int
-put_image (struct vf_instance *vf, mp_image_t *mpi, double pts)
-{
- struct vf_priv_s *priv = vf->priv;
- mp_image_t* dmpi;
- AVPicture pic;
- AVPicture lavc_picture;
-
- lavc_picture.data[0] = mpi->planes[0];
- lavc_picture.data[1] = mpi->planes[1];
- lavc_picture.data[2] = mpi->planes[2];
- lavc_picture.linesize[0] = mpi->stride[0];
- lavc_picture.linesize[1] = mpi->stride[1];
- lavc_picture.linesize[2] = mpi->stride[2];
-
- dmpi = vf_get_image(vf->next, mpi->imgfmt,
- MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
- priv->width, priv->height);
-
- pic.data[0] = dmpi->planes[0];
- pic.data[1] = dmpi->planes[1];
- pic.data[2] = dmpi->planes[2];
- pic.linesize[0] = dmpi->stride[0];
- pic.linesize[1] = dmpi->stride[1];
- pic.linesize[2] = dmpi->stride[2];
-
- if (avpicture_deinterlace(&pic, &lavc_picture,
- priv->pix_fmt, priv->width, priv->height) < 0)
- {
- /* This should not happen -- see config() */
- return 0;
- }
-
- return vf_next_put_image(vf, dmpi, pts);
-}
-
-
-static int
-query_format (struct vf_instance *vf, unsigned int fmt)
-{
- if(imgfmt_to_pixfmt(fmt) == -1)
- return 0;
-
- return vf_next_query_format(vf,fmt);
-}
static int
@@ -164,13 +35,10 @@ vf_open(vf_instance_t *vf, char *args)
/* We don't have any args */
(void) args;
- vf->config = config;
- vf->put_image = put_image;
- vf->query_format = query_format;
- vf->priv = malloc(sizeof(struct vf_priv_s));
- memset(vf->priv,0,sizeof(struct vf_priv_s));
+ mp_msg(MSGT_VFILTER,MSGL_FATAL, "lavcdeint has been removed, please use '-vf pp=fd' (same filter) or '-vf yadif'\n");
- return 1;
+
+ return 0;
}