From f85d12e25f136a5418416704b1e8a37d041b4437 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Wed, 17 Feb 2016 22:06:14 +0100 Subject: media-plugins/gst-plugins-libav: Fix build and runtime with ffmpeg 3.0. Bug #574790. Patches are all from upstream, except gst-plugins-libav-1.6.3-minr-compat.patch which is a small #ifdefery more by myself to preserve working options and passing tests with ffmpeg 2.8. Package-Manager: portage-2.2.27 Signed-off-by: Alexis Ballier --- .../files/gst-plugins-libav-1.6.3-bitrate.patch | 49 +++ .../gst-plugins-libav-1.6.3-chain-dispose.patch | 23 ++ .../gst-plugins-libav-1.6.3-deinterlace-lavf.patch | 199 ++++++++++++ .../gst-plugins-libav-1.6.3-minr-compat.patch | 22 ++ .../files/gst-plugins-libav-1.6.3-minr-maxr.patch | 74 +++++ .../gst-plugins-libav-1.6.3-no-deprecated.patch | 356 +++++++++++++++++++++ 6 files changed, 723 insertions(+) create mode 100644 media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-bitrate.patch create mode 100644 media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-chain-dispose.patch create mode 100644 media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-deinterlace-lavf.patch create mode 100644 media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-compat.patch create mode 100644 media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-maxr.patch create mode 100644 media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-no-deprecated.patch (limited to 'media-plugins/gst-plugins-libav/files') diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-bitrate.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-bitrate.patch new file mode 100644 index 000000000000..4c0510aa3f1e --- /dev/null +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-bitrate.patch @@ -0,0 +1,49 @@ +commit 46fb2e9f11820190f2e173f4ebd83f0d15adea40 +Author: Sebastian Dröge +Date: Sat Jan 16 16:40:52 2016 +0200 + + libav: Bitrate field changed from int to int64_t, fix compiler warnings + + Cast it to a gint64 for now though, as otherwise we will fail compilation + with ffmpeg 2.8. + + https://bugzilla.gnome.org/show_bug.cgi?id=757498 + +diff --git a/ext/libav/gstavaudenc.c b/ext/libav/gstavaudenc.c +index 64d7011..9a8e690 100644 +--- a/ext/libav/gstavaudenc.c ++++ b/ext/libav/gstavaudenc.c +@@ -269,8 +269,9 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info) + ffmpegaudenc->context->bit_rate = ffmpegaudenc->bitrate; + ffmpegaudenc->context->bit_rate_tolerance = ffmpegaudenc->bitrate; + } else { +- GST_INFO_OBJECT (ffmpegaudenc, "Using avcontext default bitrate %d", +- ffmpegaudenc->context->bit_rate); ++ GST_INFO_OBJECT (ffmpegaudenc, ++ "Using avcontext default bitrate %" G_GINT64_FORMAT, ++ (gint64) ffmpegaudenc->context->bit_rate); + } + + /* RTP payload used for GOB production (for Asterisk) */ +diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c +index 2f8dc8a..966c9b8 100644 +--- a/ext/libav/gstavcodecmap.c ++++ b/ext/libav/gstavcodecmap.c +@@ -2357,6 +2357,7 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps, + GstStructure *structure; + const gchar *fmt; + GstAudioFormat format = GST_AUDIO_FORMAT_UNKNOWN; ++ gint bitrate; + + g_return_if_fail (gst_caps_get_size (caps) == 1); + +@@ -2365,7 +2366,8 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps, + gst_structure_get_int (structure, "channels", &context->channels); + gst_structure_get_int (structure, "rate", &context->sample_rate); + gst_structure_get_int (structure, "block_align", &context->block_align); +- gst_structure_get_int (structure, "bitrate", &context->bit_rate); ++ gst_structure_get_int (structure, "bitrate", &bitrate); ++ context->bit_rate = bitrate; + + if (!raw) + return; diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-chain-dispose.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-chain-dispose.patch new file mode 100644 index 000000000000..de8947a305fd --- /dev/null +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-chain-dispose.patch @@ -0,0 +1,23 @@ +commit e04bcf0601286990d0fa2dd9999fcfcff1b5784b +Author: Sebastian Dröge +Date: Sat Jan 16 16:43:16 2016 +0200 + + avdeinterlace: Chain up to parent class' dispose() + + https://bugzilla.gnome.org/show_bug.cgi?id=757498 + +diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c +index fe2d60d..6bdc605 100644 +--- a/ext/libav/gstavdeinterlace.c ++++ b/ext/libav/gstavdeinterlace.c +@@ -310,7 +310,10 @@ static void + gst_ffmpegdeinterlace_dispose (GObject * obj) + { + GstFFMpegDeinterlace *deinterlace = GST_FFMPEGDEINTERLACE (obj); ++ + delete_filter_graph (deinterlace); ++ ++ G_OBJECT_CLASS (gst_ffmpegdeinterlace_parent_class)->dispose (obj); + } + + static int diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-deinterlace-lavf.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-deinterlace-lavf.patch new file mode 100644 index 000000000000..f53c8547b003 --- /dev/null +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-deinterlace-lavf.patch @@ -0,0 +1,199 @@ +commit ddec3a2c78dd317efc1e9bc3ec0b2c49bf31ae77 +Author: Andreas Cadhalpun +Date: Wed Nov 4 21:16:18 2015 +0100 + + avdeinterlace: Port non-deprecated AVFilter API + + https://bugzilla.gnome.org/show_bug.cgi?id=757498 + +diff --git a/configure.ac b/configure.ac +index 19fa183..4d6fe94 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -280,7 +280,7 @@ AC_ARG_WITH(system-libav, + [AC_HELP_STRING([--with-system-libav], [use system Libav libraries])]) + + if test "x$with_system_libav" = "xyes"; then +- PKG_CHECK_MODULES(LIBAV, libavformat libavcodec libavutil) ++ PKG_CHECK_MODULES(LIBAV, libavfilter libavformat libavcodec libavutil) + PKG_CHECK_MODULES(SWSCALE, libswscale libavutil) + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LIBAV_CFLAGS" +@@ -313,6 +313,7 @@ else + + LIBAV_DEPS="\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \ + \$(top_builddir)/gst-libs/ext/libav/libavcodec/libavcodec.a \ ++ \$(top_builddir)/gst-libs/ext/libav/libavfilter/libavfilter.a \ + \$(top_builddir)/gst-libs/ext/libav/libswresample/libswresample.a \ + \$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a" + if test "x$enable_static_plugins" = xyes; then +@@ -357,7 +358,7 @@ else + # Enable pic and static so that we get .a files, but with PIC code. + emblibav_configure_args="$emblibav_configure_args \ + --enable-static --enable-pic \ +- --disable-avdevice --disable-postproc --disable-avfilter \ ++ --disable-avdevice --disable-postproc \ + --disable-programs --disable-ffserver --disable-ffplay --disable-ffprobe --disable-ffmpeg \ + --disable-encoder=flac --disable-protocols --disable-devices \ + --disable-network --disable-hwaccels --disable-dxva2 --disable-vdpau \ +diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c +index 2d142a6..6906059 100644 +--- a/ext/libav/gstavdeinterlace.c ++++ b/ext/libav/gstavdeinterlace.c +@@ -25,6 +25,9 @@ + #endif + + #include ++#include ++#include ++#include + + #include + #include +@@ -93,6 +96,14 @@ typedef struct _GstFFMpegDeinterlace + + enum PixelFormat pixfmt; + AVPicture from_frame, to_frame; ++ ++ AVFilterContext *buffersink_ctx; ++ AVFilterContext *buffersrc_ctx; ++ AVFilterGraph *filter_graph; ++ AVFrame *filter_frame; ++ int last_width, last_height; ++ enum AVPixelFormat last_pixfmt; ++ + } GstFFMpegDeinterlace; + + typedef struct _GstFFMpegDeinterlaceClass +@@ -135,6 +146,8 @@ G_DEFINE_TYPE (GstFFMpegDeinterlace, gst_ffmpegdeinterlace, GST_TYPE_ELEMENT); + static GstFlowReturn gst_ffmpegdeinterlace_chain (GstPad * pad, + GstObject * parent, GstBuffer * inbuf); + ++static void gst_ffmpegdeinterlace_dispose (GObject * obj); ++ + static void + gst_ffmpegdeinterlace_class_init (GstFFMpegDeinterlaceClass * klass) + { +@@ -167,6 +180,8 @@ gst_ffmpegdeinterlace_class_init (GstFFMpegDeinterlaceClass * klass) + gst_element_class_set_static_metadata (element_class, + "libav Deinterlace element", "Filter/Effect/Video/Deinterlace", + "Deinterlace video", "Luca Ognibene "); ++ ++ gobject_class->dispose = gst_ffmpegdeinterlace_dispose; + } + + static void +@@ -277,6 +292,101 @@ gst_ffmpegdeinterlace_init (GstFFMpegDeinterlace * deinterlace) + deinterlace->reconfigure = FALSE; + deinterlace->mode = DEFAULT_MODE; + deinterlace->new_mode = -1; ++ deinterlace->last_width = -1; ++ deinterlace->last_height = -1; ++ deinterlace->last_pixfmt = AV_PIX_FMT_NONE; ++} ++ ++static void ++delete_filter_graph (GstFFMpegDeinterlace * deinterlace) ++{ ++ if (deinterlace->filter_graph) { ++ av_frame_free (&deinterlace->filter_frame); ++ avfilter_graph_free (&deinterlace->filter_graph); ++ } ++} ++ ++static void ++gst_ffmpegdeinterlace_dispose (GObject * obj) ++{ ++ GstFFMpegDeinterlace *deinterlace = GST_FFMPEGDEINTERLACE (obj); ++ delete_filter_graph (deinterlace); ++} ++ ++static int ++init_filter_graph (GstFFMpegDeinterlace * deinterlace, ++ enum AVPixelFormat pixfmt, int width, int height) ++{ ++ AVFilterInOut *inputs = NULL, *outputs = NULL; ++ char args[512]; ++ int res; ++ ++ delete_filter_graph (deinterlace); ++ deinterlace->filter_graph = avfilter_graph_alloc (); ++ snprintf (args, sizeof (args), ++ "buffer=video_size=%dx%d:pix_fmt=%d:time_base=1/1:pixel_aspect=0/1[in];" ++ "[in]yadif[out];" "[out]buffersink", width, height, pixfmt); ++ res = ++ avfilter_graph_parse2 (deinterlace->filter_graph, args, &inputs, ++ &outputs); ++ if (res < 0) ++ return res; ++ if (inputs || outputs) ++ return -1; ++ res = avfilter_graph_config (deinterlace->filter_graph, NULL); ++ if (res < 0) ++ return res; ++ ++ deinterlace->buffersrc_ctx = ++ avfilter_graph_get_filter (deinterlace->filter_graph, "Parsed_buffer_0"); ++ deinterlace->buffersink_ctx = ++ avfilter_graph_get_filter (deinterlace->filter_graph, ++ "Parsed_buffersink_2"); ++ if (!deinterlace->buffersrc_ctx || !deinterlace->buffersink_ctx) ++ return -1; ++ deinterlace->filter_frame = av_frame_alloc (); ++ deinterlace->last_width = width; ++ deinterlace->last_height = height; ++ deinterlace->last_pixfmt = pixfmt; ++ ++ return 0; ++} ++ ++static int ++process_filter_graph (GstFFMpegDeinterlace * deinterlace, AVPicture * dst, ++ const AVPicture * src, enum AVPixelFormat pixfmt, int width, int height) ++{ ++ int res; ++ ++ if (!deinterlace->filter_graph || width != deinterlace->last_width || ++ height != deinterlace->last_height ++ || pixfmt != deinterlace->last_pixfmt) { ++ res = init_filter_graph (deinterlace, pixfmt, width, height); ++ if (res < 0) ++ return res; ++ } ++ ++ memcpy (deinterlace->filter_frame->data, src->data, sizeof (src->data)); ++ memcpy (deinterlace->filter_frame->linesize, src->linesize, ++ sizeof (src->linesize)); ++ deinterlace->filter_frame->width = width; ++ deinterlace->filter_frame->height = height; ++ deinterlace->filter_frame->format = pixfmt; ++ res = ++ av_buffersrc_add_frame (deinterlace->buffersrc_ctx, ++ deinterlace->filter_frame); ++ if (res < 0) ++ return res; ++ res = ++ av_buffersink_get_frame (deinterlace->buffersink_ctx, ++ deinterlace->filter_frame); ++ if (res < 0) ++ return res; ++ av_picture_copy (dst, (const AVPicture *) deinterlace->filter_frame, pixfmt, ++ width, height); ++ av_frame_unref (deinterlace->filter_frame); ++ ++ return 0; + } + + static GstFlowReturn +@@ -320,8 +430,9 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstObject * parent, + gst_ffmpeg_avpicture_fill (&deinterlace->to_frame, to_map.data, + deinterlace->pixfmt, deinterlace->width, deinterlace->height); + +- avpicture_deinterlace (&deinterlace->to_frame, &deinterlace->from_frame, +- deinterlace->pixfmt, deinterlace->width, deinterlace->height); ++ process_filter_graph (deinterlace, &deinterlace->to_frame, ++ &deinterlace->from_frame, deinterlace->pixfmt, deinterlace->width, ++ deinterlace->height); + gst_buffer_unmap (outbuf, &to_map); + gst_buffer_unmap (inbuf, &from_map); + diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-compat.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-compat.patch new file mode 100644 index 000000000000..70b2e0a29cbb --- /dev/null +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-compat.patch @@ -0,0 +1,22 @@ +Preserve compatibility with ffmpeg 2.8 for rc-min-rate option. + +Index: gst-libav-1.6.3/ext/libav/gstavcfg.c +=================================================================== +--- gst-libav-1.6.3.orig/ext/libav/gstavcfg.c ++++ gst-libav-1.6.3/ext/libav/gstavcfg.c +@@ -524,9 +524,15 @@ gst_ffmpeg_cfg_init (void) + #endif + gst_ffmpeg_add_pspec (pspec, config.rc_max_rate, FALSE, mpeg, NULL); + ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT (57, 3, 0) ++ pspec = g_param_spec_int ("rc-min-rate", "Ratecontrol Minimum Bitrate", ++ "Ratecontrol Minimum Bitrate", 0, G_MAXINT, 0, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); ++#else + pspec = g_param_spec_int64 ("rc-min-rate", "Ratecontrol Minimum Bitrate", + "Ratecontrol Minimum Bitrate", 0, G_MAXINT64, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); ++#endif + gst_ffmpeg_add_pspec (pspec, config.rc_min_rate, FALSE, mpeg, NULL); + + pspec = diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-maxr.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-maxr.patch new file mode 100644 index 000000000000..a3b4a9147c79 --- /dev/null +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-minr-maxr.patch @@ -0,0 +1,74 @@ +commit e3cf542215519f882b7570a4b59aad75a8d2d27a +Author: Edward Hervey +Date: Tue Feb 16 16:32:38 2016 +0100 + + avcfg: rc-min-rate and rc-max-rate are now 64bit integers + + Switch the gobject properties and internal handling to support that + +diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c +index d38cce1..a361994 100644 +--- a/ext/libav/gstavcfg.c ++++ b/ext/libav/gstavcfg.c +@@ -513,13 +513,19 @@ gst_ffmpeg_cfg_init (void) + gst_ffmpeg_add_pspec (pspec, config.rc_buffer_aggressivity, FALSE, mpeg, + NULL); + ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT (57, 3, 0) + pspec = g_param_spec_int ("rc-max-rate", "Ratecontrol Maximum Bitrate", + "Ratecontrol Maximum Bitrate", 0, G_MAXINT, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); ++#else ++ pspec = g_param_spec_int64 ("rc-max-rate", "Ratecontrol Maximum Bitrate", ++ "Ratecontrol Maximum Bitrate", 0, G_MAXINT64, 0, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); ++#endif + gst_ffmpeg_add_pspec (pspec, config.rc_max_rate, FALSE, mpeg, NULL); + +- pspec = g_param_spec_int ("rc-min-rate", "Ratecontrol Minimum Bitrate", +- "Ratecontrol Minimum Bitrate", 0, G_MAXINT, 0, ++ pspec = g_param_spec_int64 ("rc-min-rate", "Ratecontrol Minimum Bitrate", ++ "Ratecontrol Minimum Bitrate", 0, G_MAXINT64, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + gst_ffmpeg_add_pspec (pspec, config.rc_min_rate, FALSE, mpeg, NULL); + +@@ -770,6 +776,15 @@ gst_ffmpeg_cfg_install_property (GstFFMpegVidEncClass * klass, guint base) + : pint->default_value, pspec->flags); + break; + } ++ case G_TYPE_INT64:{ ++ GParamSpecInt64 *pint = G_PARAM_SPEC_INT64 (pspec); ++ ++ pspec = g_param_spec_int64 (name, nick, blurb, ++ pint->minimum, pint->maximum, ++ lavc_default ? G_STRUCT_MEMBER (gint64, ctx, ctx_offset) ++ : pint->default_value, pspec->flags); ++ break; ++ } + case G_TYPE_UINT:{ + GParamSpecUInt *puint = G_PARAM_SPEC_UINT (pspec); + +@@ -862,6 +877,11 @@ gst_ffmpeg_cfg_set_property (GObject * object, + G_STRUCT_MEMBER (gint, ffmpegenc, qdata->offset) = + g_value_get_int (value); + break; ++ case G_TYPE_INT64: ++ g_return_val_if_fail (qdata->size == sizeof (gint64), TRUE); ++ G_STRUCT_MEMBER (gint64, ffmpegenc, qdata->offset) = ++ g_value_get_int64 (value); ++ break; + case G_TYPE_FLOAT: + g_return_val_if_fail (qdata->size == sizeof (gfloat), TRUE); + G_STRUCT_MEMBER (gfloat, ffmpegenc, qdata->offset) = +@@ -924,6 +944,11 @@ gst_ffmpeg_cfg_get_property (GObject * object, + g_return_val_if_fail (qdata->size == sizeof (gint), TRUE); + g_value_set_int (value, G_STRUCT_MEMBER (gint, ffmpegenc, qdata->offset)); + break; ++ case G_TYPE_INT64: ++ g_return_val_if_fail (qdata->size == sizeof (gint64), TRUE); ++ g_value_set_int64 (value, G_STRUCT_MEMBER (gint64, ffmpegenc, ++ qdata->offset)); ++ break; + case G_TYPE_FLOAT: + g_return_val_if_fail (qdata->size == sizeof (gfloat), TRUE); + g_value_set_float (value, diff --git a/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-no-deprecated.patch b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-no-deprecated.patch new file mode 100644 index 000000000000..578853399f1e --- /dev/null +++ b/media-plugins/gst-plugins-libav/files/gst-plugins-libav-1.6.3-no-deprecated.patch @@ -0,0 +1,356 @@ +commit 6235a04ef356f8d7e2f933758ddba359fa95a5ec +Author: Andreas Cadhalpun +Date: Wed Nov 4 21:18:56 2015 +0100 + + libav: Remove usage of deprecated API + + https://bugzilla.gnome.org/show_bug.cgi?id=757498 + +diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c +index a85f547..d38cce1 100644 +--- a/ext/libav/gstavcfg.c ++++ b/ext/libav/gstavcfg.c +@@ -173,13 +173,10 @@ gst_ffmpeg_idct_algo_get_type (void) + {FF_IDCT_SIMPLEMMX, "Simple MMX", "simplemmx"}, + {FF_IDCT_ARM, "ARM", "arm"}, + {FF_IDCT_ALTIVEC, "Altivec", "altivec"}, +- {FF_IDCT_SH4, "SH4", "sh4"}, + {FF_IDCT_SIMPLEARM, "Simple ARM", "simplearm"}, +- {FF_IDCT_IPP, "IPP", "ipp"}, + {FF_IDCT_XVID, "XVID", "xvid"}, + {FF_IDCT_SIMPLEARMV5TE, "Simple ARMV5TE", "simplearmv5te"}, + {FF_IDCT_SIMPLEARMV6, "Simple ARMV6", "simplearmv6"}, +- {FF_IDCT_SIMPLEVIS, "Simple Vis", "simplevis"}, + {FF_IDCT_FAAN, "FAAN", "faan"}, + {FF_IDCT_SIMPLENEON, "Simple NEON", "simpleneon"}, + {0, NULL, NULL}, +@@ -665,7 +662,7 @@ gst_ffmpeg_cfg_init (void) + gst_ffmpeg_add_pspec (pspec, interlaced, FALSE, mpeg, NULL); + + pspec = g_param_spec_int ("max-bframes", "Max B-Frames", +- "Maximum B-frames in a row", 0, FF_MAX_B_FRAMES, 0, ++ "Maximum B-frames in a row", 0, INT_MAX, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + gst_ffmpeg_add_pspec (pspec, config.max_b_frames, FALSE, mpeg, NULL); + +diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c +index 11a9ed2..2f8dc8a 100644 +--- a/ext/libav/gstavcodecmap.c ++++ b/ext/libav/gstavcodecmap.c +@@ -770,10 +770,6 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, + } + break; + +- case AV_CODEC_ID_MPEG2VIDEO_XVMC: +- /* this is a special ID - don't need it in GStreamer, I think */ +- break; +- + case AV_CODEC_ID_H263: + if (encode) { + caps = +@@ -2202,7 +2198,7 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, + */ + + static GstCaps * +-gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context, ++gst_ffmpeg_pixfmt_to_caps (enum AVPixelFormat pix_fmt, AVCodecContext * context, + enum AVCodecID codec_id) + { + GstCaps *caps = NULL; +@@ -2533,7 +2529,7 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, + typedef struct + { + GstVideoFormat format; +- enum PixelFormat pixfmt; ++ enum AVPixelFormat pixfmt; + } PixToFmt; + + /* FIXME : FILLME */ +@@ -2625,7 +2621,7 @@ static const PixToFmt pixtofmttable[] = { + }; + + GstVideoFormat +-gst_ffmpeg_pixfmt_to_videoformat (enum PixelFormat pixfmt) ++gst_ffmpeg_pixfmt_to_videoformat (enum AVPixelFormat pixfmt) + { + guint i; + +@@ -2637,7 +2633,7 @@ gst_ffmpeg_pixfmt_to_videoformat (enum PixelFormat pixfmt) + return GST_VIDEO_FORMAT_UNKNOWN; + } + +-static enum PixelFormat ++static enum AVPixelFormat + gst_ffmpeg_videoformat_to_pixfmt_for_codec (GstVideoFormat format, + const AVCodec * codec) + { +@@ -2661,7 +2657,7 @@ gst_ffmpeg_videoformat_to_pixfmt_for_codec (GstVideoFormat format, + return AV_PIX_FMT_NONE; + } + +-enum PixelFormat ++enum AVPixelFormat + gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format) + { + return gst_ffmpeg_videoformat_to_pixfmt_for_codec (format, NULL); +diff --git a/ext/libav/gstavcodecmap.h b/ext/libav/gstavcodecmap.h +index 40f46c3..486a0d5 100644 +--- a/ext/libav/gstavcodecmap.h ++++ b/ext/libav/gstavcodecmap.h +@@ -132,8 +132,8 @@ void + gst_ffmpeg_audioinfo_to_context (GstAudioInfo *info, + AVCodecContext *context); + +-GstVideoFormat gst_ffmpeg_pixfmt_to_videoformat (enum PixelFormat pixfmt); +-enum PixelFormat gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format); ++GstVideoFormat gst_ffmpeg_pixfmt_to_videoformat (enum AVPixelFormat pixfmt); ++enum AVPixelFormat gst_ffmpeg_videoformat_to_pixfmt (GstVideoFormat format); + + GstAudioFormat gst_ffmpeg_smpfmt_to_audioformat (enum AVSampleFormat sample_fmt); + +diff --git a/ext/libav/gstavdeinterlace.c b/ext/libav/gstavdeinterlace.c +index 6906059..fe2d60d 100644 +--- a/ext/libav/gstavdeinterlace.c ++++ b/ext/libav/gstavdeinterlace.c +@@ -94,7 +94,7 @@ typedef struct _GstFFMpegDeinterlace + gboolean reconfigure; + GstFFMpegDeinterlaceMode new_mode; + +- enum PixelFormat pixfmt; ++ enum AVPixelFormat pixfmt; + AVPicture from_frame, to_frame; + + AVFilterContext *buffersink_ctx; +diff --git a/ext/libav/gstavutils.c b/ext/libav/gstavutils.c +index c434202..5d1567b 100644 +--- a/ext/libav/gstavutils.c ++++ b/ext/libav/gstavutils.c +@@ -279,7 +279,7 @@ gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height) + + int + gst_ffmpeg_avpicture_fill (AVPicture * picture, +- uint8_t * ptr, enum PixelFormat pix_fmt, int width, int height) ++ uint8_t * ptr, enum AVPixelFormat pix_fmt, int width, int height) + { + int size, w2, h2, size2; + int stride, stride2; +diff --git a/ext/libav/gstavutils.h b/ext/libav/gstavutils.h +index 6d111a2..f4d90ef 100644 +--- a/ext/libav/gstavutils.h ++++ b/ext/libav/gstavutils.h +@@ -42,7 +42,7 @@ gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height); + int + gst_ffmpeg_avpicture_fill (AVPicture * picture, + uint8_t * ptr, +- enum PixelFormat pix_fmt, ++ enum AVPixelFormat pix_fmt, + int width, + int height); + +diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c +index da9acf6..cc0cf03 100644 +--- a/ext/libav/gstavviddec.c ++++ b/ext/libav/gstavviddec.c +@@ -444,9 +444,6 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder, + + /* set buffer functions */ + ffmpegdec->context->get_buffer2 = gst_ffmpegviddec_get_buffer2; +- ffmpegdec->context->get_buffer = NULL; +- ffmpegdec->context->reget_buffer = NULL; +- ffmpegdec->context->release_buffer = NULL; + ffmpegdec->context->draw_horiz_band = NULL; + + /* reset coded_width/_height to prevent it being reused from last time when +@@ -825,10 +822,6 @@ gst_ffmpegviddec_get_buffer2 (AVCodecContext * context, AVFrame * picture, + + picture->buf[0] = av_buffer_create (NULL, 0, dummy_free_buffer, dframe, 0); + +- /* tell ffmpeg we own this buffer, transfer the ref we have on the buffer to +- * the opaque data. */ +- picture->type = FF_BUFFER_TYPE_USER; +- + GST_LOG_OBJECT (ffmpegdec, "returned frame %p", dframe->buffer); + + return 0; +@@ -1355,8 +1348,6 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec, + (guint64) ffmpegdec->picture->pts); + GST_DEBUG_OBJECT (ffmpegdec, "picture: num %d", + ffmpegdec->picture->coded_picture_number); +- GST_DEBUG_OBJECT (ffmpegdec, "picture: ref %d", +- ffmpegdec->picture->reference); + GST_DEBUG_OBJECT (ffmpegdec, "picture: display %d", + ffmpegdec->picture->display_picture_number); + GST_DEBUG_OBJECT (ffmpegdec, "picture: opaque %p", +diff --git a/ext/libav/gstavviddec.h b/ext/libav/gstavviddec.h +index f152ba8..a9965b7 100644 +--- a/ext/libav/gstavviddec.h ++++ b/ext/libav/gstavviddec.h +@@ -41,7 +41,7 @@ struct _GstFFMpegVidDec + gboolean opened; + + /* current output pictures */ +- enum PixelFormat pic_pix_fmt; ++ enum AVPixelFormat pic_pix_fmt; + gint pic_width; + gint pic_height; + gint pic_par_n; +@@ -70,7 +70,7 @@ struct _GstFFMpegVidDec + GstBufferPool *internal_pool; + gint pool_width; + gint pool_height; +- enum PixelFormat pool_format; ++ enum AVPixelFormat pool_format; + GstVideoInfo pool_info; + }; + +diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c +index 1df1699..94aca49 100644 +--- a/ext/libav/gstavvidenc.c ++++ b/ext/libav/gstavvidenc.c +@@ -290,7 +290,7 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder, + GstCaps *allowed_caps; + GstCaps *icaps; + GstVideoCodecState *output_format; +- enum PixelFormat pix_fmt; ++ enum AVPixelFormat pix_fmt; + GstFFMpegVidEnc *ffmpegenc = (GstFFMpegVidEnc *) encoder; + GstFFMpegVidEncClass *oclass = + (GstFFMpegVidEncClass *) G_OBJECT_GET_CLASS (ffmpegenc); +diff --git a/ext/libswscale/gstffmpegscale.c b/ext/libswscale/gstffmpegscale.c +index f34259b..62343d0 100644 +--- a/ext/libswscale/gstffmpegscale.c ++++ b/ext/libswscale/gstffmpegscale.c +@@ -45,7 +45,7 @@ typedef struct _GstFFMpegScale + /* state */ + GstVideoInfo in_info, out_info; + +- enum PixelFormat in_pixfmt, out_pixfmt; ++ enum AVPixelFormat in_pixfmt, out_pixfmt; + struct SwsContext *ctx; + + /* property */ +@@ -214,8 +214,8 @@ gst_ffmpegscale_init (GstFFMpegScale * scale) + { + scale->method = DEFAULT_PROP_METHOD; + scale->ctx = NULL; +- scale->in_pixfmt = PIX_FMT_NONE; +- scale->out_pixfmt = PIX_FMT_NONE; ++ scale->in_pixfmt = AV_PIX_FMT_NONE; ++ scale->out_pixfmt = AV_PIX_FMT_NONE; + } + + static void +@@ -226,8 +226,8 @@ gst_ffmpegscale_reset (GstFFMpegScale * scale) + scale->ctx = NULL; + } + +- scale->in_pixfmt = PIX_FMT_NONE; +- scale->out_pixfmt = PIX_FMT_NONE; ++ scale->in_pixfmt = AV_PIX_FMT_NONE; ++ scale->out_pixfmt = AV_PIX_FMT_NONE; + } + + static void +@@ -442,11 +442,11 @@ gst_ffmpegscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps, + + /* Convert a GstCaps (video/raw) to a FFMPEG PixFmt + */ +-static enum PixelFormat ++static enum AVPixelFormat + gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps) + { + GstVideoInfo info; +- enum PixelFormat pix_fmt; ++ enum AVPixelFormat pix_fmt; + + GST_DEBUG ("converting caps %" GST_PTR_FORMAT, caps); + +@@ -455,52 +455,52 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps) + + switch (GST_VIDEO_INFO_FORMAT (&info)) { + case GST_VIDEO_FORMAT_YUY2: +- pix_fmt = PIX_FMT_YUYV422; ++ pix_fmt = AV_PIX_FMT_YUYV422; + break; + case GST_VIDEO_FORMAT_UYVY: +- pix_fmt = PIX_FMT_UYVY422; ++ pix_fmt = AV_PIX_FMT_UYVY422; + break; + case GST_VIDEO_FORMAT_I420: +- pix_fmt = PIX_FMT_YUV420P; ++ pix_fmt = AV_PIX_FMT_YUV420P; + break; + case GST_VIDEO_FORMAT_Y41B: +- pix_fmt = PIX_FMT_YUV411P; ++ pix_fmt = AV_PIX_FMT_YUV411P; + break; + case GST_VIDEO_FORMAT_Y42B: +- pix_fmt = PIX_FMT_YUV422P; ++ pix_fmt = AV_PIX_FMT_YUV422P; + break; + case GST_VIDEO_FORMAT_YUV9: +- pix_fmt = PIX_FMT_YUV410P; ++ pix_fmt = AV_PIX_FMT_YUV410P; + break; + case GST_VIDEO_FORMAT_ARGB: +- pix_fmt = PIX_FMT_ARGB; ++ pix_fmt = AV_PIX_FMT_ARGB; + break; + case GST_VIDEO_FORMAT_RGBA: +- pix_fmt = PIX_FMT_RGBA; ++ pix_fmt = AV_PIX_FMT_RGBA; + break; + case GST_VIDEO_FORMAT_BGRA: +- pix_fmt = PIX_FMT_BGRA; ++ pix_fmt = AV_PIX_FMT_BGRA; + break; + case GST_VIDEO_FORMAT_ABGR: +- pix_fmt = PIX_FMT_ABGR; ++ pix_fmt = AV_PIX_FMT_ABGR; + break; + case GST_VIDEO_FORMAT_BGR: +- pix_fmt = PIX_FMT_BGR24; ++ pix_fmt = AV_PIX_FMT_BGR24; + break; + case GST_VIDEO_FORMAT_RGB: +- pix_fmt = PIX_FMT_RGB24; ++ pix_fmt = AV_PIX_FMT_RGB24; + break; + case GST_VIDEO_FORMAT_RGB16: +- pix_fmt = PIX_FMT_RGB565; ++ pix_fmt = AV_PIX_FMT_RGB565; + break; + case GST_VIDEO_FORMAT_RGB15: +- pix_fmt = PIX_FMT_RGB555; ++ pix_fmt = AV_PIX_FMT_RGB555; + break; + case GST_VIDEO_FORMAT_RGB8P: +- pix_fmt = PIX_FMT_PAL8; ++ pix_fmt = AV_PIX_FMT_PAL8; + break; + default: +- pix_fmt = PIX_FMT_NONE; ++ pix_fmt = AV_PIX_FMT_NONE; + break; + } + return pix_fmt; +@@ -508,7 +508,7 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps) + /* ERROR */ + invalid_caps: + { +- return PIX_FMT_NONE; ++ return AV_PIX_FMT_NONE; + } + } + +@@ -537,8 +537,8 @@ gst_ffmpegscale_set_caps (GstBaseTransform * trans, GstCaps * incaps, + scale->in_pixfmt = gst_ffmpeg_caps_to_pixfmt (incaps); + scale->out_pixfmt = gst_ffmpeg_caps_to_pixfmt (outcaps); + +- if (!ok || scale->in_pixfmt == PIX_FMT_NONE || +- scale->out_pixfmt == PIX_FMT_NONE || ++ if (!ok || scale->in_pixfmt == AV_PIX_FMT_NONE || ++ scale->out_pixfmt == AV_PIX_FMT_NONE || + GST_VIDEO_INFO_FORMAT (&scale->in_info) == GST_VIDEO_FORMAT_UNKNOWN || + GST_VIDEO_INFO_FORMAT (&scale->out_info) == GST_VIDEO_FORMAT_UNKNOWN) + goto refuse_caps; -- cgit v1.2.3-65-gdbad