Merge remote-tracking branch 'origin/0.10'
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 19 Apr 2012 13:37:06 +0000 (15:37 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 19 Apr 2012 13:37:06 +0000 (15:37 +0200)
48 files changed:
ChangeLog
Makefile.am
NEWS
RELEASE
autogen.sh
common
configure.ac
docs/plugins/Makefile.am
docs/plugins/gst-libav-plugins-docs.sgml [moved from docs/plugins/gst-ffmpeg-plugins-docs.sgml with 87% similarity]
docs/plugins/gst-libav-plugins-sections.txt [moved from docs/plugins/gst-ffmpeg-plugins-sections.txt with 100% similarity]
docs/plugins/gst-libav-plugins.args [moved from docs/plugins/gst-ffmpeg-plugins.args with 100% similarity]
docs/plugins/gst-libav-plugins.hierarchy [moved from docs/plugins/gst-ffmpeg-plugins.hierarchy with 100% similarity]
docs/plugins/gst-libav-plugins.interfaces [moved from docs/plugins/gst-ffmpeg-plugins.interfaces with 100% similarity]
docs/plugins/gst-libav-plugins.prerequisites [moved from docs/plugins/gst-ffmpeg-plugins.prerequisites with 100% similarity]
docs/plugins/gst-libav-plugins.signals [moved from docs/plugins/gst-ffmpeg-plugins.signals with 100% similarity]
docs/plugins/gst-libav-plugins.types [moved from docs/plugins/gst-ffmpeg-plugins.types with 100% similarity]
docs/plugins/inspect/plugin-ffmpeg.xml [deleted file]
docs/version.entities.in
ext/Makefile.am
ext/ffmpeg/Makefile.am
ext/ffmpeg/gstffmpeg.c
ext/ffmpeg/gstffmpeg.h
ext/ffmpeg/gstffmpegaudioresample.c
ext/ffmpeg/gstffmpegcfg.c
ext/ffmpeg/gstffmpegcodecmap.c
ext/ffmpeg/gstffmpegcodecmap.h
ext/ffmpeg/gstffmpegdec.c
ext/ffmpeg/gstffmpegdeinterlace.c
ext/ffmpeg/gstffmpegdemux.c
ext/ffmpeg/gstffmpegenc.c
ext/ffmpeg/gstffmpegmux.c
ext/ffmpeg/gstffmpegprotocol.c
ext/ffmpeg/gstffmpegscale.c
ext/ffmpeg/gstffmpegutils.c
ext/ffmpeg/gstffmpegutils.h
ext/libpostproc/Makefile.am
ext/libpostproc/gstpostproc.c
ext/libswscale/Makefile.am
ext/libswscale/gstffmpegscale.c
gst-libav.doap [moved from gst-ffmpeg.doap with 87% similarity]
gst-libav.spec.in [moved from gst-ffmpeg.spec.in with 98% similarity]
gst-libs/ext/Makefile.am
tests/check/Makefile.am
tests/check/elements/avdec_adpcm.c [moved from tests/check/elements/ffdec_adpcm.c with 82% similarity]
tests/check/elements/avdemux_ape.c [moved from tests/check/elements/ffdemux_ape.c with 80% similarity]
tests/check/generic/libavcodec-locking.c
tests/check/generic/plugin-test.c
tests/check/gst-libav.supp [moved from tests/check/gst-ffmpeg.supp with 100% similarity]

index 32086bc..33e2dcd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+=== release 0.11.90 ===
+
+2012-04-13  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * configure.ac:
+         releasing 0.11.90, "Nameless here for evermore"
+
+2012-04-12 19:56:12 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * Makefile.am:
+       * gst-libav.doap:
+         Fix make distcheck
+
+2012-04-12 19:46:24 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * configure.ac:
+         configure: Remove another occurence of ffmpeg
+
+2012-04-12 19:41:52 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * configure.ac:
+       * docs/plugins/Makefile.am:
+       * docs/plugins/gst-ffmpeg-plugins-docs.sgml:
+       * docs/plugins/gst-ffmpeg-plugins-sections.txt:
+       * docs/plugins/gst-ffmpeg-plugins.args:
+       * docs/plugins/gst-ffmpeg-plugins.hierarchy:
+       * docs/plugins/gst-ffmpeg-plugins.interfaces:
+       * docs/plugins/gst-ffmpeg-plugins.prerequisites:
+       * docs/plugins/gst-ffmpeg-plugins.signals:
+       * docs/plugins/gst-ffmpeg-plugins.types:
+       * docs/plugins/gst-libav-plugins-docs.sgml:
+       * docs/plugins/gst-libav-plugins-sections.txt:
+       * docs/plugins/gst-libav-plugins.args:
+       * docs/plugins/gst-libav-plugins.hierarchy:
+       * docs/plugins/gst-libav-plugins.interfaces:
+       * docs/plugins/gst-libav-plugins.prerequisites:
+       * docs/plugins/gst-libav-plugins.signals:
+       * docs/plugins/gst-libav-plugins.types:
+       * docs/plugins/inspect/plugin-ffmpeg.xml:
+       * ext/Makefile.am:
+       * ext/ffmpeg/Makefile.am:
+       * ext/ffmpeg/gstffmpeg.c:
+       * ext/ffmpeg/gstffmpeg.h:
+       * ext/ffmpeg/gstffmpegaudioresample.c:
+       * ext/ffmpeg/gstffmpegcfg.c:
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegcodecmap.h:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+       * ext/ffmpeg/gstffmpegscale.c:
+       * ext/ffmpeg/gstffmpegutils.h:
+       * ext/libpostproc/gstpostproc.c:
+       * ext/libswscale/Makefile.am:
+       * ext/libswscale/gstffmpegscale.c:
+       * gst-ffmpeg.doap:
+       * gst-ffmpeg.spec.in:
+       * gst-libav.doap:
+       * gst-libav.spec.in:
+       * tests/check/Makefile.am:
+       * tests/check/elements/avdec_adpcm.c:
+       * tests/check/elements/avdemux_ape.c:
+       * tests/check/elements/ffdec_adpcm.c:
+       * tests/check/elements/ffdemux_ape.c:
+       * tests/check/generic/libavcodec-locking.c:
+       * tests/check/generic/plugin-test.c:
+       * tests/check/gst-ffmpeg.supp:
+       * tests/check/gst-libav.supp:
+         Rename everything from gst-ffmpeg to gst-libav
+         Also change elements factory names to avenc_*, avdec_*,
+         avmux_* and avdemux_*. The actual filenames, type names,
+         function/variable names are not touched to make merging
+         with 0.10 easier at this point. Once 0.10 is not supported
+         anymore everything should be renamed.
+
+2012-04-12 11:06:22 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * gst-libs/ext/Makefile.am:
+         ffmpeg: Fix make dist
+
+2012-04-10 00:59:24 +0100  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+         ffmpeg: use set_metadata() for generated strings
+         Reverts parts of previous commit.
+
+2012-04-10 00:53:43 +0100  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegaudioresample.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+       * ext/ffmpeg/gstffmpegscale.c:
+       * ext/libpostproc/gstpostproc.c:
+       * ext/libswscale/gstffmpegscale.c:
+         Use new gst_element_class_set_static_metadata()
+
+2012-04-05 18:44:32 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * common:
+         Automatic update of common submodule
+         From 7fda524 to 464fe15
+
+2012-04-05 17:41:11 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpeg.c:
+       * ext/libpostproc/gstpostproc.c:
+       * ext/libswscale/gstffmpegscale.c:
+         gst: Update for GST_PLUGIN_DEFINE() API changes
+
+2012-04-05 13:28:41 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * configure.ac:
+         configure: Update version to 0.11.89.1
+
+2012-04-04 14:48:25 +0200  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * configure.ac:
+       * docs/plugins/Makefile.am:
+       * docs/plugins/gst-ffmpeg-plugins-docs.sgml:
+       * docs/version.entities.in:
+       * ext/ffmpeg/Makefile.am:
+       * ext/libpostproc/Makefile.am:
+       * ext/libswscale/Makefile.am:
+       * gst-ffmpeg.spec.in:
+         ffmpeg: Update versioning
+
+2012-04-03 11:52:05 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: handle DTS/PTS
+         Now that we can know about PTS and DTS on incomming buffers, track them and set
+         the correct output timestamps.
+         We can remove the code to estimate if input buffers have pts or dts.
+
+2012-03-30 18:14:00 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegutils.c:
+         update for buffer api change
+
+2012-03-28 12:50:19 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         update for buffer changes
+
+2012-03-27 16:39:09 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffenc: fix caps handling
+         Avoid copies and leaks
+
+2012-03-26 12:13:46 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Replace master with 0.11
+
+2012-03-22 15:56:32 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * configure.ac:
+         back to development
+
+=== release 0.11.2 ===
+
+2012-03-22 15:53:13 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ChangeLog:
+       * NEWS:
+       * RELEASE:
+       * configure.ac:
+       * gst-ffmpeg.doap:
+         Release 0.11.2
+
+2012-03-22 15:31:40 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         gst-libs/ext/libav
+
+2012-03-21 12:54:44 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * tests/check/generic/libavcodec-locking.c:
+         test: fix unit test
+
+2012-03-19 11:06:40 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: ensure padding is big enough
+
+2012-03-19 10:29:34 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: check if input is already 0-padded
+         When the input buffer is already 0-padded we don't need to copy. This can happen
+         because in the ALLOCATION query we suggest this.
+         Only do temporary padding when we are using a parser.
+
+2012-03-15 22:11:54 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         update for bufferpool changes
+
+2012-03-15 20:39:10 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         update for allocation query changes
+
+2012-03-14 20:04:53 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: propose some padding in the allocation query
+         Hopefully upstream can add some padding and then we don't have to memcpy.
+
+2012-03-14 19:53:06 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         take padding into account
+
+2012-03-14 17:35:28 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: remove unused crop property
+
+2012-03-14 17:33:40 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: remove padding property
+         Users should not mess with this
+
+2012-03-14 12:58:38 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: make bufferpool setup recalculate direct rendering
+         We need to recalculate if we can use direct rendering after we have setup the
+         bufferpool.
+
+2012-03-14 11:53:42 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: add some PERFORMANCE logging
+
+2012-03-13 13:24:39 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffcodec: add voc demuxer
+
+2012-03-13 13:24:23 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         ffdemux: activate pad before setting caps
+
+2012-03-12 13:50:46 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: implement accept-caps
+         Implement a potentially faster accept-caps function
+
+2012-03-11 19:07:31 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/libswscale/gstffmpegscale.c:
+         fix for caps api changes
+
+2012-03-08 13:04:57 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: enable alignment if videometa is allowed
+         Use the videobufferpool when downstream didn't suggest one.
+         Only enable video alignment in the bufferpool when downstream supports video
+         metadata.
+
+2012-03-06 15:27:22 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegmux.c:
+         ffmux: Use correct enum type for return value
+
+2012-03-02 17:27:30 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: Use auto-threads if available, and only slice-threading
+         Slice threading causes less latency (and corruption)
+
+2012-02-27 06:26:02 +0100  Alessandro Decina <alessandro.d@gmail.com>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+       * ext/libswscale/gstffmpegscale.c:
+         Fix compiler warnings
+
+2012-02-22 12:28:49 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/libswscale/gstffmpegscale.c:
+         update for fixate_caps change
+
+2012-02-22 12:14:21 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         codecmap: Add mapping for Indeo 4 video codec
+
+2012-02-22 11:53:35 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * gst-libs/ext/libav:
+         libav: Switch to tracking 0.8 release branch
+
+2012-02-22 02:08:06 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegutils.c:
+         update for new memory api
+
+2012-02-21 18:02:56 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: disable multithreading
+         It causes refcounting problems.
+
+2011-12-11 06:25:23 +0100  Matej Knopp <matej.knopp@gmail.com>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         only reopen decoder when new caps are different
+
+2012-02-17 11:07:33 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * configure.ac:
+         back to development
+
+=== release 0.11.1 ===
+
+2012-02-17 11:07:09 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ChangeLog:
+       * NEWS:
+       * RELEASE:
+       * configure.ac:
+       * gst-ffmpeg.doap:
+         RELEASE 0.11.1
+
+2012-02-08 16:41:19 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+         GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING
+
+2012-02-02 01:36:05 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         Fix for gst_type_find_register() API change
+
+2012-01-25 14:11:17 +0100  Thomas Vander Stichele <thomas (at) apestaart (dot) org>
+
+       * common:
+         Automatic update of common submodule
+         From c463bc0 to 7fda524
+
+2012-01-25 13:14:51 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
+2012-01-25 13:10:07 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * common:
+       * configure.ac:
+         configure: Add --disable-fatal-warnings configure option
+
+2012-01-24 14:40:37 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+         ffmpeg: port to new memory API
+
+2012-01-25 11:39:58 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * common:
+         Automatic update of common submodule
+         From 2a59016 to c463bc0
+
+2012-01-19 11:34:59 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         port to new gthread API
+
+2012-01-18 16:47:51 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * common:
+         Automatic update of common submodule
+         From 0807187 to 2a59016
+
+2012-01-18 10:21:36 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
+2012-01-18 10:05:09 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: Only set get_buffer() function for video
+         Fixes bug #666435.
+
+2012-01-12 18:03:10 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         ffmpegdemux: demote swf demuxer to GST_RANK_NONE
+         SWF doesn't really make sense in our context, don't pretend
+         to support it. People should use a dedicated swf player for that.
+
+2012-01-12 14:57:48 +0000  Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         ffmpegdemux: fix caps leak
+
+2012-01-10 13:41:23 +0100  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+       * ext/ffmpeg/Makefile.am:
+         ffmpeg: fix and extend LIBS in Makefile.am
+         ... to account for -base video helper functions.
+
+2011-01-27 22:25:13 +0100  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+       * configure.ac:
+         configure.ac: improve path handling in out-of-tree build
+         That is, handle the srcdir being given by a relative path as well as
+         an absolute path by using autotools provided absolute path.
+
+2012-01-10 11:49:57 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegmux.c:
+         ffmux: gst_element_class_add_pad_template() takes ownership of the pad template
+
+2012-01-10 11:39:27 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/libpostproc/gstpostproc.c:
+       * gst-libs/ext/libav:
+         ffmpeg: Fix merge mistakes
+
+2012-01-10 11:35:55 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         configure.ac
+         ext/ffmpeg/gstffmpegcodecmap.c
+         ext/ffmpeg/gstffmpegdec.c
+         ext/ffmpeg/gstffmpegdeinterlace.c
+         ext/ffmpeg/gstffmpegmux.c
+         ext/libswscale/gstffmpegscale.c
+
+2012-01-10 10:08:05 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffmpeg: Channel layouts are now set for DTS and (E)AC3 by libav
+
+2012-01-10 11:12:59 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * gst-libs/ext/libav:
+         libav: Update to current GIT master
+
+2012-01-10 11:04:56 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: Give the (E)AC3/DTS decoders a rank of marginal
+         Even if they don't downmix to stereo, they're still working
+         correctly. The only advantage of dtsdec/a52dec is that they
+         downmix to stereo (using the special downmixing matrices) if
+         downstream prefers stereo but in every other case they should
+         be equivalent.
+
+2012-01-10 10:59:57 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: Revert accidentially committed rank change of the (E)AC3/DTS decoders
+
+2012-01-10 10:45:42 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: Reorder audio channels after clipping the audio buffer
+
+2012-01-10 10:37:50 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegcodecmap.h:
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: Correctly reorder audio channels to the GStreamer order if necessary
+
+2012-01-10 10:08:05 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffmpeg: Channel layouts are now set for DTS and (E)AC3 by libav
+
+2012-01-10 10:01:26 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpeg: Use stack-allocated channel positions array
+
+2012-01-09 13:40:05 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffmpeg: Put the new layout field in raw audio caps
+
+2012-01-09 13:24:55 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffdec: Add mappings for the top channel positions
+
+2012-01-09 13:23:29 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffdec: Correctly set the channel-mask and also set it for stereo
+
+2012-01-07 19:56:42 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * configure.ac:
+         configure: require core from git/pre-release
+         For  gst_element_class_add_static_pad_template() which
+         was added only recently.
+
+2012-01-05 14:06:33 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegcodecmap.h:
+         ffmpeg: port to new channel mapping
+
+2012-01-04 19:54:49 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * common:
+         Automatic update of common submodule
+         From 11f0cd5 to 0807187
+
+2012-01-04 10:17:01 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * tests/check/elements/ffdec_adpcm.c:
+       * tests/check/elements/ffdemux_ape.c:
+       * tests/check/generic/libavcodec-locking.c:
+         tests: make tests compile
+
+2012-01-03 15:27:54 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+         GST_FLOW_UNEXPECTED -> GST_FLOW_EOS
+
+2011-12-21 23:52:00 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/libpostproc/gstpostproc.c:
+         update for videofilter changes
+
+2011-12-21 18:06:32 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: fill in the stride alignment
+         Copy the stride alignment we got from ffmpeg to the alignment structure.
+
+2011-12-19 18:14:27 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: update for new interlace fields
+
+2011-12-15 14:28:00 +0000  Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegmux.c:
+         ffmpeg: port to GstCollectPads2
+
+2011-11-08 18:56:54 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: Report latency if B-frames are present
+         ... and cleanup the query handler while we're at it
+         https://bugzilla.gnome.org/show_bug.cgi?id=663616
+
+2011-11-28 13:23:42 +0000  Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegaudioresample.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+       * ext/ffmpeg/gstffmpegscale.c:
+       * ext/libpostproc/gstpostproc.c:
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpeg: fix pad template ref leaks
+         https://bugzilla.gnome.org/show_bug.cgi?id=662664
+
+2011-11-26 15:39:40 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+         Merge remote-tracking branch 'origin/master' into 0.11
+
+2011-11-24 00:41:27 +0100  Matej Knopp <matej.knopp@gmail.com>
+
+       * ext/ffmpeg/gstffmpegutils.c:
+         Fix cpu cores detection on OS X
+         https://bugzilla.gnome.org/show_bug.cgi?id=664687
+
+2011-11-24 00:41:27 +0100  Matej Knopp <matej.knopp@gmail.com>
+
+       * ext/ffmpeg/gstffmpegutils.c:
+         Fix cpu cores detection on OS X
+         https://bugzilla.gnome.org/show_bug.cgi?id=664687
+
+2011-11-21 13:36:34 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         update for activation changes
+
+2011-11-18 18:00:59 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         update for new scheduling query
+
+2011-11-18 13:59:59 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         add parent to activate functions
+
+2011-11-17 12:49:33 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+       * ext/libswscale/gstffmpegscale.c:
+         add parent to pad functions
+
+2011-11-17 08:25:48 +0100  Stefan Sauer <ensonic@users.sf.net>
+
+       * ext/ffmpeg/gstffmpegmux.c:
+         collectpads: port API changes
+
+2011-11-16 17:29:22 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+         add parent to query function
+
+2011-11-15 17:55:29 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         _query_peer_*() -> _peer_query_*()
+
+2011-11-15 17:23:21 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         _peer_get_caps() -> _peer_query_caps()
+
+2011-11-15 16:35:17 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffmpeg: change getcaps to query
+
+2011-11-10 18:25:21 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         update for adapter api change
+
+2011-11-09 11:58:15 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         remove query types
+
+2011-11-04 16:23:32 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: get the pixfmt correctly
+         Use the pixfmt from the passed context, which can be different from our other
+         context and which might not have the pixfmt set correctly.
+
+2011-11-04 12:43:17 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+         ffmpeg: fix template to %u
+
+2011-11-04 11:02:32 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         configure.ac
+
+2011-11-04 10:15:32 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * tests/check/elements/ffdemux_ape.c:
+         tests: Fix for pad probe API change
+
+2011-11-02 17:47:40 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
+
+         Merge remote-tracking branch 'origin/0.10.13'
+
 === release 0.10.13 ===
 
-2011-11-02  Edward Hervey <edward.hervey@collabora.co.uk>
+2011-11-02 17:26:54 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
 
+       * ChangeLog:
+       * NEWS:
+       * RELEASE:
        * configure.ac:
-         releasing 0.10.13, "Speeding, sparks like lightning"
+       * gst-ffmpeg.doap:
+         0.10.13 Release "Speeding, sparks like lightning"
+
+2011-11-02 12:10:25 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         tags: update for tag API removal
+
+2011-11-02 10:31:57 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
+2011-10-29 09:27:46 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         demux: update for new task api
+
+2011-10-29 09:11:53 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+         structure: fix for api upate
+
+2011-10-31 14:53:01 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+         Merge remote-tracking branch 'origin/master' into 0.11
+
+2011-10-31 11:47:10 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * configure.ac:
+         configure.ac: Remove --enable-postproc from the default flags
+         fixes previous patch
 
 2011-10-31 11:40:37 +0100  Edward Hervey <edward.hervey@collabora.co.uk>
 
-       * configure.ac:
-         0.10.12.3 pre-release
+       * configure.ac:
+         0.10.12.3 pre-release
+
+2011-07-05 21:35:46 +0300  Martin Storsjo <martin@martin.st>
+
+       * configure.ac:
+       * ext/Makefile.am:
+       * ext/ffmpeg/gstffmpeg.c:
+       * ext/libswscale/gstffmpegscale.c:
+         Allow building a LGPL only gst-ffmpeg plugin
+         This removes --enable-gpl and --enable-postproc from the
+         ffmpeg configure line, and disables building the postproc
+         gstreamer plugin.
+         https://bugzilla.gnome.org/show_bug.cgi?id=654037
+         Conflicts:
+         configure.ac
+
+2011-10-10 23:56:04 +0100  Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffmpegenc: Pass the size of the output buffer to avcodec_encode_audio
+         avcodec_encode_audio is documented as taking the size of the output
+         buffer not the size of the input buffer.  This fixes the use of the G722
+         encoder and makes the code more consistent with avconv from the libav
+         source tree.
+
+2011-10-10 22:04:48 +0100  Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffmpegcodecmap: Further specify allowed rates for G722 and G726
+
+2011-10-10 14:50:09 +0100  Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffmpegcodecmap: Always restrict audio codec in the unfixed cases
+         If the context isn't fixed yet or if it doesn't exist then always
+         restrict the caps.
+         Also restrict the maximum channels for G726 and G722 to 1 channel
+
+2011-07-05 21:35:46 +0300  Martin Storsjo <martin@martin.st>
+
+       * configure.ac:
+       * ext/Makefile.am:
+       * ext/ffmpeg/gstffmpeg.c:
+       * ext/libswscale/gstffmpegscale.c:
+         Allow building a LGPL only gst-ffmpeg plugin
+         This removes --enable-gpl and --enable-postproc from the
+         ffmpeg configure line, and disables building the postproc
+         gstreamer plugin.
+         https://bugzilla.gnome.org/show_bug.cgi?id=654037
+
+2011-10-30 12:23:51 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * tests/check/Makefile.am:
+       * tests/check/elements/ffdec_adpcm.c:
+       * tests/check/elements/ffdemux_ape.c:
+       * tests/check/generic/libavcodec-locking.c:
+         tests: port to 0.11
+         Some still fail though, for various reasons. ffmpeg warning:
+         "get_buffer() cannot be called after ff_thread_finish_setup()".
+
+2011-10-30 12:03:36 +0000  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         ffmpegdemux: update for taglist API changes
+
+2011-10-28 16:35:54 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+         fix compilation with new caps api
+
+2011-10-27 16:47:18 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffenc: fix compilation
 
-2011-07-05 21:35:46 +0300  Martin Storsjo <martin@martin.st>
+2011-10-27 16:31:30 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
 
-       * configure.ac:
-       * ext/Makefile.am:
-       * ext/ffmpeg/gstffmpeg.c:
-       * ext/libswscale/gstffmpegscale.c:
-         Allow building a LGPL only gst-ffmpeg plugin
-         This removes --enable-gpl and --enable-postproc from the
-         ffmpeg configure line, and disables building the postproc
-         gstreamer plugin.
-         https://bugzilla.gnome.org/show_bug.cgi?id=654037
+         Merge branch 'master' into 0.11
          Conflicts:
-         configure.ac
+         ext/ffmpeg/gstffmpegcodecmap.c
 
 2011-10-10 23:56:04 +0100  Sjoerd Simons <sjoerd.simons@collabora.co.uk>
 
        * gst-libs/ext/libav:
          libav: Update to v0.7.2 release
 
+2011-10-17 16:29:10 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+         Merge remote-tracking branch 'origin/master' into 0.11
+
+2011-10-17 16:27:36 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         gstffmpegdec: Re-enable MT-decoding by default
+
+2011-10-17 16:26:52 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegutils.h:
+         gstffmpegutils: Fix include
+
+2011-10-17 16:26:20 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * configure.ac:
+         configure.ac: Fix for new libav
+
+2011-10-17 16:02:51 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * gst-libs/ext/libav:
+         libav: Switch to current git master
+
+2011-10-11 14:02:53 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         gstffmpegcodecmap: Avoid string operations on NULL
+
+2011-10-03 11:34:34 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         dec: remove interlaced update code
+
+2011-10-03 11:32:24 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
 2011-08-29 15:18:39 +0100  Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
 
        * ext/ffmpeg/gstffmpegdec.c:
          interlaced flag once we know.
          https://bugzilla.gnome.org/show_bug.cgi?id=656155
 
+2011-09-28 13:29:08 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         configure.ac
+         ext/ffmpeg/gstffmpegcodecmap.c
+         ext/ffmpeg/gstffmpegdeinterlace.c
+
 2011-09-01 16:46:47 +0100  Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
 
        * ext/ffmpeg/gstffmpegdec.c:
          Automatic update of common submodule
          From 605cd9a to a39eb83
 
+2011-09-06 15:29:26 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         ffmpeg: fix for audio caps change
+
 2011-09-02 16:25:16 -0400  Nicolas Dufresne <nicolas.dufresne@collabora.com>
 
        * ext/ffmpeg/gstffmpegdec.c:
        * configure.ac:
          configure: back to development
 
+2011-08-25 16:41:36 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: port to new flags
+
+2011-08-22 13:33:31 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpeg: convert to new caps
+
+2011-08-19 18:33:11 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegaudioresample.c:
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+         ffmpeg: port to new audio caps
+
+2011-08-05 12:04:13 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: react to the reconfigure event
+         Also renegotiate the caps and bufferpool when we have a rereconfigure event
+         pending.
+
+2011-08-04 11:10:26 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: ensure bufferpool size
+         Make sure the bufferpool size is at least what we expect.
+         Add some more debug.
+
+2011-08-01 18:10:53 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: enable direct rendering for all formats
+         Since we now support padding, we can enable direct rendering for all formats.
+
+2011-08-01 17:57:38 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: add alignment support
+         Always diable EMU_EDGE. Use the bufferpool options to enable extra padding on
+         allocated frames. If the downstream bufferpool does not support the padding,
+         disable direct rendering and do the final copy/cropping into the non-padded
+         output frame.
+
+2011-07-29 13:40:30 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: refactor picture fill code
+         Make a method to hold the code to convert a GstVideoFrame to an AVFrame so that
+         we can reuse it in the non-direct rendering case.
+
+2011-07-29 13:08:53 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: cleanups
+         Make things a little more readable.
+
+2011-07-29 12:36:12 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: use video frame helpers
+         Use the video frame helper functions to map and set up the strides in the
+         picture for ffmpeg.
+
+2011-07-29 12:34:04 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: fix for query API change
+
+2011-07-29 12:32:45 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+         ffmpeg: fix for query API changes
+
+2011-07-29 10:57:20 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: remove unused variable
+
+2011-07-29 10:31:03 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpeg: First set of cleanups
+         Store incomming info from the caps, current context and output formats into
+         separate variables so that we can more easily handle them.
+         Refactor the negotiation code.
+         Rework the bufferpool setup code. Take into account that we might want to
+         negotiate extra borders around the image in direct rendering.
+         Remove some of the cropping code for now.
+
+2011-07-29 10:25:03 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegcodecmap.h:
+         ffmpeg: add GstVideoFormat helper function
+         Add a function to convert an ffmpeg pixfmt to a GStreamer GstVideoFormat.
+
+2011-07-28 11:38:27 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: cleanups
+         Remove useless switch
+         Remove old EXTRA_REF define
+         Move errors out of the main code path
+
+2011-07-28 10:50:01 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: small cleanups
+         USe gst_pad_peer_query() to forward the query to the peer.
+
+2011-07-22 17:54:32 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         configure.ac
+         ext/ffmpeg/gstffmpegcodecmap.c
+
 === release 0.10.12 ===
 
 2011-07-20 12:14:45 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
          decoder and decoding will fail.
          Fixes bug #652812.
 
+2011-07-15 12:34:19 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
 2011-07-12 18:36:35 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
 
        * gst-libs/ext/libav:
          remove -Wcast-align
          See: https://bugzilla.gnome.org/show_bug.cgi?id=615698
 
+2011-07-07 18:52:23 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * configure.ac:
+         remove -Wcast-align
+         See: https://bugzilla.gnome.org/show_bug.cgi?id=615698
+
+2011-07-07 13:50:18 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         configure.ac
+         ext/ffmpeg/gstffmpegdec.c
+
+2011-07-05 10:42:56 +0100  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpegscale: add cast to fix compiler warning
+
+2011-07-05 10:39:52 +0100  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpegscale: update for GstVideoInfo API changes
+
+2011-07-05 10:34:24 +0100  Tim-Philipp Müller <tim.muller@collabora.co.uk>
+
+       * configure.ac:
+         Add -DGST_USE_UNSTABLE_API to the compiler flags to avoid warnings
+
 2011-06-30 21:38:57 +0200  Edward Hervey <bilboed@bilboed.com>
 
        * ext/ffmpeg/gstffmpegdec.c:
          ... by _init'ing them as locals rather than _new'ing them.
          Fixes #653648.
 
+2011-06-30 09:21:31 +0200  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffmpegenc: handle filter caps in _getcaps
+
+2011-06-30 09:20:11 +0200  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffmpegenc: properly handle caps event
+         ... which comes down to unconditionally eating incoming caps event,
+         since that one could never correctly describe the setup for downstream
+         elements.
+
+2011-06-30 09:18:42 +0200  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffmpegenc: ensure properly negotiated prior to processing
+         Doing so is even more pertinent in 0.11, since core assists much less
+         in setting up negotiation and feedback on handling caps event is more likely
+         to get lost.
+
+2011-06-29 11:44:27 +0200  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: unref eaten caps event
+
+2011-06-29 11:44:11 +0200  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffmpegdec: unref allocation query
+
 2011-06-25 13:05:41 +0200  Edward Hervey <bilboed@bilboed.com>
 
        * configure.ac:
          the ffmpeg worker thread count to match the computer processor
          count by default.
 
+2011-06-20 11:57:29 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+         ffmpeg: port to new caps
+
+2011-06-20 11:29:10 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/libswscale/gstffmpegscale.c:
+         swscale: port to new video API
+
+2011-06-20 10:42:30 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/libpostproc/gstpostproc.c:
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpeg: fix some caps
+
+2011-06-13 16:34:18 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegutils.c:
+         utils: update for buffer API change
+
+2011-06-11 18:55:05 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: update for bufferpool API change
+
+2011-06-10 18:07:28 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: small cleanups
+         We can use or to calculate the max alignment
+
+2011-06-10 17:56:27 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         dec: fix for new alignment values
+
+2011-06-10 17:56:01 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdemux.c:
+         ffdemux: fix for API change of flush_start
+
+2011-06-08 18:04:38 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
+2011-06-08 18:04:07 +0200  Edward Hervey <edward.hervey@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+         ext: caps are now set via GstEvent and not setcaps
+
 2011-06-02 18:02:38 +0300  Raimo Järvi <raimo.jarvi@gmail.com>
 
        * ext/ffmpeg/gstffmpegdec.c:
          ffdec: Fix calculating frame duration from last timestamp and frame count.
          Fixes bug #651714.
 
+2011-06-02 18:39:07 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: use caps event instead of setcaps
+
+2011-06-02 17:03:21 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
+2011-06-02 16:23:19 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+       * ext/ffmpeg/gstffmpegutils.c:
+       * ext/ffmpeg/gstffmpegutils.h:
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpeg: port to new API
+
 2011-05-31 13:16:26 +0300  Raimo Järvi <raimo.jarvi@gmail.com>
 
        * ext/ffmpeg/gstffmpegdec.c:
          --extra-cflags='-mfpu=neon -mfloat-abi=softfp'".
          Fixes bug #648816.
 
+2011-05-02 11:12:10 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         ffdec: fix for ALLOCATION query API changes
+
+2011-04-29 18:40:36 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         configure.ac
+         ext/ffmpeg/gstffmpegdec.c
+
+2011-04-29 18:35:55 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+         ffmpeg: use bufferpool instead of pad_alloc
+
 2011-04-24 14:05:34 +0100  Tim-Philipp Müller <tim.muller@collabora.co.uk>
 
        * common:
        * gst-libs/ext/libav:
          ext: Add libav as a git submodule
 
+2011-04-19 19:04:36 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpeg_use G_DEFINE_TYPE
+
+2011-04-19 19:03:06 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
 2011-04-19 16:26:55 +0200  Marc Plano-Lesay <marc.planolesay@gmail.com>
 
        * ext/ffmpeg/gstffmpegdec.c:
          ffmpeg: don't divide by 0 when checking the framerates
          Check for denom==0 first and set it to on in that case.
 
+2011-04-07 12:38:01 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         ext/ffmpeg/gstffmpegdec.c
+
+2011-04-07 12:37:09 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * common:
+         common: recommit to updated version
+
 2011-04-07 12:34:51 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
 
        * ext/ffmpeg/gstffmpegdec.c:
          before pushing will always end up with a copy and that makes the sink do a slow
          memcpy all the time.
 
+2011-04-07 12:11:37 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         ext/ffmpeg/gstffmpegdec.c
+
+2011-04-07 12:02:57 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegdec.c:
+         dec: Fixes
+         Set caps on buffers right after we allocate them to avoid refcounting problems
+         and having to make the buffer metadata writable for no good reason.
+         Don't unmap the memory with a 0 size or we would modify the memory size when
+         it's not needed.
+
 2011-04-04 16:37:42 +0200  Miguel Angel Cabrera Moya <madmac2501@gmail.com>
 
        * ext/ffmpeg/gstffmpegdec.c:
          Automatic update of common submodule
          From 1ccbe09 to c3cafe1
 
+2011-04-04 13:18:13 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegaudioresample.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegdeinterlace.c:
+       * ext/ffmpeg/gstffmpegdemux.c:
+       * ext/ffmpeg/gstffmpegmux.c:
+       * ext/libpostproc/gstpostproc.c:
+       * ext/libswscale/gstffmpegscale.c:
+         ffmpeg: port to new memory API
+
+2011-04-04 12:24:03 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
+2011-04-04 12:23:05 +0200  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+       * ext/ffmpeg/gstffmpegdec.c:
+       * ext/ffmpeg/gstffmpegenc.c:
+       * ext/ffmpeg/gstffmpegprotocol.c:
+       * ext/ffmpeg/gstffmpegutils.c:
+         WIP: porting to 0.11
+
 2011-03-25 22:35:11 +0100  Sebastian Dröge <sebastian.droege@collabora.co.uk>
 
        * common:
        * autogen.sh:
          autogen: wingo signed comment
 
+2011-03-04 14:00:28 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+
 2011-01-23 14:43:26 +0100  Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
 
        * configure.ac:
          Automatic update of common submodule
          From 1de7f6a to 6aec6b9
 
+2011-02-28 10:37:34 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/Makefile.am:
+       * ext/ffmpeg/gstffmpeg.c:
+         ffmpeg: disable resample
+
+2011-02-26 15:09:43 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c:
+         codecmap: use new g_value getters
+
+2011-02-28 12:12:51 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+         Merge branch 'master' into 0.11
+         Conflicts:
+         configure.ac
+
 2011-02-10 12:00:11 +0100  Julien Isorce <julien.isorce@gmail.com>
 
        * ext/libswscale/gstffmpegscale.c:
          is set on input buffers. Only do this when there are no reordered input
          timestamps. Improves interpolation in DTS mode when no input duration is set.
 
+2010-12-06 12:32:41 +0100  Wim Taymans <wim.taymans@collabora.co.uk>
+
+       * configure.ac:
+         configure: open 0.11 branch
+
 2010-10-27 13:17:43 +0100  Jan Schmidt <thaytan@noraisin.net>
 
        * common:
index de80f09..cf31a9c 100644 (file)
@@ -1,15 +1,15 @@
 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
 
 COMMON_SUBDIRS = ext docs common tests
-SUBDIRS = $(FFMPEG_SUBDIRS) $(COMMON_SUBDIRS)
+SUBDIRS = $(LIBAV_SUBDIRS) $(COMMON_SUBDIRS)
 DIST_SUBDIRS = $(COMMON_SUBDIRS) gst-libs
 
 # include before EXTRA_DIST for win32 assignment
 include $(top_srcdir)/common/win32.mak
 
 EXTRA_DIST = \
-       gst-ffmpeg.spec depcomp autogen.sh \
-       AUTHORS COPYING NEWS README ChangeLog gst-ffmpeg.doap \
+       gst-libav.spec depcomp autogen.sh \
+       AUTHORS COPYING NEWS README ChangeLog gst-libav.doap \
        $(win32)
 
 ACLOCAL_AMFLAGS = -I m4 -I common/m4
diff --git a/NEWS b/NEWS
index edb97a8..86c75b4 100644 (file)
--- a/NEWS
+++ b/NEWS
-This is GStreamer FFmpeg Plug-ins  0.10.13, "Speeding, sparks like lightning"
+This is GStreamer libav Plug-ins 0.11.90 "Nameless here for evermore" 
 
-Changes since 0.10.12:
+New in 0.11.90:
 
-      * Use libav 0.7.2 internal branch for security fixes
-      * Fixes for handling FLAC 
-      * Post QoS messages when dropping 
-      * Properly report GPL or LGPL licensing
+      * Lots of bugfixes, cleanup and other improvements
+      * Renamed from gst-ffmpeg to libav, also all element factory names now start with an 'av' prefix instead of 'ff'
+      * Handle difference between DTS/PTS properly
 
-Bugs fixed since 0.10.12:
+New in 0.11.2:
 
-      * 566605 : Support the new ffmpeg metadata API
-      * 574661 : [gstffmpegdec] Wrong usage of parsers
-      * 608892 : DCA/AAC/AC-3 decoders broken in gst-ffmpeg
-      * 532779 : ffmpeg configured with options leading to GPL license
-      * 589361 : [ffdec_flac] extradata NULL or too small error
-      * 640012 : ffmpegdec outputs wrong timestamps
-      * 643591 : ffmpegdec: invalid timestamp being used for next timestamp calculation
-      * 651768 : [PATCH] Arm cross compile fail (Failed to configure embedded FFmpeg tree)
-      * 654634 : postproc: gst-inspect-0.10 -a aborts with gstpostproc.c:360:change_mode: assertion failed: (postproc- > mode)
-      * 656155 : ffdec_mpeg2video and interlace property
-      * 656328 : [ffdeinterlace] add automatic " mode " property
-      * 657950 : ffmpegdec: post QoS messages when dropping a frame
-      * 658019 : ffdec_ass: caps seems wrong
+      * Many cleanups
+      * Ported to new 0.11 core API changes
+      * Disable ffmpeg multithreading
+      * Add support for the VOC format
+      * Improve memory allocation
+      * Optimize for 0-padded input buffers
 
-Changes since 0.10.11:
+Bugs fixed in this release
 
-      * Bump to LibAV 0.7
-      * Timestamp tracking fixes
-      * New codecs
-      * Multi-threaded decoding
+      * 664687 : CPU count detection fails on OS X
 
-Bugs fixed since 0.10.11:
+New in 0.11.1:
 
-      * 595590 : Conditional jump or move depends on uninitialised 
-value in ff_h264_find_frame_end
-      * 611500 : [regression] Wrong outgoing timestamps
-      * 613901 : No support for PIX_FMT_YUVA420P, prevents vp6a 
-decoding
-      * 629648 : ffenc_dvdsub wrongly categorized as audio encoder
-      * 631075 : RTP based decoding degrades over time
-      * 632691 : [ffenc_ac3] does not support changing the number of 
-channels on the fly
-      * 632877 : [ffdec_h264] always outputs same timestamp
-      * 639681 : [ffdec_wmv3] regression: video very unsmooth with 
-various mms streams
-      * 639993 : h.263+ support is broken
-      * 642015 : [ffvideoscale] add support for UYVY
-      * 642507 : [mingw/cygwin build] ensure building of plugin dll
-      * 646838 : ffdec_h264 fail to decode some stream
-      * 648816 : [compile] with-ffmpeg-extra-configure passes incorrect 
-cflags
-      * 649297 : regression: ffdemux_ape fails with 
-gst_ffmpegdata_open: assertion `GST_PAD_IS_SRC (pad)' failed
-      * 649372 : ffdec: make the time threshold to skip to next 
-keyframe configurable
-      * 650596 : ffenc_aac needs AAC profile support in caps
-      * 650695 : Patch adds LATM/LOAS support to codecmap and make 
-distinction between ADTS and LATM/LOAS
-      * 651447 : [ffdec_aac] Add mpegversion 2 to caps
-      * 651625 : [ffdec] Check for AV_NOPTS_VALUE in PTS
-      * 651714 : [ffdec] Fix calculating frame duration from last 
-timestamp and frame count
-      * 652812 : Don't create dummy extradata for AAC LATM
-      * 653648 : [ffmpegdec] allocates and leaks avpacket helper 
-structs
-      * 653649 : [ffmpegdec] complains in basic encoding / decoding 
-pipeline
-      * 653717 : [ffmpegdec] wrong audio template src caps
-
-Changes since 0.10.10:
-
-      * Synced to FFmpeg 0.6 branch
-      * Add mappings for all new codecs
-      * encoders: proxy downstream width/height/framerate
-      * encoders: Fix timestamps
-
-Bugs fixed since 0.10.10:
-
-      * 566250 : [ffdec_aac] Crash in gst_ffmpegdec_audio_frame
-      * 613231 : [ffdec] Aspect ratio change is not detected
-      * 622736 : [ffdeinterlace] [PATCH] Set the 'interlaced' field to FALSE in the source pad's caps
-      * 622773 : Encourage people to not use ffmpeg muxers
-      * 623388 : [audio encoders] Wrong output timestamps when receiving big input buffers
-      * 623671 : Various klass/description/rank fixes
-
-Changes since 0.10.9:
-
-      * Update to revision 21874 of ffmpeg (Feb 18th 2010)
-      * Various fixes for encoders
-      * Faster plugin/element creation
-      * Fix duration of out-of-order buffers
-
-Bugs fixed since 0.10.9:
-
-      * 610613 : a vp6 flv file crashes totem and pitivi
-      * 330681 : [real] RV20 video garbled
-      * 361177 : Need WMS decoder
-      * 578160 : ffenc_h263 doesn't list the resolutions it actually supports
-      * 593647 : ffdec_flashsv doesn't work
-      * 593651 : buffer-size property of ffenc_* is a cop-out
-      * 601421 : [fixed upstream] WMA9 support
-      * 601501 : [ffdec_vc1] Fails to decode some VC1 streams that work with mplayer
-      * 603331 : Feature request: intel indeo 4 & 5 codec support
-      * 610469 : flv file doesn't play in totem
-      * 610481 : [ffmpegdec] wrong output timestamps when non-keyframe following flush
-      * 611398 : [regression] outgoing buffer durations aren't correct
-      * 611722 : [regression] No decoder for video/x-wmv, wmvversion=(int)3, format=(fourcc)WMVA
-      * 611782 : [regression] Segmentation fault in demuxers
-
-Changes since 0.10.8:
-    
-      * Update FFmpeg snapshot to SVN 19580 on the 0.5 branch
-      * Improve tag passing
-      * Track timestamps and frame delay for improved timestamping
-      * Support 4khz ADPCM and g.721
-
-Bugs fixed since 0.10.8:
-     
-      * 574661 : [gstffmpegdec] Wrong usage of parsers
-      * 575545 : [gstffmpegenc] Wrong usage of AVCodec.pix_fmts
-      * 578278 : gst-ffmpeg: assign offsets (from upstream) to outgoing buffers
-      * 586894 : distclean removes gst-libs/ext/ffmpeg
-      * 586957 : [ffdemux_ape] APE file metadata not retained during transcode
-      * 588546 : Add AC3 audio codec to DVD Muxer
-      * 590172 : ffdec_theora does not work
-      * 590964 : Varying licensing in COPYING file in release tarballs
-      * 591038 : Colorspace error during negotiation in ffenc_mjpeg
-      * 591163 : Duration calculation is wrong for codecs with ticks_per_frame != 1
-      * 591469 : gst-ffmpeg won't build
-      * 591809 : [ffdec_adpcm_ima_wav] can't decode ADPCM file
-      * 593141 : Add AG_GST_ARG_WITH_PKG_CONFIG_PATH to configure
-      * 594306 : ffdec_* sets channel-positions for common mono and stereo cases
-      * 594454 : gstreamer does not support adpcm, g721  audio file ?
-
-Changes since 0.10.7:
-    
-      * Ability to force key-frames in video encoders
-      * Better timestamp handling in decoders
-      * Improved muxer wrapping
-      * Code cleanups and refactoring
-
-Bugs fixed since 0.10.7:
-     
-      * 570815 : ffmenc_mpeg4 allows its bitrate property to be changed wi...
-      * 574728 : Use new interlaced support from -base
-      * 575678 : [ffmux] Set caps on the srcpad / output buffers
-      * 575715 : [ffenc_h263] Properties
-      * 576126 : av_iformat_next and av_oformat_next compile errors using ...
-      * 577879 : Bad check in configure.ac
-      * 578278 : gst-ffmpeg: assign offsets (from upstream) to outgoing bu...
-      * 580796 : [ffmpegdec] out-of-order timestamps
-      * 580810 : Stuttering and crash with some H.264 files
-      * 581009 : gst-ffmpeg needs presets support
-      * 585845 : 0.10.7.2 breaks swfdec
-      * 587297 : build failure on macosx
-      * 575709 : Request a key frame
-      * 584291 : Cannot create elements after calling  gst_update_registry
-      * 584399 : FFmpeg libraries are included in incorrect order when ext...
-
-Changes since 0.10.6:
-
-      * Update to ffmpeg 0.5 release
-      * Support channel layouts for multichannel audio
-      * Add mappings for new codecs: Real Video 3.0, EAC3, QCELP, IMC,
-        MLP and more
-      * Support push-based demuxers
-      * Expose preload and maxdelay muxer properties
-
-Bugs fixed since 0.10.6:
-     
-      * 573400 : [gstffmpegdec] crashes with hardware-accelerated decoders.
-      * 575759 : Regression in framerates
-      * 392534 : ffdemux enhancement: push based scheduling
-      * 548002 : libavcodec doesn't provide audio channel mappings
-      * 560644 : ffmpegdec leaks memory when gst_ffmpegdec_open is not called
-      * 563305 : gst-ffmpeg 0.10.6 build from tarball fails
-      * 564867 : Killing the gst-ffmpeg dependency on libbz2
-      * 565269 : GStreamer can't play newset Terminator: Salvation HD 1080...
-      * 566647 : [ffenc_amr_*] wrong number of channels and wrong samplera...
-      * 567336 : Text file detected as VC1 video
-      * 569441 : Use AVCodec.sample_fmts for list of compatible sample for...
-      * 570975 : Enable DVD Muxer
-      * 572863 : ffmpeg requires 128bit-aligned buffers.
-      * 573649 : Buffer overflow in gst gstffmpegaudioresample
-      * 574663 : [gstffcodecmap] Unused codec mapping for ATRAC3 codec
-      * 574746 : Disable external library decoders/encoders
-      * 574814 : Bogus muxer/demuxer/typefind are exposed
-      * 575664 : ffmux_amr disappeared
-      * 566250 : [ffdec_aac] Crash in gst_ffmpegdec_audio_frame
-
-Changes since 0.10.5:
-    
-      * Update ffmpeg and libswscale snapshot
-      * Prefer aspect ratios prescribed by the container over the codec
-      * Improve ffmpeg encoders wrapping
-      * Rewrite ffvideoscale to use libswscale
-      * Improve H.264 wrapping
-
-Bugs fixed since 0.10.5:
-     
-      * 350738 : [ffvideoscale] GStreamer-Critical when pixel-aspects-rati...
-      * 504056 : [ffvideoscale] Switch to using libswscale
-      * 542216 : cross compilation and mingw32 support
-      * 548304 : missing check for bz2 library and header
-      * 551046 : gst-ffmpeg configure complains about libz2, should be libbz2
-      * 556336 : [PATCH] gstffmpegdec.c: prefer demuxer's pixel aspect rat...
-      * 556405 : gst-ffmpeg fails to build against 20081014 ffmpeg snapshot
-      * 560137 : Two build fixes for using system ffmpeg
-      * 560305 : x264enc & ffmux_* doesnt link
-
-Changes since 0.10.4:
-
-      * Updated to upstream ffmpeg revision r15004 (28th Aug 2008)
-
-Bugs fixed since 0.10.4:
-
-      * 371939 : mov/mp4/m4a/3gp/3g2 muxers create wrong durations
-      * 383420 : [ffmpeg] ISO-derivative muxers don't handle audio correctly
-      * 518705 : Can't play streams from Rai.it
-      * 533708 : broken mpeg-ts typefinding?
-      * 534371 : autogen.sh not dist'ed
-      * 534390 : Patch: use av_picture_copy instead of swscale to copy pic...
-      * 534392 : PATCH: never use ffdec_faad
-      * 534783 : Remove FLV demuxer
-      * 540401 : Garbled sound instead of music
-      * 549799 : all audio codecs claim to support up to 6 channels
-
-Changes since 0.10.3:
-    
-      * New build system based on direct upstream FFmpeg svn
-      * Much newer FFmpeg with more decoders
-      * New ffaudioresample element
-      * Better timestamp handling
-      * Basic reverse playback
-      * New codecs wrapped
-
-Bugs fixed since 0.10.3:
-
-      * 504056 : [ffvideoscale] Switch to using libswscale
-      * 488913 : Move to a saner ffmpeg checkout system
-      * 321662 : reenable our get_buffer function in gst-ffmpeg
-      * 334707 : ffmpeg reads past the end of data passed to it
-      * 337866 : [ffmpeg] timestamps wrong
-      * 338989 : [ffenc_mjpeg] Creates garbled content
-      * 359965 : ffenc_huffyuv broken
-      * 394208 : Compile Error on Intel Mac OS X
-      * 421068 : ffenc_h263p -- missing options
-      * 427082 : [fixed upstream] totem crashes when trying to play an .AIF
-      * 449420 : [fixed upstream] [FLV] Incorrect FLV frame sizes
-      * 467121 : [fixed upstream] WVC1 codec
-      * 482660 : h264 playback is not smooth
-      * 496127 : [deinterlace/scale/postproc] support for non-I420 colorsp...
-      * 503249 : Add GIF support
-      * 503733 : PATCH: stop gst-inspect --print-all from crashing when gs...
-      * 510745 : Add musepack sv7 support
-      * 510985 : Don't register typefinders for which we have replacements...
-      * 511011 : gst-ffmpeg autogen.sh not checking for subversion presence
-      * 511476 : Missing codec inside gstffmpegcodecmap.c
-      * 515205 : Dubious .flv file crashes totem
-      * 515811 : add debug-mv property to ffdec_*
-      * 518033 : Add Monkey's Audio (APE) support
-      * 519235 : make clean twice produces some error messages
-      * 528082 : [ffmpeg] compile error
-      * 529015 : Port from deprecated img_convert to swscale
-      * 531857 : Can't play WVC1 videos
-      * 532803 : Doesn't build properly with system ffmpeg
-     
-Changes since 0.10.2:
-    
-      * Memory usage fixes
-      * Playback and seeking fixes
-      * Improved QOS support
-      * Parallel installability with 0.8.x series
+      * Parallel installability with 0.10.x series
       * Threadsafe design and API
+      * Many cleanups
+      * Ported to new 0.11 core API changes
 
-Bugs fixed in since 0.10.1:
-     
-      * 331323 : [ffdec_mp3] crashing while playing mp3
-      * 332339 : FFmpeg muxers port to 0.10
-      * 324279 : add build infrastructure for tests
-      * 324366 : gst-ffmpeg doesn't support --disable-encoders
-      * 327257 : playing mpeg video hangs
-      * 338928 : [ffdemux_aac] shouldn't be autoplugged, as it can't work ...
-      * 339042 : expose Apple Quick Draw decoder
-      * 341234 : Totem SIGABRTs when trying to play 3gp
-      * 341715 : 'Element doesn't implement handling of this stream. Pleas...
-      * 341738 : WMV/WMA8 movie stutters, gets audio out of sync
-      * 343604 : [ffmpeg]: Support two passes encoding
-      * 343951 : patch for win32+vs6
-      * 347984 : Internal GStreamer error in ffdec_mpeg4
-      * 348031 : rtpdepay does not add framerate capability
-      * 351437 : [PATCH] ffmpeg postproc ported to 0.10
-      * 351791 : Crashes playing crasher.nsv
-      * 355584 : gst-ffmpeg / ffenc_flv generates unusable files
-      * 359545 : ffdemux_mpegts broken
-      * 361636 : h263 variant not specified with CODEC_ID_H263
-      * 363365 : Please update the ffmpeg snapshot
-      * 364956 : Caps incompatibilities for AMR
-      * 383009 : CVE-2006-4800 4xm buffer overflow
-      * 344583 : [PATCH] ffmpegenc to support/expose more avcodec properties
-      * 351415 : (some) ffenc produce garbled results
-      * 352579 : [avidemux] cane toad movie: sometimes no audio after seek
-      * 378796 : broken ffmux_mov
-
-
-Changes since 0.10.0:
-
-      * ffvideoscale ported
-      * ffdeinterlace ported
-      * demuxer wrapper works pull-based
-      * disabled mpeg2 video and mp3 audio autoplugging
-      * fixes for Indeo3, PNG, smc, H264 HD, H263, FLV1, G2
-
-Bugs fixed since 0.10.0:
-    
-      * 162833 : [ffdemux_mp3] ffmpeg mp3 decoder miss seeking
-      * 311272 : Reading mpeg-ts stream from standard input does not work
-      * 319248 : configure script doesn't accept --with-pkg-config-path ar...
-      * 320238 : Fails to build under powerpc
-      * 322254 : avcodec_open()/close() aren't thread-safe
-      * 323286 : [ffdec_cinepak] chef.avi causes gstreamer to hang in preroll
-      * 326372 : Indeo AVI files do not play with 0.10
-      * 326704 : [ffdec] Memory leak when joining pcache
-      * 327028 : MS Video 1 palettized AVI doesn't work
-      * 327224 : ffdeinterlace port to 0.10
-      * 327861 : [ffmpegenc] FFMpeg audio encoders do not set caps to buffers
-      * 329963 : gstreamer CVS doesn't work with ffmpeg codecs
-      * 330634 : Wrap the ffmpeg demuxers
-      * 331209 : [ffdec_h264] seeking in " IntoTheBlue_Cin_AVC.mp4 " crashes...
-      * 332072 : Too fast playback of h263p encoded file
-      * 332557 : FFmpeg video scale port to 0.10
-      * 332995 : segfault in ffmpeg enc
-      * 333001 : Memory leak in ffmpegenc
-      * 324209 : [CVE-2005-4048] avcodec_default_get_buffer heap overflow
-
-Changes since 0.9.6:
-
-      * Improved pixel aspect ratio handling
-        
-Changes since 0.9.4:
-    
-      * DivX fix
diff --git a/RELEASE b/RELEASE
index 2b78d48..913ff4a 100644 (file)
--- a/RELEASE
+++ b/RELEASE
@@ -1,18 +1,21 @@
 
-Release notes for GStreamer FFmpeg Plug-ins 0.10.13 "Speeding, sparks like lightning"
+Release notes for GStreamer libav Plug-ins 0.11.90 "Nameless here for evermore"
         
 
+
 The GStreamer team is proud to announce a new release
-in the 0.10.x stable series of the
-GStreamer FFmpeg Plug-ins.
+in the 0.11.x unstable series of the
+GStreamer libav Plug-ins.
+
 
+The 0.11.x series is an unstable series targeted at developers and will
+eventually lead up to the stable 1.0 series.
+It is not API or ABI compatible with the stable 0.10.x series.
+It is, however, parallel installable with the 0.10.x series.
 
-The 0.10.x series is a stable series targeted at end users.
-It is not API or ABI compatible with the stable 0.8.x series.
-It is, however, parallel installable with the 0.8.x series.
 
 
-This module contains plug-ins using libraries from the FFmpeg project.
+This module contains plug-ins using libraries from the libav project.
 
 
 
@@ -34,31 +37,16 @@ contains a set of less supported plug-ins that haven't passed the
 
 Features of this release
     
-      * Use libav 0.7.2 internal branch for security fixes
-      * Fixes for handling FLAC 
-      * Post QoS messages when dropping 
-      * Properly report GPL or LGPL licensing
-
-Bugs fixed in this release
-     
-      * 566605 : Support the new ffmpeg metadata API
-      * 574661 : [gstffmpegdec] Wrong usage of parsers
-      * 608892 : DCA/AAC/AC-3 decoders broken in gst-ffmpeg
-      * 532779 : ffmpeg configured with options leading to GPL license
-      * 589361 : [ffdec_flac] extradata NULL or too small error
-      * 640012 : ffmpegdec outputs wrong timestamps
-      * 643591 : ffmpegdec: invalid timestamp being used for next timestamp calculation
-      * 651768 : [PATCH] Arm cross compile fail (Failed to configure embedded FFmpeg tree)
-      * 654634 : postproc: gst-inspect-0.10 -a aborts with gstpostproc.c:360:change_mode: assertion failed: (postproc- > mode)
-      * 656155 : ffdec_mpeg2video and interlace property
-      * 656328 : [ffdeinterlace] add automatic " mode " property
-      * 657950 : ffmpegdec: post QoS messages when dropping a frame
-      * 658019 : ffdec_ass: caps seems wrong
+      * Lots of bugfixes, cleanup and other improvements
+      * Renamed from gst-ffmpeg to libav, also all element factory names now start with an 'av' prefix instead of 'ff'
+      * Handle difference between DTS/PTS properly
+There were no bugs fixed in this release
+    
 
 Download
 
-You can find source releases of gst-ffmpeg in the download directory:
-http://gstreamer.freedesktop.org/src/gst-ffmpeg/
+You can find source releases of gst-libav in the download directory:
+http://gstreamer.freedesktop.org/src/gst-libav/
 
 GStreamer Homepage
 
@@ -82,12 +70,7 @@ Applications
   
 Contributors to this release
     
-      * Edward Hervey
-      * Martin Storsjo
-      * Nicolas Dufresne
-      * Sjoerd Simons
-      * Stefan Sauer
+      * Sebastian Dröge
       * Tim-Philipp Müller
-      * Tvrtko Ursulin
-      * Vincent Penquerc'h
+      * Wim Taymans
  
\ No newline at end of file
index 5d89148..188a2db 100755 (executable)
@@ -33,12 +33,12 @@ autogen_options $@
 
 printf "+ check for build tools"
 if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
-version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262 autoconf261 autoconf260" \
-              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 60 || DIE=1
-version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10" \
-              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 10 || DIE=1
+version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262" \
+              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 62 || DIE=1
+version_check "automake" "$AUTOMAKE automake automake-1.11" \
+              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1
 version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
-              "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
+              "ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1
 version_check "pkg-config" "" \
               "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
 
diff --git a/common b/common
index 7604bab..dc70203 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 7604bab58b5dfc9370d506952f0407fb75c00388
+Subproject commit dc702037b0490052dfc1fa5a3e5890bd55cf7b34
index 6605762..5b651c6 100644 (file)
@@ -1,16 +1,16 @@
-AC_PREREQ(2.60)
+AC_PREREQ(2.62)
 
 dnl initialize autoconf
 dnl when going to/from release please set the nano (fourth number) right !
 dnl releases only do Wall, cvs and prerelease does Werror too
-AC_INIT(GStreamer Libav, 0.10.13.1,
+AC_INIT(GStreamer libav, 0.11.90.1,
     http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
-    gst-ffmpeg)
+    gst-libav)
 
 AG_GST_INIT
 
 dnl initialize automake
-AM_INIT_AUTOMAKE([-Wno-portability 1.10])
+AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar])
 
 dnl define PACKAGE_VERSION_* variables
 AS_VERSION
@@ -25,7 +25,7 @@ dnl define the output header for config
 AM_CONFIG_HEADER([config.h])
 
 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
-AM_MAINTAINER_MODE
+AM_MAINTAINER_MODE([enable])
 
 dnl sets host_* variables
 AC_CANONICAL_HOST
@@ -36,18 +36,16 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
    AC_SUBST(AM_DEFAULT_VERBOSITY)])
 
 dnl our libraries and install dirs use major.minor as a version
-GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
+GST_API_VERSION=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
 dnl we override it here if we need to for the release candidate of new series
-GST_MAJORMINOR=0.10
-AC_SUBST(GST_MAJORMINOR)
+GST_API_VERSION=1.0
+AC_SUBST(GST_API_VERSION)
 
 AG_GST_LIBTOOL_PREPARE
-
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
+AS_LIBTOOL(GST, 0, 0, 0)
 
 dnl *** required versions of GStreamer stuff ***
-GST_REQ=0.10.35.1
+GST_REQ=0.11.90
 ORC_REQ=0.4.6
 
 dnl *** autotools stuff ****
@@ -96,7 +94,7 @@ AG_GST_PLUGIN_DOCS([1.3],[2.1])
 dnl *** checks for libraries ***
 
 dnl check for libm, for sin()
-AC_CHECK_LIBM
+LT_LIB_M
 AC_SUBST(LIBM)
 
 dnl *** checks for header files ***
@@ -116,10 +114,10 @@ dnl *** checks for dependancy libraries ***
 
 dnl checks for gstreamer
 dnl uninstalled is selected preferentially -- see pkg-config(1)
-AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
-AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
-AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GST_REQ])
-AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
+AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ])
+AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ])
+AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GST_REQ])
+AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
 
 AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
@@ -175,6 +173,7 @@ dnl FIXME: do we want to rename to GST_ALL_* ?
 dnl prefer internal headers to already installed ones
 dnl also add builddir include for enumtypes and marshal
 dnl add GST_OPTION_CFLAGS, but overridable
+GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
 AC_SUBST(GST_CFLAGS)
 AC_SUBST(GST_LIBS)
@@ -207,42 +206,42 @@ if test "x$have_bz2" = "xno"; then
 fi
 
 AC_ARG_ENABLE(lgpl,
-              [AC_HELP_STRING([--enable-lgpl], [build a LGPL licensed gst-ffmpeg])])
-AM_CONDITIONAL(GST_FFMPEG_ENABLE_LGPL, test "x$enable_lgpl" = "xyes")
+              [AC_HELP_STRING([--enable-lgpl], [build a LGPL licensed gst-libav])])
+AM_CONDITIONAL(GST_LIBAV_ENABLE_LGPL, test "x$enable_lgpl" = "xyes")
 if test "x$enable_lgpl" = "xyes"; then
-  AC_DEFINE([GST_FFMPEG_ENABLE_LGPL], [], [Defined if building a LGPL-only version of gst-ffmpeg])
+  AC_DEFINE([GST_LIBAV_ENABLE_LGPL], [], [Defined if building a LGPL-only version of gst-libav])
 fi
 
 dnl *** configure external libs ***
 
-HAVE_FFMPEG_UNINSTALLED=1
+HAVE_LIBAV_UNINSTALLED=1
 
-AC_ARG_WITH(system-ffmpeg,
-            [AC_HELP_STRING([--with-system-ffmpeg], [use system Libav libraries])])
+AC_ARG_WITH(system-libav,
+            [AC_HELP_STRING([--with-system-libav], [use system Libav libraries])])
 
-if test "x$with_system_ffmpeg" = "xyes"; then
-  PKG_CHECK_MODULES(FFMPEG, libavformat libavcodec libavutil) 
+if test "x$with_system_libav" = "xyes"; then
+  PKG_CHECK_MODULES(LIBAV, libavformat libavcodec libavutil) 
   if test "x$enable_lgpl" != "xyes"; then
     PKG_CHECK_MODULES(POSTPROC, libpostproc libavcodec libavutil)
   fi
   PKG_CHECK_MODULES(SWSCALE, libswscale libavutil)
   saved_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
+  CPPFLAGS="$CPPFLAGS $LIBAV_CFLAGS"
   AC_CHECK_HEADERS([avi.h])
   CPPFLAGS="$saved_CPPFLAGS"
-  AC_DEFINE([FFMPEG_SOURCE], ["system install"], [Describes where the Libav libraries come from.])
-  HAVE_FFMPEG_UNINSTALLED=0
-  AC_MSG_NOTICE([Using system-installed FFMpeg code])
+  AC_DEFINE([LIBAV_SOURCE], ["system install"], [Describes where the Libav libraries come from.])
+  HAVE_LIBAV_UNINSTALLED=0
+  AC_MSG_NOTICE([Using system-installed libav code])
   AC_MSG_WARN([
   ======================================================================
-   WARNING: you have chosen to build gst-ffmpeg against a random
+   WARNING: you have chosen to build gst-libav against a random
    external version of Libav instead of building it against the tested
-   internal Libav snapshot that is included with gst-ffmpeg.
+   internal Libav snapshot that is included with gst-libav.
    
    This is a very bad idea.  So bad in fact that words cannot express
    just how bad it is.  Suffice to say that it is BAD.
    
-   The GStreamer developers cannot and will not support a gst-ffmpeg
+   The GStreamer developers cannot and will not support a gst-libav
    built this way.  Any bug reports that indicate there is an external
    version of Libav involved will be closed immediately without further
    investigation.
@@ -250,15 +249,15 @@ if test "x$with_system_ffmpeg" = "xyes"; then
    The reason such a setup can't be supported is that the Libav API
    and ABI is in constant flux, yet there aren't any official releases
    of the Libav library to develop against.  This makes it impossible
-   to guarantee that gst-ffmpeg will work reliably, or even compile,
-   with a randomly picked version Libav.  Even if gst-ffmpeg compiles
+   to guarantee that gst-libav will work reliably, or even compile,
+   with a randomly picked version Libav.  Even if gst-libav compiles
    and superficially appears to work fine against your chosen external
    Libav version, that might just not be the case on other systems, or
    even the same system at a later time, or when using decoders,
    encoders, demuxers or muxers that have not been tested.
    
    Please do not create or distribute binary packages of gst-Libav
-   that link against an external ffmpeg. Thank you!
+   that link against an external libav. Thank you!
   ======================================================================
   ])
 
@@ -268,16 +267,16 @@ else
 
   AC_MSG_NOTICE([Using local Libav snapshot])
   
-  dnl libgstffmpeg.la: include dirs
-  FFMPEG_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/libav/libavutil \
+  dnl libgstlibav.la: include dirs
+  LIBAV_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/libav/libavutil \
                 -I \$(top_srcdir)/gst-libs/ext/libav/libavformat \
                  -I \$(top_srcdir)/gst-libs/ext/libav/libavcodec \
                 -I \$(top_srcdir)/gst-libs/ext/libav \
                 -I \$(top_builddir)/gst-libs/ext/libav \
                  -Wno-deprecated-declarations"
 
-  dnl libgstffmpeg.la: libs to statically link to        
-  FFMPEG_LIBS="\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \
+  dnl libgstlibav.la: libs to statically link to        
+  LIBAV_LIBS="\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \
                \$(top_builddir)/gst-libs/ext/libav/libavcodec/libavcodec.a \
                \$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
   dnl
@@ -303,47 +302,47 @@ else
   SWSCALE_LIBS="\$(top_builddir)/gst-libs/ext/libav/libswscale/libswscale.a \
                 \$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
 
-  FFMPEG_SUBDIRS=gst-libs
+  LIBAV_SUBDIRS=gst-libs
   AC_DEFINE(HAVE_AVI_H)
-  AC_DEFINE([FFMPEG_SOURCE], ["local snapshot"], [Describes where the Libav libraries come from.])
+  AC_DEFINE([LIBAV_SOURCE], ["local snapshot"], [Describes where the Libav libraries come from.])
 
-  AC_ARG_WITH(ffmpeg-extra-configure, 
-      AC_HELP_STRING([--with-ffmpeg-extra-configure="xxx"],
-      [extra configure options for internal ffmpeg ./configure script]),,
-      with_ffmpeg_extra_configure=no)
+  AC_ARG_WITH(libav-extra-configure, 
+      AC_HELP_STRING([--with-libav-extra-configure="xxx"],
+      [extra configure options for internal libav ./configure script]),,
+      with_libav=no)
 
   # basic arguments
-  embffmpeg_configure_args="--prefix=$prefix"
+  emblibav_configure_args="--prefix=$prefix"
 
   # Enable pic and static so that we get .a files, but with PIC code.
-  embffmpeg_configure_args="$embffmpeg_configure_args --disable-avserver --disable-avplay\
+  emblibav_configure_args="$emblibav_configure_args --disable-avserver --disable-avplay\
         --disable-ffmpeg --disable-avprobe --enable-static --enable-pic \
        --disable-encoder=flac --disable-decoder=cavs --disable-protocols --disable-devices\
        --disable-network --disable-hwaccels --disable-filters --disable-doc\
        --enable-optimizations"
 
   if test "x$enable_lgpl" != "xyes"; then
-    embffmpeg_configure_args="$embffmpeg_configure_args --enable-postproc \
+    emblibav_configure_args="$emblibav_configure_args --enable-postproc \
         --enable-gpl"
   fi
 
-  # if we are cross-compiling, tell ffmpeg so
+  # if we are cross-compiling, tell libav so
   target_os=`echo $host_os | sed 's/-gnu//'`
   if test "x$cross_compiling" = xyes; then
-    embffmpeg_configure_args="$embffmpeg_configure_args --enable-cross-compile \
+    emblibav_configure_args="$emblibav_configure_args --enable-cross-compile \
         --target-os=$target_os --arch=$host_cpu --cross-prefix=$host_alias-"
   fi
 
   case $host_os in
-    # Unfortunately, in Mac OS 10.5 the current rev of ffmpeg builds
+    # Unfortunately, in Mac OS 10.5 the current rev of libav builds
     # some non-PIC code into the .a file. See
     # http://trac.macosforge.org/projects/macports/ticket/13725 for more
     # info.
     darwin*) 
-      embffmpeg_configure_args="$embffmpeg_configure_args --disable-mmx --disable-altivec"
+      emblibav_configure_args="$emblibav_configure_args --disable-mmx --disable-altivec"
       ;;
     mingw32*)
-      embffmpeg_configure_args="$embffmpeg_configure_args --enable-memalign-hack"
+      emblibav_configure_args="$emblibav_configure_args --enable-memalign-hack"
       WIN32_LIBS="-lws2_32"
       ;;
     *)
@@ -352,29 +351,29 @@ else
   esac
 
   dnl checks for extra enable/disable flags
-  FFMPEG_OPTS="(cd $srcdir/gst-libs/ext/libav && ./configure --help)"
-  # Let's check if we can disable the building of the ffmpeg binary
-  can_disable=`echo "$FFMPEG_OPTS" | grep 'disable-ffmpeg'`
+  LIBAV_OPTS="(cd $srcdir/gst-libs/ext/libav && ./configure --help)"
+  # Let's check if we can disable the building of the libav binary
+  can_disable=`echo "$LIBAV_OPTS" | grep 'disable-ffmpeg'`
   if test "$can_disable" != ""; then
-    embffmpeg_configure_args="$embffmpeg_configure_args --disable-ffmpeg"
+    emblibav_configure_args="$emblibav_configure_args --disable-ffmpeg"
   fi
   dnl check if libswscale needs enabling explicitly
-  can_enable=`echo "$FFMPEG_OPTS" | grep 'enable-swscale'`
+  can_enable=`echo "$LIBAV_OPTS" | grep 'enable-swscale'`
   if test "$can_enable" != ""; then
-    embffmpeg_configure_args="$embffmpeg_configure_args --enable-swscale"
+    emblibav_configure_args="$emblibav_configure_args --enable-swscale"
   fi
 
-  # append extra configure options to embffmpeg_configure_args if needed
-  if test "x$with_ffmpeg_extra_configure" != "xno"; then
-    embffmpeg_configure_args="$embffmpeg_configure_args $with_ffmpeg_extra_configure"
+  # append extra configure options to emblibav_configure_args if needed
+  if test "x$with_libav_extra_configure" != "xno"; then
+    emblibav_configure_args="$emblibav_configure_args $with_libav_extra_configure"
   fi
 
-  AC_SUBST(FFMPEG_CO_DIR)
-  AC_SUBST(FFMPEG_SVN)
-  AC_SUBST(FFMPEG_REVISION)
-  AC_SUBST(FFMPEG_EXTERNALS_REVISION)
-  AC_CONFIG_COMMANDS([configure-embedded-ffmpeg],
-    [echo "Configuring included Libav instance with args $embffmpeg_configure_args"
+  AC_SUBST(LIBAV_CO_DIR)
+  AC_SUBST(LIBAV_SVN)
+  AC_SUBST(LIBAV_REVISION)
+  AC_SUBST(LIBAV_EXTERNALS_REVISION)
+  AC_CONFIG_COMMANDS([configure-embedded-libav],
+    [echo "Configuring included Libav instance with args $emblibav_configure_args"
      origdir=`pwd`
      dnl Don't put path on the configure call when not needed, as FFmpeg's configure relies on it
      dnl to detect out-of-tree builds
@@ -386,33 +385,33 @@ else
 
      AS_MKDIR_P(["$ac_top_build_prefix"gst-libs/ext/libav])
      cd "$ac_top_build_prefix"gst-libs/ext/libav &&
-         eval "$confcmd $embffmpeg_configure_args" ||
+         eval "$confcmd $emblibav_configure_args" ||
          AC_MSG_ERROR([Failed to configure embedded Libav tree])
      cd "$origdir"
     ],
-    [embffmpeg_configure_args="$embffmpeg_configure_args"])
+    [emblibav_configure_args="$emblibav_configure_args"])
   AC_MSG_NOTICE([Using included Libav code])
 fi
 
-AC_SUBST(FFMPEG_CFLAGS)
-AC_SUBST(FFMPEG_LIBS)
-AC_SUBST(FFMPEG_SUBDIRS)
+AC_SUBST(LIBAV_CFLAGS)
+AC_SUBST(LIBAV_LIBS)
+AC_SUBST(LIBAV_SUBDIRS)
 AC_SUBST(POSTPROC_CFLAGS)
 AC_SUBST(POSTPROC_LIBS)
 AC_SUBST(SWSCALE_CFLAGS)
 AC_SUBST(SWSCALE_LIBS)
 AC_SUBST(WIN32_LIBS)
  
-if test x$HAVE_FFMPEG_UNINSTALLED = x1; then
-  AC_DEFINE(HAVE_FFMPEG_UNINSTALLED, [], [Defined if building against uninstalled Libav source])
+if test x$HAVE_LIBAV_UNINSTALLED = x1; then
+  AC_DEFINE(HAVE_LIBAV_UNINSTALLED, [], [Defined if building against uninstalled Libav source])
 fi
-AM_CONDITIONAL(HAVE_FFMPEG_UNINSTALLED, test x$HAVE_FFMPEG_UNINSTALLED = x1)
+AM_CONDITIONAL(HAVE_LIBAV_UNINSTALLED, test x$HAVE_LIBAV_UNINSTALLED = x1)
 
 AC_CONFIG_FILES(
 Makefile
 common/Makefile
 common/m4/Makefile
-gst-ffmpeg.spec
+gst-libav.spec
 ext/Makefile
 ext/ffmpeg/Makefile
 ext/libpostproc/Makefile
index b0ba1d8..69017f0 100644 (file)
@@ -3,8 +3,8 @@ GST_DOC_SCANOBJ = $(top_srcdir)/common/gstdoc-scangobj
 ## Process this file with automake to produce Makefile.in
 
 # The name of the module, e.g. 'glib'.
-#DOC_MODULE=gst-plugins-libs-@GST_MAJORMINOR@
-MODULE=gst-ffmpeg
+#DOC_MODULE=gst-plugins-libs-@GST_API_VERSION@
+MODULE=gst-libav
 DOC_MODULE=$(MODULE)-plugins
 
 # for upload-doc.mak
similarity index 87%
rename from docs/plugins/gst-ffmpeg-plugins-docs.sgml
rename to docs/plugins/gst-libav-plugins-docs.sgml
index 610417b..dc906d1 100644 (file)
@@ -7,9 +7,9 @@
 
 <book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
   <bookinfo>
-    <title>GStreamer FFMPeg &GST_MAJORMINOR; Plugins Reference Manual</title>
+    <title>GStreamer FFMPeg &GST_API_VERSION; Plugins Reference Manual</title>
     <releaseinfo>
-      for GStreamer FFMPeg Plugins &GST_MAJORMINOR; (&GST_VERSION;)
+      for GStreamer FFMPeg Plugins &GST_API_VERSION; (&GST_VERSION;)
       The latest version of this documentation can be found on-line at
       <ulink role="online-location" url="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-ffmpeg-plugins/html/">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-ffmpeg-plugins/html/</ulink>.
     </releaseinfo>
diff --git a/docs/plugins/inspect/plugin-ffmpeg.xml b/docs/plugins/inspect/plugin-ffmpeg.xml
deleted file mode 100644 (file)
index ad220a4..0000000
+++ /dev/null
@@ -1,6142 +0,0 @@
-<plugin>
-  <name>ffmpeg</name>
-  <description>All FFMPEG codecs (local snapshot)</description>
-  <filename>../../ext/ffmpeg/.libs/libgstffmpeg.so</filename>
-  <basename>libgstffmpeg.so</basename>
-  <version>0.10.4</version>
-  <license>LGPL</license>
-  <source>gst-ffmpeg</source>
-  <package>FFMpeg</package>
-  <origin>http://ffmpeg.sourceforge.net/</origin>
-  <elements>
-    <element>
-      <name>ffaudioresample</name>
-      <longname>FFMPEG Audio resampling element</longname>
-      <class>Filter/Converter/Audio</class>
-      <description>Converts audio from one samplerate to another</description>
-      <author>Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, channels=(int){ 1, 2 }, rate=(int)[ 1, 2147483647 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, channels=(int)[ 1, 6 ], rate=(int)[ 1, 2147483647 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_4xm</name>
-      <longname>FFMPEG 4-XM video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG 4xm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-4xm, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_8bps</name>
-      <longname>FFMPEG Quicktime planar 8bps video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG 8bps decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-8bps, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_aasc</name>
-      <longname>FFMPEG Autodesk RLE video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG aasc decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-aasc, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_ac3</name>
-      <longname>FFMPEG AC-3 audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG ac3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-ac3, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_4xm</name>
-      <longname>FFMPEG 4-XM ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_4xm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)4xm</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_adx</name>
-      <longname>FFMPEG ADX ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_adx decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)adx</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ct</name>
-      <longname>FFMPEG CT ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ct decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)ct</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ea</name>
-      <longname>FFMPEG Electronic Arts ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ea decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)ea</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ea_r1</name>
-      <longname>FFMPEG EA ADPCM R1 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ea_r1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)ea-r1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ea_r2</name>
-      <longname>FFMPEG EA ADPCM R2 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ea_r2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)ea-r3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ea_r3</name>
-      <longname>FFMPEG EA ADPCM R3 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ea_r3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)ea-r3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ima_amv</name>
-      <longname>FFMPEG IMA/AMV ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ima_amv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)amv</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ima_dk3</name>
-      <longname>FFMPEG IMA/DK3 ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ima_dk3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)dk3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ima_dk4</name>
-      <longname>FFMPEG IMA/DK4 ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ima_dk4 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)dk4</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ima_qt</name>
-      <longname>FFMPEG IMA/Quicktime ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ima_qt decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)quicktime</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ima_smjpeg</name>
-      <longname>FFMPEG IMA/SMJPEG ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ima_smjpeg decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)smjpeg</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ima_wav</name>
-      <longname>FFMPEG IMA/DVI ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ima_wav decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)dvi</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ima_ws</name>
-      <longname>FFMPEG IMA/Westwood ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ima_ws decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)westwood</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_ms</name>
-      <longname>FFMPEG Microsoft ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_ms decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)microsoft</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_sbpro_2</name>
-      <longname>FFMPEG SB-Pro ADPCM 2 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_sbpro_2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)sbpro2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_sbpro_3</name>
-      <longname>FFMPEG SB-Pro ADPCM 3 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_sbpro_3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)sbpro3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_sbpro_4</name>
-      <longname>FFMPEG SB-Pro ADPCM 4 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_sbpro_4 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)sbpro4</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_swf</name>
-      <longname>FFMPEG Shockwave ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_swf decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)swf</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_thp</name>
-      <longname>FFMPEG Nintendo THP ADPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_thp decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)thp</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_xa</name>
-      <longname>FFMPEG CD-ROM XA ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_xa decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)xa</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_adpcm_yamaha</name>
-      <longname>FFMPEG Yamaha ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG adpcm_yamaha decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)yamaha</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_alac</name>
-      <longname>FFMPEG Apple lossless audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG alac decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-alac, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_ape</name>
-      <longname>FFMPEG Monkey's Audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG ape decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-ffmpeg-parsed-ape, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_asv1</name>
-      <longname>FFMPEG Asus video v1 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG asv1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-asus, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], asusversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_asv2</name>
-      <longname>FFMPEG Asus video v2 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG asv2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-asus, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], asusversion=(int)2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_atrac3</name>
-      <longname>FFMPEG Sony ATRAC-3 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG atrac3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/atrac3, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_avs</name>
-      <longname>FFMPEG AVS Video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG avs decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-avs, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_bmp</name>
-      <longname>FFMPEG BMP bitmap decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG bmp decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>image/bmp</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_camstudio</name>
-      <longname>FFMPEG CamStudio video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG camstudio decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-camstudio, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_camtasia</name>
-      <longname>FFMPEG Techsmith Camtasia video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG camtasia decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-camtasia, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], depth=(int)[ 8, 32 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_cinepak</name>
-      <longname>FFMPEG Cinepak video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG cinepak decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-cinepak, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_cljr</name>
-      <longname>FFMPEG Cirrus Logipak AccuPak video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG cljr decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-cirrus-logic-accupak, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_cook</name>
-      <longname>FFMPEG Realaudio G2 (Cook) audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG cook decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-pn-realaudio, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], raversion=(int)8</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_cyuv</name>
-      <longname>FFMPEG CYUV lossless video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG cyuv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-compressed-yuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_dca</name>
-      <longname>FFMPEG DTS Audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG dca decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-dts, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_dvvideo</name>
-      <longname>FFMPEG Digital video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG dvvideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-dv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_ffv1</name>
-      <longname>FFMPEG FFMpeg video v1 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG ffv1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-ffv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], ffvversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_ffvhuff</name>
-      <longname>FFMPEG FFMPEG non-compliant Huffyuv video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG ffvhuff decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-ffvhuff, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_flac</name>
-      <longname>FFMPEG FLAC lossless audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG flac decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-flac</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_flashsv</name>
-      <longname>FFMPEG Flash Screen Video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG flashsv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-flash-screen, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_flic</name>
-      <longname>FFMPEG FLIC animation video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG flic decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-flic, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_flv</name>
-      <longname>FFMPEG FLV video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG flv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-flash-video, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], flvversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_fraps</name>
-      <longname>FFMPEG FRAPS video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG fraps decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-fraps, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_g726</name>
-      <longname>FFMPEG G.726 ADPCM decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG g726 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)g726</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_h261</name>
-      <longname>FFMPEG H.261 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG h261 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-h261, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_h263</name>
-      <longname>FFMPEG H.263 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG h263 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_h263i</name>
-      <longname>FFMPEG Intel H.263 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG h263i decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-intel-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)intel</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_h264</name>
-      <longname>FFMPEG H.264 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG h264 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_huffyuv</name>
-      <longname>FFMPEG Huffyuv lossless video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG huffyuv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-huffyuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_idcinvideo</name>
-      <longname>FFMPEG ID Quake II CIN video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG idcinvideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-idcinvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_indeo2</name>
-      <longname>FFMPEG Indeo-2 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG indeo2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-indeo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], indeoversion=(int)2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_indeo3</name>
-      <longname>FFMPEG Indeo-3 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG indeo3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-indeo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], indeoversion=(int)3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_interplay_dpcm</name>
-      <longname>FFMPEG Interplay DPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG interplay_dpcm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-dpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)interplay</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_interplayvideo</name>
-      <longname>FFMPEG Interplay video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG interplayvideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-interplayvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_kmvc</name>
-      <longname>FFMPEG Karl Morton's video Codec decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG kmvc decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-kmvc, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_loco</name>
-      <longname>FFMPEG LOCO video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG loco decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-loco, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mace3</name>
-      <longname>FFMPEG MACE-3 audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG mace3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-mace, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], maceversion=(int)3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mace6</name>
-      <longname>FFMPEG MACE-6 audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG mace6 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-mace, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], maceversion=(int)6</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mdec</name>
-      <longname>FFMPEG Playstation MDEC video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mdec decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-mdec, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mjpeg</name>
-      <longname>FFMPEG Motion-JPEG decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mjpeg decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mjpegb</name>
-      <longname>FFMPEG Quicktime Motion-JPEG B decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mjpegb decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-mjpeg-b, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mmvideo</name>
-      <longname>FFMPEG American Laser Games MM Video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mmvideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-mmvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mp3</name>
-      <longname>FFMPEG MPEG-1 layer 3 audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG mp3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/mpeg, mpegversion=(int)1, layer=(int)[ 1, 3 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mp3adu</name>
-      <longname>FFMPEG ADU-formatted MPEG-1 layer 3 audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG mp3adu decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-mp3adu, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mp3on4</name>
-      <longname>FFMPEG MP3ON4 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG mp3on4 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-mp3on4, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mpc7</name>
-      <longname>FFMPEG MusePack audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG mpc7 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-ffmpeg-parsed-musepack, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], streamversion=(int)7</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mpeg2video</name>
-      <longname>FFMPEG MPEG-2 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mpeg2video decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/mpeg, mpegversion=(int)[ 1, 2 ], systemstream=(boolean)false</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mpeg4</name>
-      <longname>FFMPEG MPEG-4 compatible video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mpeg4 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)4, systemstream=(boolean)false; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], divxversion=(int)[ 4, 5 ]; video/x-xvid, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-3ivx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mpegvideo</name>
-      <longname>FFMPEG MPEG-2 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mpegvideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/mpeg, mpegversion=(int)[ 1, 2 ], systemstream=(boolean)false</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_msmpeg4</name>
-      <longname>FFMPEG Microsoft MPEG-4 v3 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG msmpeg4 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msmpegversion=(int)43; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], divxversion=(int)3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_msmpeg4v1</name>
-      <longname>FFMPEG Microsoft MPEG-4 v1 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG msmpeg4v1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msmpegversion=(int)41</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_msmpeg4v2</name>
-      <longname>FFMPEG Microsoft MPEG-4 v2 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG msmpeg4v2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msmpegversion=(int)42</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_msrle</name>
-      <longname>FFMPEG Microsoft RLE video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG msrle decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-rle, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], layout=(string)microsoft, depth=(int)[ 1, 64 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_msvideo1</name>
-      <longname>FFMPEG Microsoft video v1 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG msvideo1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-msvideocodec, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msvideoversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_mszh</name>
-      <longname>FFMPEG Lossless MSZH video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG mszh decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-mszh, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_nellymoser</name>
-      <longname>FFMPEG Nellymoser ASAO audio codec decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG nellymoser decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-nellymoser, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_nuv</name>
-      <longname>FFMPEG NuppelVideo codec decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG nuv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-nuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_pam</name>
-      <longname>FFMPEG PAM image decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG pam decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-pam, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_pbm</name>
-      <longname>FFMPEG PBM image decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG pbm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>image/pbm, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_pgm</name>
-      <longname>FFMPEG PGM image decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG pgm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-pgm, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_pgmyuv</name>
-      <longname>FFMPEG PGM-YUV image decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG pgmyuv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-pgmyuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_png</name>
-      <longname>FFMPEG PNG image decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG png decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>image/png, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_ppm</name>
-      <longname>FFMPEG PPM image decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG ppm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>image/ppm, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_qdm2</name>
-      <longname>FFMPEG QDesign Music 2 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG qdm2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-qdm2, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_qdraw</name>
-      <longname>FFMPEG Apple Quickdraw video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG qdraw decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-qdrw, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_qpeg</name>
-      <longname>FFMPEG QPEG video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG qpeg decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-qpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_qtrle</name>
-      <longname>FFMPEG Quicktime RLE animation video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG qtrle decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-rle, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], layout=(string)quicktime, depth=(int)[ 1, 64 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_real_144</name>
-      <longname>FFMPEG Realaudio 14k4bps decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG real_144 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-pn-realaudio, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], raversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_real_288</name>
-      <longname>FFMPEG Realaudio 28k8bps decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG real_288 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-pn-realaudio, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], raversion=(int)2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_roq_dpcm</name>
-      <longname>FFMPEG RoQ DPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG roq_dpcm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-dpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)roq</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_roqvideo</name>
-      <longname>FFMPEG ID/RoQ video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG roqvideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-roqvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_rpza</name>
-      <longname>FFMPEG Apple RPZA video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG rpza decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-apple-video, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_rv10</name>
-      <longname>FFMPEG Realvideo 1.0 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG rv10 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-pn-realvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false, rmversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_rv20</name>
-      <longname>FFMPEG Realvideo 2.0 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG rv20 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-pn-realvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false, rmversion=(int)2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_shorten</name>
-      <longname>FFMPEG Shorten lossless audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG shorten decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-shorten</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_smc</name>
-      <longname>FFMPEG Quicktime SMC graphics video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG smc decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-smc, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_snow</name>
-      <longname>FFMPEG Snow wave video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG snow decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-snow, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_sol_dpcm</name>
-      <longname>FFMPEG SOL DPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG sol_dpcm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-dpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)sol</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_sonic</name>
-      <longname>FFMPEG Sonic audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG sonic decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-sonic, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_sp5x</name>
-      <longname>FFMPEG Sp5x-like JPEG decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG sp5x decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/sp5x, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_svq1</name>
-      <longname>FFMPEG Sorensen-1 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG svq1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-svq, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], svqversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_svq3</name>
-      <longname>FFMPEG Sorensen-3 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG svq3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-svq, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], svqversion=(int)3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_theora</name>
-      <longname>FFMPEG Theora video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG theora decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-theora, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_truemotion1</name>
-      <longname>FFMPEG Duck Truemotion video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG truemotion1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-truemotion, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], trueversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_truemotion2</name>
-      <longname>FFMPEG Duck Truemotion 2 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG truemotion2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-truemotion, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], trueversion=(int)2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_truespeech</name>
-      <longname>FFMPEG DSP Group TrueSpeech Audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG truespeech decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-truespeech, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_tta</name>
-      <longname>FFMPEG Lossless True Audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG tta decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-tta, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_ultimotion</name>
-      <longname>FFMPEG Ultimotion video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG ultimotion decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-ultimotion, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vc1</name>
-      <longname>FFMPEG Microsoft Video Codec v1 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vc1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)3, fourcc=(fourcc)WVC1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vcr1</name>
-      <longname>FFMPEG ATI VCR-1 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vcr1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-ati-vcr, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], vcrversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vmdaudio</name>
-      <longname>FFMPEG Sierra VMD audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG vmdaudio decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-vmdaudio, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vmdvideo</name>
-      <longname>FFMPEG Sierra VMD video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vmdvideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-vmdvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vp3</name>
-      <longname>FFMPEG VP3 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vp3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-vp3, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vp5</name>
-      <longname>FFMPEG VP5 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vp5 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-vp5, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vp6</name>
-      <longname>FFMPEG VP6 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vp6 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-vp6, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vp6a</name>
-      <longname>FFMPEG VP6 Alpha video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vp6a decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-vp6-alpha, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vp6f</name>
-      <longname>FFMPEG VP6 Flash video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vp6f decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-vp6-flash, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_vqavideo</name>
-      <longname>FFMPEG Westwood VQA video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG vqavideo decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-vqavideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_wmav1</name>
-      <longname>FFMPEG Windows Media Audio v7 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG wmav1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-wma, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], wmaversion=(int)1, block_align=(int)[ 0, 2147483647 ], bitrate=(int)[ 0, 2147483647 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_wmav2</name>
-      <longname>FFMPEG Windows Media Audio v8/9 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG wmav2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-wma, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], wmaversion=(int)2, block_align=(int)[ 0, 2147483647 ], bitrate=(int)[ 0, 2147483647 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_wmv1</name>
-      <longname>FFMPEG Windows Media Video v7 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG wmv1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_wmv2</name>
-      <longname>FFMPEG Windows Media Video v8 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG wmv2 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_wmv3</name>
-      <longname>FFMPEG Windows Media Video v9 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG wmv3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_wnv1</name>
-      <longname>FFMPEG Winnov video 1 decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG wnv1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-wnv1, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_ws_snd1</name>
-      <longname>FFMPEG Westwood Sound-1 decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG ws_snd1 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-ws_snd1, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_xan_dpcm</name>
-      <longname>FFMPEG XAN DPCM audio decoder</longname>
-      <class>Codec/Decoder/Audio</class>
-      <description>FFMPEG xan_dpcm decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-dpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)xan</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_xan_wc3</name>
-      <longname>FFMPEG XAN Wing Commander 3 video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG xan_wc3 decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-xan, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wcversion=(int)3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_xl</name>
-      <longname>FFMPEG Miro VideoXL decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG xl decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-xl, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_zlib</name>
-      <longname>FFMPEG Lossless zlib video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG zlib decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-zlib, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdec_zmbv</name>
-      <longname>FFMPEG Zip Motion Blocks Video decoder</longname>
-      <class>Codec/Decoder/Video</class>
-      <description>FFMPEG zmbv decoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-zmbv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdeinterlace</name>
-      <longname>FFMPEG Deinterlace element</longname>
-      <class>Filter/Converter/Video</class>
-      <description>Deinterlace video</description>
-      <author>Luca Ognibene &lt;luogni@tin.it&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_4xm</name>
-      <longname>FFMPEG 4X Technologies format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG 4X Technologies format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-4xm</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_IFF</name>
-      <longname>FFMPEG IFF format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG IFF format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-IFF</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_MTV</name>
-      <longname>FFMPEG MTV format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG MTV format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-MTV</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_RoQ</name>
-      <longname>FFMPEG Id RoQ format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Id RoQ format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-RoQ</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_aiff</name>
-      <longname>FFMPEG Audio IFF demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Audio IFF demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-aiff</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_amr</name>
-      <longname>FFMPEG 3gpp amr file format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG 3gpp amr file format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-amr</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_apc</name>
-      <longname>FFMPEG CRYO APC format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG CRYO APC format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-apc</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_ape</name>
-      <longname>FFMPEG Monkey's Audio demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Monkey's Audio demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-ape</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_asf</name>
-      <longname>FFMPEG asf format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG asf format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-ms-asf</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_au</name>
-      <longname>FFMPEG SUN AU Format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG SUN AU Format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-au</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_avi</name>
-      <longname>FFMPEG avi format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG avi format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-msvideo</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_avs</name>
-      <longname>FFMPEG avs format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG avs format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-avs</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_bethsoftvid</name>
-      <longname>FFMPEG Bethesda Softworks 'Daggerfall' VID format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Bethesda Softworks 'Daggerfall' VID format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-bethsoftvid</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_bfi</name>
-      <longname>FFMPEG Brute Force &amp; Ignorance demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Brute Force &amp; Ignorance demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-bfi</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_c93</name>
-      <longname>FFMPEG Interplay C93 demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Interplay C93 demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-c93</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_daud</name>
-      <longname>FFMPEG D-Cinema audio format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG D-Cinema audio format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-daud</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_dsicin</name>
-      <longname>FFMPEG Delphine Software International CIN format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Delphine Software International CIN format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-dsicin</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_dv</name>
-      <longname>FFMPEG DV video format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG DV video format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-dv, systemstream=(boolean)true</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_dxa</name>
-      <longname>FFMPEG dxa demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG dxa demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-dxa</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_ea</name>
-      <longname>FFMPEG Electronic Arts Multimedia Format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Electronic Arts Multimedia Format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-ea</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_ea_cdata</name>
-      <longname>FFMPEG Electronic Arts cdata demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Electronic Arts cdata demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-ea_cdata</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_ffm</name>
-      <longname>FFMPEG ffm format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG ffm format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-ffm</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_film_cpk</name>
-      <longname>FFMPEG Sega FILM/CPK format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Sega FILM/CPK format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-film_cpk</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_flic</name>
-      <longname>FFMPEG FLI/FLC/FLX animation format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG FLI/FLC/FLX animation format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-fli</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_flv</name>
-      <longname>FFMPEG flv format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG flv format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-flv</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_gif</name>
-      <longname>FFMPEG gif format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG gif format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>image/gif</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_gsm</name>
-      <longname>FFMPEG GSM demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG GSM demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-gsm</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_gxf</name>
-      <longname>FFMPEG GXF format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG GXF format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/gxf</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_idcin</name>
-      <longname>FFMPEG Id CIN format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Id CIN format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-idcin</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_ingenient</name>
-      <longname>FFMPEG Ingenient MJPEG demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Ingenient MJPEG demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-ingenient</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_ipmovie</name>
-      <longname>FFMPEG Interplay MVE format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Interplay MVE format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-ipmovie</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_lmlm4</name>
-      <longname>FFMPEG lmlm4 raw format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG lmlm4 raw format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-lmlm4</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_matroska</name>
-      <longname>FFMPEG Matroska file format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Matroska file format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-matroska</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mm</name>
-      <longname>FFMPEG American Laser Games MM format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG American Laser Games MM format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-mm</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mmf</name>
-      <longname>FFMPEG mmf format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG mmf format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-mmf</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mov_mp4_m4a_3gp_3g2_mj2</name>
-      <longname>FFMPEG QuickTime/MPEG4/Motion JPEG 2000 format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG QuickTime/MPEG4/Motion JPEG 2000 format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-mov_mp4_m4a_3gp_3g2_mj2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mp3</name>
-      <longname>FFMPEG MPEG audio demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG MPEG audio demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-id3</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mpc</name>
-      <longname>FFMPEG musepack demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG musepack demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-musepack, streamversion=(int)7</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mpc8</name>
-      <longname>FFMPEG musepack8 demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG musepack8 demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-mpc8</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mpeg</name>
-      <longname>FFMPEG MPEG PS format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG MPEG PS format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/mpeg, systemstream=(boolean)true</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mpegts</name>
-      <longname>FFMPEG MPEG2 transport stream format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG MPEG2 transport stream format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/mpegts, systemstream=(boolean)true</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mpegtsraw</name>
-      <longname>FFMPEG MPEG2 raw transport stream format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG MPEG2 raw transport stream format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-mpegtsraw</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_msnwctcp</name>
-      <longname>FFMPEG MSN TCP Webcam stream demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG MSN TCP Webcam stream demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-msnwctcp</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_mxf</name>
-      <longname>FFMPEG MXF format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG MXF format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/mxf</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_nsv</name>
-      <longname>FFMPEG NullSoft Video format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG NullSoft Video format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-nsv</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_nut</name>
-      <longname>FFMPEG nut format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG nut format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-nut</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_nuv</name>
-      <longname>FFMPEG NuppelVideo format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG NuppelVideo format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-nuv</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_ogg</name>
-      <longname>FFMPEG Ogg demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Ogg demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/ogg</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_psxstr</name>
-      <longname>FFMPEG Sony Playstation STR format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Sony Playstation STR format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-psxstr</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_pva</name>
-      <longname>FFMPEG pva file and stream format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG pva file and stream format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-pva</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_rl2</name>
-      <longname>FFMPEG rl2 format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG rl2 format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-rl2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_rm</name>
-      <longname>FFMPEG rm format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG rm format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-pn-realmedia, systemstream=(boolean)true</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_rpl</name>
-      <longname>FFMPEG RPL/ARMovie format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG RPL/ARMovie format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-rpl</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_siff</name>
-      <longname>FFMPEG Beam Software SIFF demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Beam Software SIFF demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-siff</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_smk</name>
-      <longname>FFMPEG Smacker Video demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Smacker Video demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-smk</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_sol</name>
-      <longname>FFMPEG Sierra SOL Format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Sierra SOL Format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-sol</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_swf</name>
-      <longname>FFMPEG Flash format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Flash format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-shockwave-flash</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_thp</name>
-      <longname>FFMPEG THP demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG THP demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-thp</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_tiertexseq</name>
-      <longname>FFMPEG Tiertex Limited SEQ format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Tiertex Limited SEQ format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-tiertexseq</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_tta</name>
-      <longname>FFMPEG true-audio demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG true-audio demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-ttafile</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_txd</name>
-      <longname>FFMPEG txd format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG txd format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-txd</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_vc1test</name>
-      <longname>FFMPEG VC1 test bitstream format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG VC1 test bitstream format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-vc1test</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_vmd</name>
-      <longname>FFMPEG Sierra VMD format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Sierra VMD format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-vmd</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_voc</name>
-      <longname>FFMPEG Creative Voice File format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Creative Voice File format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-voc</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_wav</name>
-      <longname>FFMPEG wav format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG wav format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-wav</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_wc3movie</name>
-      <longname>FFMPEG Wing Commander III movie format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Wing Commander III movie format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-wc3movie</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_wsaud</name>
-      <longname>FFMPEG Westwood Studios audio format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Westwood Studios audio format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-wsaud</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_wsvqa</name>
-      <longname>FFMPEG Westwood Studios VQA format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Westwood Studios VQA format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-wsvqa</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_xa</name>
-      <longname>FFMPEG Maxis XA File Format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG Maxis XA File Format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-xa</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffdemux_yuv4mpegpipe</name>
-      <longname>FFMPEG YUV4MPEG pipe format demuxer</longname>
-      <class>Codec/Demuxer</class>
-      <description>FFMPEG YUV4MPEG pipe format demuxer</description>
-      <author>Wim Taymans &lt;wim@fluendo.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;, Edward Hervey &lt;bilboed@bilboed.com&gt;</author>
-      <pads>
-        <caps>
-          <name>video_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>audio_%02d</name>
-          <direction>source</direction>
-          <presence>sometimes</presence>
-          <details>ANY</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>application/x-yuv4mpeg, y4mversion=(int)2</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_ac3</name>
-      <longname>FFMPEG AC-3 audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG ac3 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-ac3, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_adpcm_adx</name>
-      <longname>FFMPEG ADX ADPCM encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG adpcm_adx encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)adx</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_adpcm_ima_qt</name>
-      <longname>FFMPEG IMA/Quicktime ADPCM audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG adpcm_ima_qt encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)quicktime</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_adpcm_ima_wav</name>
-      <longname>FFMPEG IMA/DVI ADPCM audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG adpcm_ima_wav encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)dvi</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_adpcm_ms</name>
-      <longname>FFMPEG Microsoft ADPCM audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG adpcm_ms encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)microsoft</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_adpcm_swf</name>
-      <longname>FFMPEG Shockwave ADPCM encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG adpcm_swf encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)swf</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_adpcm_yamaha</name>
-      <longname>FFMPEG Yamaha ADPCM encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG adpcm_yamaha encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)yamaha</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_asv1</name>
-      <longname>FFMPEG Asus video v1 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG asv1 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-asus, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], asusversion=(int)1</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_asv2</name>
-      <longname>FFMPEG Asus video v2 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG asv2 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-asus, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], asusversion=(int)2</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_bmp</name>
-      <longname>FFMPEG BMP bitmap encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG bmp encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>image/bmp</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_dvvideo</name>
-      <longname>FFMPEG Digital video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG dvvideo encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-dv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_ffv1</name>
-      <longname>FFMPEG FFMpeg video v1 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG ffv1 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-ffv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], ffvversion=(int)1</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_ffvhuff</name>
-      <longname>FFMPEG FFMPEG non-compliant Huffyuv video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG ffvhuff encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-ffvhuff, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_flashsv</name>
-      <longname>FFMPEG Flash Screen Video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG flashsv encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-flash-screen, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_flv</name>
-      <longname>FFMPEG FLV video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG flv encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-flash-video, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], flvversion=(int)1</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_g726</name>
-      <longname>FFMPEG G.726 ADPCM encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG g726 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)g726</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_h261</name>
-      <longname>FFMPEG H.261 video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG h261 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-h261, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_h263</name>
-      <longname>FFMPEG H.263 video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG h263 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-h263, width=(int)352, height=(int)288, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)704, height=(int)576, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)176, height=(int)144, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)1408, height=(int)1152, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)128, height=(int)96, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_h263p</name>
-      <longname>FFMPEG H.263 (P) video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG h263p encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263p</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_huffyuv</name>
-      <longname>FFMPEG Huffyuv lossless video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG huffyuv encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-huffyuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_ljpeg</name>
-      <longname>FFMPEG Lossless JPEG encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG ljpeg encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_mjpeg</name>
-      <longname>FFMPEG Motion-JPEG encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG mjpeg encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_mp2</name>
-      <longname>FFMPEG MPEG-1 layer 2 audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG mp2 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)2</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_mpeg1video</name>
-      <longname>FFMPEG MPEG-1 video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG mpeg1video encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)1, systemstream=(boolean)false</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_mpeg2video</name>
-      <longname>FFMPEG MPEG-2 video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG mpeg2video encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)2, systemstream=(boolean)false</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_mpeg4</name>
-      <longname>FFMPEG MPEG-4 compatible video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG mpeg4 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)4, systemstream=(boolean)false; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], divxversion=(int)5</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_msmpeg4</name>
-      <longname>FFMPEG Microsoft MPEG-4 v3 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG msmpeg4 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msmpegversion=(int)43</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_msmpeg4v1</name>
-      <longname>FFMPEG Microsoft MPEG-4 v1 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG msmpeg4v1 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msmpegversion=(int)41</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_msmpeg4v2</name>
-      <longname>FFMPEG Microsoft MPEG-4 v2 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG msmpeg4v2 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msmpegversion=(int)42</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_pam</name>
-      <longname>FFMPEG PAM image encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG pam encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-pam, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_pbm</name>
-      <longname>FFMPEG PBM image encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG pbm encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>image/pbm, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_pgm</name>
-      <longname>FFMPEG PGM image encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG pgm encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-pgm, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_pgmyuv</name>
-      <longname>FFMPEG PGM-YUV image encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG pgmyuv encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-pgmyuv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_png</name>
-      <longname>FFMPEG PNG image encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG png encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>image/png, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_ppm</name>
-      <longname>FFMPEG PPM image encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG ppm encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>image/ppm, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_qtrle</name>
-      <longname>FFMPEG Quicktime RLE animation video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG qtrle encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-rle, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], layout=(string)quicktime, depth=(int)[ 1, 64 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_roq_dpcm</name>
-      <longname>FFMPEG RoQ DPCM audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG roq_dpcm encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-dpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)roq</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_roqvideo</name>
-      <longname>FFMPEG ID/RoQ video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG roqvideo encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-roqvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_rv10</name>
-      <longname>FFMPEG Realvideo 1.0 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG rv10 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-pn-realvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false, rmversion=(int)1</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_rv20</name>
-      <longname>FFMPEG Realvideo 2.0 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG rv20 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-pn-realvideo, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false, rmversion=(int)2</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_snow</name>
-      <longname>FFMPEG Snow wave video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG snow encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-snow, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_sonic</name>
-      <longname>FFMPEG Sonic audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG sonic encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-sonic, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_sonicls</name>
-      <longname>FFMPEG Sonic lossless audio encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG sonicls encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-gst_ff-sonicls, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_svq1</name>
-      <longname>FFMPEG Sorensen-1 video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG svq1 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-svq, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], svqversion=(int)1</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_wmav1</name>
-      <longname>FFMPEG Windows Media Audio v7 encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG wmav1 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-wma, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], wmaversion=(int)1, block_align=(int)[ 0, 2147483647 ], bitrate=(int)[ 0, 2147483647 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_wmav2</name>
-      <longname>FFMPEG Windows Media Audio v8/9 encoder</longname>
-      <class>Codec/Encoder/Audio</class>
-      <description>FFMPEG wmav2 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>audio/x-wma, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], wmaversion=(int)2, block_align=(int)[ 0, 2147483647 ], bitrate=(int)[ 0, 2147483647 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], signed=(boolean)true, endianness=(int)1234, width=(int)16, depth=(int)16</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_wmv1</name>
-      <longname>FFMPEG Windows Media Video v7 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG wmv1 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)1</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_wmv2</name>
-      <longname>FFMPEG Windows Media Video v8 encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG wmv2 encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)2</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffenc_zmbv</name>
-      <longname>FFMPEG Zip Motion Blocks Video encoder</longname>
-      <class>Codec/Encoder/Video</class>
-      <description>FFMPEG zmbv encoder</description>
-      <author>Wim Taymans &lt;wim.taymans@gmail.com&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-gst_ff-zmbv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-        <caps>
-          <name>sink</name>
-          <direction>sink</direction>
-          <presence>always</presence>
-          <details>video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_3g2</name>
-      <longname>FFMPEG 3g2 Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG 3g2 Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-3g2</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/AMR, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/AMR-WB, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)4</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)4, systemstream=(boolean)false; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], divxversion=(int)5; video/x-h263, width=(int)352, height=(int)288, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)704, height=(int)576, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)176, height=(int)144, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)1408, height=(int)1152, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)128, height=(int)96, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263p; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_3gp</name>
-      <longname>FFMPEG 3gp Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG 3gp Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>application/x-3gp</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/AMR, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/AMR-WB, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)4</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)4, systemstream=(boolean)false; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], divxversion=(int)5; video/x-h263, width=(int)352, height=(int)288, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)704, height=(int)576, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)176, height=(int)144, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)1408, height=(int)1152, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)128, height=(int)96, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263p; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_amr</name>
-      <longname>FFMPEG amr Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG amr Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-amr</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/AMR, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/AMR-WB, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_asf</name>
-      <longname>FFMPEG asf Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG asf Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-ms-asf</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/x-wma, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], wmaversion=(int)1, block_align=(int)[ 0, 2147483647 ], bitrate=(int)[ 0, 2147483647 ]; audio/x-wma, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], wmaversion=(int)2, block_align=(int)[ 0, 2147483647 ], bitrate=(int)[ 0, 2147483647 ]; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)3</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)1; video/x-wmv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], wmvversion=(int)2; video/x-msmpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], msmpegversion=(int)43</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_dv</name>
-      <longname>FFMPEG dv Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG dv Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-dv, systemstream=(boolean)true</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], width=(int)16, depth=(int)16, endianness=(int)1234, signed=(boolean)true</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/x-dv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_flv</name>
-      <longname>FFMPEG flv Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG flv Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/x-flv</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/mpeg, rate=(int){ 44100, 22050, 11025 }, channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)3</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/x-flash-video, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], flvversion=(int)1</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_gif</name>
-      <longname>FFMPEG gif Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG gif Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>image/gif</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/x-raw-rgb, bpp=(int)24, depth=(int)24</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_mmf</name>
-      <longname>FFMPEG mmf Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG mmf Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-mmf</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)yamaha</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_mov</name>
-      <longname>FFMPEG mov Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG mov Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/quicktime</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/x-mulaw, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-alaw, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-adpcm, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], layout=(string)quicktime; audio/x-mace, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], maceversion=(int)3; audio/x-mace, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], maceversion=(int)6; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)4; audio/AMR, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/AMR-WB, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], width=(int)16, depth=(int)16, endianness=(int)4321, signed=(boolean)true; audio/x-raw-int, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], width=(int)16, depth=(int)16, endianness=(int)1234, signed=(boolean)true; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)3</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/x-svq, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], svqversion=(int)1; video/x-svq, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], svqversion=(int)3; video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)4, systemstream=(boolean)false; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], divxversion=(int)5; video/x-h263, width=(int)352, height=(int)288, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)704, height=(int)576, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)176, height=(int)144, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)1408, height=(int)1152, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)128, height=(int)96, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263p; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-dv, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], systemstream=(boolean)false; image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_mp4</name>
-      <longname>FFMPEG mp4 Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG mp4 Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/quicktime</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)4; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)3; audio/AMR, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/AMR-WB, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)4, systemstream=(boolean)false; video/x-divx, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], divxversion=(int)5; video/x-h263, width=(int)352, height=(int)288, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)704, height=(int)576, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)176, height=(int)144, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)1408, height=(int)1152, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h263, width=(int)128, height=(int)96, framerate=(fraction)[ 0/1, 2147483647/1 ], variant=(string)itu, h263version=(string)h263; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_mpeg</name>
-      <longname>FFMPEG mpeg Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG mpeg Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/mpeg, systemstream=(boolean)true</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)2; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)3</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)1, systemstream=(boolean)false; video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)2, systemstream=(boolean)false; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_mpegts</name>
-      <longname>FFMPEG mpegts Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG mpegts Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>video/mpegts, systemstream=(boolean)true</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)2; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)3; audio/x-ac3, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-dts, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)4</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)1, systemstream=(boolean)false; video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)2, systemstream=(boolean)false; video/x-h264, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
-        </caps>
-      </pads>
-    </element>
-    <element>
-      <name>ffmux_vob</name>
-      <longname>FFMPEG vob Muxer</longname>
-      <class>Codec/Muxer</class>
-      <description>FFMPEG vob Muxer</description>
-      <author>Wim Taymans &lt;wim.taymans@chello.be&gt;, Ronald Bultje &lt;rbultje@ronald.bitfreak.net&gt;</author>
-      <pads>
-        <caps>
-          <name>src</name>
-          <direction>source</direction>
-          <presence>always</presence>
-          <details>application/x-gst_ff-vob</details>
-        </caps>
-        <caps>
-          <name>audio_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>audio/mpeg, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ], mpegversion=(int)1, layer=(int)2; audio/x-ac3, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-dts, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]</details>
-        </caps>
-        <caps>
-          <name>video_%d</name>
-          <direction>sink</direction>
-          <presence>request</presence>
-          <details>video/mpeg, width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ], mpegversion=(int)2, systemstream=(boolean)false</details>
-        </caps>
-      </pads>
-    </element>
-  </elements>
-</plugin>
\ No newline at end of file
index 79a6898..286989f 100644 (file)
@@ -1,2 +1,2 @@
-<!ENTITY GST_MAJORMINOR "@GST_MAJORMINOR@">
+<!ENTITY GST_API_VERSION "@GST_API_VERSION@">
 <!ENTITY GST_VERSION "@VERSION@">
index d9ee1a3..ab2586b 100644 (file)
@@ -1,4 +1,4 @@
 SUBDIRS = ffmpeg libswscale
-if !GST_FFMPEG_ENABLE_LGPL
+if !GST_LIBAV_ENABLE_LGPL
     SUBDIRS += libpostproc
 endif
index 482807e..bae2a6d 100644 (file)
@@ -1,4 +1,4 @@
-plugin_LTLIBRARIES = libgstffmpeg.la
+plugin_LTLIBRARIES = libgstlibav.la
 
 if HAVE_BZ2
     BZ2_LIBS = -lbz2
@@ -6,7 +6,7 @@ else
     BZ2_LIBS =
 endif
 
-libgstffmpeg_la_SOURCES = gstffmpeg.c  \
+libgstlibav_la_SOURCES = gstffmpeg.c   \
                          gstffmpegprotocol.c   \
                          gstffmpegcodecmap.c   \
                          gstffmpegutils.c      \
@@ -15,18 +15,22 @@ libgstffmpeg_la_SOURCES = gstffmpeg.c       \
                          gstffmpegcfg.c        \
                          gstffmpegdemux.c      \
                          gstffmpegmux.c    \
-                         gstffmpegdeinterlace.c        \
-                         gstffmpegaudioresample.c
+                         gstffmpegdeinterlace.c
+#\
+#                        gstffmpegaudioresample.c
 #      \
 #                        gstffmpegscale.c
 
-libgstffmpeg_la_CFLAGS = $(FFMPEG_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
-libgstffmpeg_la_LIBADD = $(FFMPEG_LIBS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) -lgstpbutils-$(GST_MAJORMINOR) $(LIBM) $(WIN32_LIBS) -lz $(BZ2_LIBS)
-libgstffmpeg_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
-libgstffmpeg_la_LIBTOOLFLAGS = --tag=disable-static
+libgstlibav_la_CFLAGS = $(LIBAV_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
+libgstlibav_la_LIBADD = $(LIBAV_LIBS) $(GST_PLUGINS_BASE_LIBS) \
+       -lgstaudio-$(GST_API_VERSION) -lgstvideo-$(GST_API_VERSION) \
+       -lgstpbutils-$(GST_API_VERSION) $(GST_BASE_LIBS) \
+       $(LIBM) $(WIN32_LIBS) -lz $(BZ2_LIBS)
+libgstlibav_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
+libgstlibav_la_LIBTOOLFLAGS = --tag=disable-static
 
-if HAVE_FFMPEG_UNINSTALLED
-libgstffmpeg_la_DEPENDENCIES = $(FFMPEG_LIBS)
+if HAVE_LIBAV_UNINSTALLED
+libgstlibav_la_DEPENDENCIES = $(LIBAV_LIBS)
 endif
 
 
index 88a43bc..899d4be 100644 (file)
@@ -27,7 +27,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <gst/gst.h>
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #include <avformat.h>
 #else
@@ -128,7 +128,7 @@ gboolean _shut_up_I_am_probing = FALSE;
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (ffmpeg_debug, "ffmpeg", 0, "FFmpeg elements");
+  GST_DEBUG_CATEGORY_INIT (ffmpeg_debug, "libav", 0, "libav elements");
 #ifndef GST_DISABLE_GST_DEBUG
 
   av_log_set_callback (gst_ffmpeg_log_callback);
@@ -148,8 +148,8 @@ plugin_init (GstPlugin * plugin)
 #endif
 #if 0
   gst_ffmpegcsp_register (plugin);
-#endif
   gst_ffmpegaudioresample_register (plugin);
+#endif
 
   av_register_protocol2 (&gstreamer_protocol, sizeof (URLProtocol));
   av_register_protocol2 (&gstpipe_protocol, sizeof (URLProtocol));
@@ -160,12 +160,12 @@ plugin_init (GstPlugin * plugin)
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
-    "ffmpeg",
-    "All FFmpeg codecs and formats (" FFMPEG_SOURCE ")",
+    libav,
+    "All libav codecs and formats (" LIBAV_SOURCE ")",
     plugin_init, PACKAGE_VERSION,
-#ifdef GST_FFMPEG_ENABLE_LGPL
+#ifdef GST_LIBAV_ENABLE_LGPL
     "LGPL",
 #else
     "GPL",
 #endif
-    "FFmpeg", "http://ffmpeg.org/")
+    "libav", "http://www.libav.org")
index 667fa51..602e1f1 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __GST_FFMPEG_H__
 #define __GST_FFMPEG_H__
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #include <avformat.h>
 #else
index b63068d..b3b28a7 100644 (file)
@@ -24,7 +24,7 @@
 #include "config.h"
 #endif
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #else
 #include <libavcodec/avcodec.h>
@@ -71,14 +71,18 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS
-    ("audio/x-raw-int, endianness = (int) BYTE_ORDER, signed = (boolean) true, width = (int) 16, depth = (int) 16, channels = (int) { 1 , 2 }, rate = (int) [1, MAX ]")
+    ("audio/x-raw,"
+        "format = (string) " GST_AUDIO_NE (S16) ","
+        "channels = (int) { 1 , 2 }, rate = (int) [1, MAX ]")
     );
 
 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS
-    ("audio/x-raw-int, endianness = (int) BYTE_ORDER, signed = (boolean) true, width = (int) 16, depth = (int) 16, channels = (int) [ 1 , 6 ], rate = (int) [1, MAX ]")
+    ("audio/x-raw,"
+        "format = (string) " GST_AUDIO_NE (S16) ","
+        "channels = (int) { 1 , 2 }, rate = (int) [1, MAX ]")
     );
 
 GST_BOILERPLATE (GstFFMpegAudioResample, gst_ffmpegaudioresample,
@@ -89,10 +93,10 @@ static void gst_ffmpegaudioresample_finalize (GObject * object);
 static GstCaps *gst_ffmpegaudioresample_transform_caps (GstBaseTransform *
     trans, GstPadDirection direction, GstCaps * caps);
 static gboolean gst_ffmpegaudioresample_transform_size (GstBaseTransform *
-    trans, GstPadDirection direction, GstCaps * caps, guint size,
-    GstCaps * othercaps, guint * othersize);
+    trans, GstPadDirection direction, GstCaps * caps, gsize size,
+    GstCaps * othercaps, gsize * othersize);
 static gboolean gst_ffmpegaudioresample_get_unit_size (GstBaseTransform * trans,
-    GstCaps * caps, guint * size);
+    GstCaps * caps, gsize * size);
 static gboolean gst_ffmpegaudioresample_set_caps (GstBaseTransform * trans,
     GstCaps * incaps, GstCaps * outcaps);
 static GstFlowReturn gst_ffmpegaudioresample_transform (GstBaseTransform *
@@ -105,8 +109,8 @@ gst_ffmpegaudioresample_base_init (gpointer g_class)
 
   gst_element_class_add_static_pad_template (element_class, &src_factory);
   gst_element_class_add_static_pad_template (element_class, &sink_factory);
-  gst_element_class_set_details_simple (element_class,
-      "FFMPEG Audio resampling element", "Filter/Converter/Audio",
+  gst_element_class_set_static_metadata (element_class,
+      "libav Audio resampling element", "Filter/Converter/Audio",
       "Converts audio from one samplerate to another",
       "Edward Hervey <bilboed@bilboed.com>");
 }
@@ -172,8 +176,8 @@ gst_ffmpegaudioresample_transform_caps (GstBaseTransform * trans,
 
 static gboolean
 gst_ffmpegaudioresample_transform_size (GstBaseTransform * trans,
-    GstPadDirection direction, GstCaps * caps, guint size, GstCaps * othercaps,
-    guint * othersize)
+    GstPadDirection direction, GstCaps * caps, gsize size, GstCaps * othercaps,
+    gsize * othersize)
 {
   gint inrate, outrate;
   gint inchanns, outchanns;
@@ -205,7 +209,7 @@ gst_ffmpegaudioresample_transform_size (GstBaseTransform * trans,
 
 static gboolean
 gst_ffmpegaudioresample_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
-    guint * size)
+    gsize * size)
 {
   gint channels;
   GstStructure *structure;
@@ -264,26 +268,34 @@ gst_ffmpegaudioresample_transform (GstBaseTransform * trans, GstBuffer * inbuf,
   GstFFMpegAudioResample *resample = GST_FFMPEGAUDIORESAMPLE (trans);
   gint nbsamples;
   gint ret;
+  guint8 *indata, *outdata;
+  gsize insize, outsize;
 
-  gst_buffer_copy_metadata (outbuf, inbuf, GST_BUFFER_COPY_TIMESTAMPS);
-  nbsamples = GST_BUFFER_SIZE (inbuf) / (2 * resample->in_channels);
+  gst_buffer_copy_into (outbuf, inbuf, GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
+
+  indata = gst_buffer_map (inbuf, &insize, NULL, GST_MAP_READ);
+  nbsamples = insize / (2 * resample->in_channels);
 
   GST_LOG_OBJECT (resample, "input buffer duration:%" GST_TIME_FORMAT,
       GST_TIME_ARGS (GST_BUFFER_DURATION (inbuf)));
 
+  outdata = gst_buffer_map (outbuf, &outsize, NULL, GST_MAP_WRITE);
   GST_DEBUG_OBJECT (resample,
       "audio_resample(ctx, output:%p [size:%d], input:%p [size:%d], nbsamples:%d",
-      GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf),
-      GST_BUFFER_DATA (inbuf), GST_BUFFER_SIZE (inbuf), nbsamples);
+      outdata, outsize, indata, insize, nbsamples);
 
-  ret = audio_resample (resample->res, (short *) GST_BUFFER_DATA (outbuf),
-      (short *) GST_BUFFER_DATA (inbuf), nbsamples);
+  ret =
+      audio_resample (resample->res, (short *) outdata, (short *) indata,
+      nbsamples);
 
   GST_DEBUG_OBJECT (resample, "audio_resample returned %d", ret);
 
   GST_BUFFER_DURATION (outbuf) = gst_util_uint64_scale (ret, GST_SECOND,
       resample->out_rate);
-  GST_BUFFER_SIZE (outbuf) = ret * 2 * resample->out_channels;
+
+  outsize = ret * 2 * resample->out_channels;
+  gst_buffer_unmap (outbuf, outdata, outsize);
+  gst_buffer_unmap (inbuf, indata, insize);
 
   GST_LOG_OBJECT (resample, "Output buffer duration:%" GST_TIME_FORMAT,
       GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)));
@@ -294,6 +306,6 @@ gst_ffmpegaudioresample_transform (GstBaseTransform * trans, GstBuffer * inbuf,
 gboolean
 gst_ffmpegaudioresample_register (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "ffaudioresample",
+  return gst_element_register (plugin, "avaudioresample",
       GST_RANK_NONE, GST_TYPE_FFMPEGAUDIORESAMPLE);
 }
index 6b87cc3..cd3b589 100644 (file)
@@ -49,7 +49,7 @@ gst_ffmpeg_pass_get_type (void)
     };
 
     ffmpeg_pass_type =
-        g_enum_register_static ("GstFFMpegEncPass", ffmpeg_passes);
+        g_enum_register_static ("GstLibAVEncPass", ffmpeg_passes);
   }
 
   return ffmpeg_pass_type;
@@ -71,7 +71,7 @@ gst_ffmpeg_lim_pass_get_type (void)
     };
 
     ffmpeg_lim_pass_type =
-        g_enum_register_static ("GstFFMpegEncLimPass", ffmpeg_lim_passes);
+        g_enum_register_static ("GstLibAVEncLimPass", ffmpeg_lim_passes);
   }
 
   return ffmpeg_lim_pass_type;
@@ -94,7 +94,7 @@ gst_ffmpeg_mb_decision_get_type (void)
     };
 
     ffmpeg_mb_decision_type =
-        g_enum_register_static ("GstFFMpegEncMBDecision", ffmpeg_mb_decisions);
+        g_enum_register_static ("GstLibAVEncMBDecision", ffmpeg_mb_decisions);
   }
 
   return ffmpeg_mb_decision_type;
@@ -129,7 +129,7 @@ gst_ffmpeg_mb_cmp_get_type (void)
     };
 
     ffmpeg_mb_cmp_type =
-        g_enum_register_static ("GstFFMpegCMPFunction", ffmpeg_mb_cmps);
+        g_enum_register_static ("GstLibAVCMPFunction", ffmpeg_mb_cmps);
   }
 
   return ffmpeg_mb_cmp_type;
@@ -154,7 +154,7 @@ gst_ffmpeg_dct_algo_get_type (void)
     };
 
     ffmpeg_dct_algo_type =
-        g_enum_register_static ("GstFFMpegDCTAlgo", ffmpeg_dct_algos);
+        g_enum_register_static ("GstLibAVDCTAlgo", ffmpeg_dct_algos);
   }
 
   return ffmpeg_dct_algo_type;
@@ -187,7 +187,7 @@ gst_ffmpeg_idct_algo_get_type (void)
     };
 
     ffmpeg_idct_algo_type =
-        g_enum_register_static ("GstFFMpegIDCTAlgo", ffmpeg_idct_algos);
+        g_enum_register_static ("GstLibAVIDCTAlgo", ffmpeg_idct_algos);
   }
 
   return ffmpeg_idct_algo_type;
@@ -207,7 +207,7 @@ gst_ffmpeg_quant_type_get_type (void)
     };
 
     ffmpeg_quant_type_type =
-        g_enum_register_static ("GstFFMpegEncQuantTypes", ffmpeg_quant_types);
+        g_enum_register_static ("GstLibAVEncQuantTypes", ffmpeg_quant_types);
   }
 
   return ffmpeg_quant_type_type;
@@ -228,7 +228,7 @@ gst_ffmpeg_pre_me_get_type (void)
     };
 
     ffmpeg_pre_me_type =
-        g_enum_register_static ("GstFFMpegEncPreME", ffmpeg_pre_mes);
+        g_enum_register_static ("GstLibAVEncPreME", ffmpeg_pre_mes);
   }
 
   return ffmpeg_pre_me_type;
@@ -249,7 +249,7 @@ gst_ffmpeg_pred_method_get_type (void)
     };
 
     ffmpeg_pred_method =
-        g_enum_register_static ("GstFFMpegEncPredMethod", ffmpeg_pred_methods);
+        g_enum_register_static ("GstLibAVEncPredMethod", ffmpeg_pred_methods);
   }
 
   return ffmpeg_pred_method;
@@ -293,8 +293,7 @@ gst_ffmpeg_flags_get_type (void)
       {0, NULL, NULL},
     };
 
-    ffmpeg_flags_type =
-        g_flags_register_static ("GstFFMpegFlags", ffmpeg_flags);
+    ffmpeg_flags_type = g_flags_register_static ("GstLibAVFlags", ffmpeg_flags);
   }
 
   return ffmpeg_flags_type;
index 3759a35..5d214ed 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 #include <gst/gst.h>
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #else
 #include <libavcodec/avcodec.h>
@@ -33,6 +33,8 @@
 #include "gstffmpeg.h"
 #include "gstffmpegcodecmap.h"
 
+#include <gst/video/video.h>
+#include <gst/audio/audio.h>
 #include <gst/pbutils/codec-utils.h>
 
 /*
@@ -44,17 +46,17 @@ gst_ffmpeg_get_palette (const GstCaps * caps, AVCodecContext * context)
 {
   GstStructure *str = gst_caps_get_structure (caps, 0);
   const GValue *palette_v;
-  const GstBuffer *palette;
+  GstBuffer *palette;
 
   /* do we have a palette? */
   if ((palette_v = gst_structure_get_value (str, "palette_data")) && context) {
     palette = gst_value_get_buffer (palette_v);
-    if (GST_BUFFER_SIZE (palette) >= AVPALETTE_SIZE) {
+    if (gst_buffer_get_size (palette) >= AVPALETTE_SIZE) {
       if (context->palctrl)
         av_free (context->palctrl);
       context->palctrl = av_malloc (sizeof (AVPaletteControl));
       context->palctrl->palette_changed = 1;
-      memcpy (context->palctrl->palette, GST_BUFFER_DATA (palette),
+      gst_buffer_extract (palette, 0, context->palctrl->palette,
           AVPALETTE_SIZE);
     }
   }
@@ -66,8 +68,7 @@ gst_ffmpeg_set_palette (GstCaps * caps, AVCodecContext * context)
   if (context->palctrl) {
     GstBuffer *palette = gst_buffer_new_and_alloc (AVPALETTE_SIZE);
 
-    memcpy (GST_BUFFER_DATA (palette), context->palctrl->palette,
-        AVPALETTE_SIZE);
+    gst_buffer_fill (palette, 0, context->palctrl->palette, AVPALETTE_SIZE);
     gst_caps_set_simple (caps, "palette_data", GST_TYPE_BUFFER, palette, NULL);
   }
 }
@@ -82,7 +83,7 @@ static const struct
   CH_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT}, {
   CH_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}, {
   CH_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER}, {
-  CH_LOW_FREQUENCY, GST_AUDIO_CHANNEL_POSITION_LFE}, {
+  CH_LOW_FREQUENCY, GST_AUDIO_CHANNEL_POSITION_LFE1}, {
   CH_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_REAR_LEFT}, {
   CH_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT}, {
   CH_FRONT_LEFT_OF_CENTER, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER}, {
@@ -90,58 +91,63 @@ static const struct
   CH_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_REAR_CENTER}, {
   CH_SIDE_LEFT, GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT}, {
   CH_SIDE_RIGHT, GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT}, {
-  CH_TOP_CENTER, GST_AUDIO_CHANNEL_POSITION_NONE}, {
-  CH_TOP_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_NONE}, {
-  CH_TOP_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_NONE}, {
-  CH_TOP_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_NONE}, {
-  CH_TOP_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_NONE}, {
-  CH_TOP_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_NONE}, {
-  CH_TOP_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_NONE}, {
+  CH_TOP_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_CENTER}, {
+  CH_TOP_FRONT_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT}, {
+  CH_TOP_FRONT_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER}, {
+  CH_TOP_FRONT_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT}, {
+  CH_TOP_BACK_LEFT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT}, {
+  CH_TOP_BACK_CENTER, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER}, {
+  CH_TOP_BACK_RIGHT, GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT}, {
   CH_STEREO_LEFT, GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT}, {
   CH_STEREO_RIGHT, GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}
 };
 
-static GstAudioChannelPosition *
-gst_ff_channel_layout_to_gst (guint64 channel_layout, guint channels)
+gboolean
+gst_ffmpeg_channel_layout_to_gst (AVCodecContext * context,
+    GstAudioChannelPosition * pos)
 {
-  guint nchannels = 0, i, j;
-  GstAudioChannelPosition *pos = NULL;
+  guint nchannels = 0, channels = context->channels;
+  guint64 channel_layout = context->channel_layout;
   gboolean none_layout = FALSE;
 
-  for (i = 0; i < 64; i++) {
-    if ((channel_layout & (G_GUINT64_CONSTANT (1) << i)) != 0) {
-      nchannels++;
-    }
-  }
-
   if (channel_layout == 0) {
     nchannels = channels;
     none_layout = TRUE;
-  }
+  } else {
+    guint i, j;
 
-  if (nchannels != channels) {
-    GST_ERROR ("Number of channels is different (%u != %u)", channels,
-        nchannels);
-    return NULL;
-  }
+    for (i = 0; i < 64; i++) {
+      if ((channel_layout & (G_GUINT64_CONSTANT (1) << i)) != 0) {
+        nchannels++;
+      }
+    }
 
-  pos = g_new (GstAudioChannelPosition, nchannels);
+    if (nchannels != channels) {
+      GST_ERROR ("Number of channels is different (%u != %u)", channels,
+          nchannels);
+      nchannels = channels;
+      none_layout = TRUE;
+    } else {
 
-  for (i = 0, j = 0; i < G_N_ELEMENTS (_ff_to_gst_layout); i++) {
-    if ((channel_layout & _ff_to_gst_layout[i].ff) != 0) {
-      pos[j++] = _ff_to_gst_layout[i].gst;
+      for (i = 0, j = 0; i < G_N_ELEMENTS (_ff_to_gst_layout); i++) {
+        if ((channel_layout & _ff_to_gst_layout[i].ff) != 0) {
+          pos[j++] = _ff_to_gst_layout[i].gst;
 
-      if (_ff_to_gst_layout[i].gst == GST_AUDIO_CHANNEL_POSITION_NONE)
+          if (_ff_to_gst_layout[i].gst == GST_AUDIO_CHANNEL_POSITION_NONE)
+            none_layout = TRUE;
+        }
+      }
+
+      if (j != nchannels) {
+        GST_WARNING
+            ("Unknown channels in channel layout - assuming NONE layout");
         none_layout = TRUE;
+      }
     }
   }
 
-  if (j != nchannels) {
-    GST_WARNING ("Unknown channels in channel layout - assuming NONE layout");
-    none_layout = TRUE;
-  }
-
-  if (!none_layout && !gst_audio_check_channel_positions (pos, nchannels)) {
+  if (!none_layout
+      && !gst_audio_check_valid_channel_positions (pos, nchannels, FALSE)) {
     GST_ERROR ("Invalid channel layout %" G_GUINT64_FORMAT
         " - assuming NONE layout", channel_layout);
     none_layout = TRUE;
@@ -149,31 +155,19 @@ gst_ff_channel_layout_to_gst (guint64 channel_layout, guint channels)
 
   if (none_layout) {
     if (nchannels == 1) {
-      pos[0] = GST_AUDIO_CHANNEL_POSITION_FRONT_MONO;
+      pos[0] = GST_AUDIO_CHANNEL_POSITION_MONO;
     } else if (nchannels == 2) {
       pos[0] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
       pos[1] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
-    } else if (channel_layout == 0) {
-      g_free (pos);
-      pos = NULL;
     } else {
+      guint i;
+
       for (i = 0; i < nchannels; i++)
         pos[i] = GST_AUDIO_CHANNEL_POSITION_NONE;
     }
   }
 
-  if (nchannels == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER) {
-    GST_DEBUG ("mono common case; won't set channel positions");
-    g_free (pos);
-    pos = NULL;
-  } else if (nchannels == 2 && pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT
-      && pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT) {
-    GST_DEBUG ("stereo common case; won't set channel positions");
-    g_free (pos);
-    pos = NULL;
-  }
-
-  return pos;
+  return TRUE;
 }
 
 /* this macro makes a caps width fixed or unfixed width/height
@@ -308,10 +302,7 @@ gst_ff_vid_caps_new (AVCodecContext * context, enum CodecID codec_id,
    * default unfixed setting */
   if (!caps) {
     GST_DEBUG ("Creating default caps");
-    caps = gst_caps_new_simple (mimetype,
-        "width", GST_TYPE_INT_RANGE, 16, 4096,
-        "height", GST_TYPE_INT_RANGE, 16, 4096,
-        "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
+    caps = gst_caps_new_simple (mimetype, NULL, NULL, NULL);
   }
 
   for (i = 0; i < gst_caps_get_size (caps); i++) {
@@ -337,17 +328,19 @@ gst_ff_aud_caps_new (AVCodecContext * context, enum CodecID codec_id,
 
   /* fixed, non-probing context */
   if (context != NULL && context->channels != -1) {
-    GstAudioChannelPosition *pos;
-    guint64 channel_layout = context->channel_layout;
+    GstAudioChannelPosition pos[64];
 
     caps = gst_caps_new_simple (mimetype,
         "rate", G_TYPE_INT, context->sample_rate,
         "channels", G_TYPE_INT, context->channels, NULL);
 
-    pos = gst_ff_channel_layout_to_gst (channel_layout, context->channels);
-    if (pos != NULL) {
-      gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos);
-      g_free (pos);
+    if (gst_ffmpeg_channel_layout_to_gst (context, pos)) {
+      guint64 mask;
+
+      if (gst_audio_channel_positions_to_mask (pos, context->channels, &mask)) {
+        gst_caps_set_simple (caps, "channel-mask", GST_TYPE_BITMASK, mask,
+            NULL);
+      }
     }
   } else {
     gint maxchannels = 2;
@@ -804,37 +797,37 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
     case CODEC_ID_DVVIDEO:
     {
       if (encode && context) {
-        guint32 fourcc;
+        const gchar *format;
 
         switch (context->pix_fmt) {
           case PIX_FMT_YUYV422:
-            fourcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2');
+            format = "YUY2";
             break;
           case PIX_FMT_YUV420P:
-            fourcc = GST_MAKE_FOURCC ('I', '4', '2', '0');
+            format = "I420";
             break;
           case PIX_FMT_YUVA420P:
-            fourcc = GST_MAKE_FOURCC ('A', '4', '2', '0');
+            format = "A420";
             break;
           case PIX_FMT_YUV411P:
-            fourcc = GST_MAKE_FOURCC ('Y', '4', '1', 'B');
+            format = "Y41B";
             break;
           case PIX_FMT_YUV422P:
-            fourcc = GST_MAKE_FOURCC ('Y', '4', '2', 'B');
+            format = "Y42B";
             break;
           case PIX_FMT_YUV410P:
-            fourcc = GST_MAKE_FOURCC ('Y', 'U', 'V', '9');
+            format = "YUV9";
             break;
           default:
             GST_WARNING
-                ("Couldnt' find fourcc for pixfmt %d, defaulting to I420",
+                ("Couldnt' find format for pixfmt %d, defaulting to I420",
                 context->pix_fmt);
-            fourcc = GST_MAKE_FOURCC ('I', '4', '2', '0');
+            format = "I420";
             break;
         }
         caps = gst_ff_vid_caps_new (context, codec_id, "video/x-dv",
             "systemstream", G_TYPE_BOOLEAN, FALSE,
-            "format", GST_TYPE_FOURCC, fourcc, NULL);
+            "format", G_TYPE_STRING, format, NULL);
       } else {
         caps = gst_ff_vid_caps_new (context, codec_id, "video/x-dv",
             "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
@@ -1092,8 +1085,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
       break;
     case CODEC_ID_VC1:
       caps = gst_ff_vid_caps_new (context, codec_id, "video/x-wmv",
-          "wmvversion", G_TYPE_INT, 3, "format", GST_TYPE_FOURCC,
-          GST_MAKE_FOURCC ('W', 'V', 'C', '1'), NULL);
+          "wmvversion", G_TYPE_INT, 3, "format", G_TYPE_STRING, "WVC1", NULL);
       break;
     case CODEC_ID_QDM2:
       caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-qdm2", NULL);
@@ -1278,56 +1270,35 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
     case CODEC_ID_PCM_S8:
     case CODEC_ID_PCM_U8:
     {
-      gint width = 0, depth = 0, endianness = 0;
-      gboolean signedness = FALSE;      /* blabla */
+      GstAudioFormat format;
 
       switch (codec_id) {
         case CODEC_ID_PCM_S16LE:
-          width = 16;
-          depth = 16;
-          endianness = G_LITTLE_ENDIAN;
-          signedness = TRUE;
+          format = GST_AUDIO_FORMAT_S16LE;
           break;
         case CODEC_ID_PCM_S16BE:
-          width = 16;
-          depth = 16;
-          endianness = G_BIG_ENDIAN;
-          signedness = TRUE;
+          format = GST_AUDIO_FORMAT_S16BE;
           break;
         case CODEC_ID_PCM_U16LE:
-          width = 16;
-          depth = 16;
-          endianness = G_LITTLE_ENDIAN;
-          signedness = FALSE;
+          format = GST_AUDIO_FORMAT_U16LE;
           break;
         case CODEC_ID_PCM_U16BE:
-          width = 16;
-          depth = 16;
-          endianness = G_BIG_ENDIAN;
-          signedness = FALSE;
+          format = GST_AUDIO_FORMAT_U16BE;
           break;
         case CODEC_ID_PCM_S8:
-          width = 8;
-          depth = 8;
-          endianness = G_BYTE_ORDER;
-          signedness = TRUE;
+          format = GST_AUDIO_FORMAT_S8;
           break;
         case CODEC_ID_PCM_U8:
-          width = 8;
-          depth = 8;
-          endianness = G_BYTE_ORDER;
-          signedness = FALSE;
+          format = GST_AUDIO_FORMAT_U8;
           break;
         default:
           g_assert (0);         /* don't worry, we never get here */
           break;
       }
 
-      caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-raw-int",
-          "width", G_TYPE_INT, width,
-          "depth", G_TYPE_INT, depth,
-          "endianness", G_TYPE_INT, endianness,
-          "signed", G_TYPE_BOOLEAN, signedness, NULL);
+      caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-raw",
+          "format", G_TYPE_STRING, gst_audio_format_to_string (format),
+          "layout", G_TYPE_STRING, "interleaved", NULL);
     }
       break;
 
@@ -1592,7 +1563,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
       break;
 
     case CODEC_ID_SHORTEN:
-      caps = gst_caps_new_simple ("audio/x-shorten", NULL);
+      caps = gst_caps_new_empty_simple ("audio/x-shorten");
       break;
 
     case CODEC_ID_ALAC:
@@ -1607,7 +1578,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
       /* Note that ffmpeg has no encoder yet, but just for safety. In the
        * encoder case, we want to add things like samplerate, channels... */
       if (!encode) {
-        caps = gst_caps_new_simple ("audio/x-flac", NULL);
+        caps = gst_caps_new_empty_simple ("audio/x-flac");
       }
       break;
 
@@ -1616,7 +1587,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
       caps = NULL;
       break;
     case CODEC_ID_BMP:
-      caps = gst_caps_new_simple ("image/bmp", NULL);
+      caps = gst_caps_new_empty_simple ("image/bmp");
       break;
     case CODEC_ID_TTA:
       caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-tta", NULL);
@@ -1669,8 +1640,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
     if (context && context->extradata_size > 0) {
       GstBuffer *data = gst_buffer_new_and_alloc (context->extradata_size);
 
-      memcpy (GST_BUFFER_DATA (data), context->extradata,
-          context->extradata_size);
+      gst_buffer_fill (data, 0, context->extradata, context->extradata_size);
       gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, data, NULL);
       gst_buffer_unref (data);
     }
@@ -1689,141 +1659,89 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
   return caps;
 }
 
-/* Convert a FFMPEG Pixel Format and optional AVCodecContext
- * to a GstCaps. If the context is ommitted, no fixed values
- * for video/audio size will be included in the GstCaps
- *
- * See below for usefullness
- */
-
-GstCaps *
-gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context,
-    enum CodecID codec_id)
+/* Convert a FFMPEG Pixel Format to a GStreamer VideoFormat */
+GstVideoFormat
+gst_ffmpeg_pixfmt_to_video_format (enum PixelFormat pix_fmt)
 {
-  GstCaps *caps = NULL;
-
-  int bpp = 0, depth = 0, endianness = 0;
-  gulong g_mask = 0, r_mask = 0, b_mask = 0, a_mask = 0;
-  guint32 fmt = 0;
+  GstVideoFormat fmt;
 
   switch (pix_fmt) {
     case PIX_FMT_YUVJ420P:
     case PIX_FMT_YUV420P:
-      fmt = GST_MAKE_FOURCC ('I', '4', '2', '0');
+      fmt = GST_VIDEO_FORMAT_I420;
       break;
     case PIX_FMT_YUVA420P:
-      fmt = GST_MAKE_FOURCC ('A', '4', '2', '0');
+      fmt = GST_VIDEO_FORMAT_A420;
       break;
     case PIX_FMT_YUYV422:
-      fmt = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2');
+      fmt = GST_VIDEO_FORMAT_YUY2;
       break;
     case PIX_FMT_RGB24:
-      bpp = depth = 24;
-      endianness = G_BIG_ENDIAN;
-      r_mask = 0xff0000;
-      g_mask = 0x00ff00;
-      b_mask = 0x0000ff;
+      fmt = GST_VIDEO_FORMAT_RGB;
       break;
     case PIX_FMT_BGR24:
-      bpp = depth = 24;
-      endianness = G_BIG_ENDIAN;
-      r_mask = 0x0000ff;
-      g_mask = 0x00ff00;
-      b_mask = 0xff0000;
+      fmt = GST_VIDEO_FORMAT_BGR;
       break;
     case PIX_FMT_YUVJ422P:
     case PIX_FMT_YUV422P:
-      fmt = GST_MAKE_FOURCC ('Y', '4', '2', 'B');
+      fmt = GST_VIDEO_FORMAT_Y42B;
       break;
     case PIX_FMT_YUVJ444P:
     case PIX_FMT_YUV444P:
-      fmt = GST_MAKE_FOURCC ('Y', '4', '4', '4');
+      fmt = GST_VIDEO_FORMAT_Y444;
       break;
     case PIX_FMT_RGB32:
-      bpp = 32;
-      depth = 32;
-      endianness = G_BIG_ENDIAN;
 #if (G_BYTE_ORDER == G_BIG_ENDIAN)
-      r_mask = 0x00ff0000;
-      g_mask = 0x0000ff00;
-      b_mask = 0x000000ff;
-      a_mask = 0xff000000;
+      fmt = GST_VIDEO_FORMAT_xRGB;
 #else
-      r_mask = 0x0000ff00;
-      g_mask = 0x00ff0000;
-      b_mask = 0xff000000;
-      a_mask = 0x000000ff;
+      fmt = GST_VIDEO_FORMAT_BGRx;
 #endif
       break;
     case PIX_FMT_YUV410P:
-      fmt = GST_MAKE_FOURCC ('Y', 'U', 'V', '9');
+      fmt = GST_VIDEO_FORMAT_YUV9;
       break;
     case PIX_FMT_YUV411P:
-      fmt = GST_MAKE_FOURCC ('Y', '4', '1', 'B');
+      fmt = GST_VIDEO_FORMAT_Y41B;
       break;
     case PIX_FMT_RGB565:
-      bpp = depth = 16;
-      endianness = G_BYTE_ORDER;
-      r_mask = 0xf800;
-      g_mask = 0x07e0;
-      b_mask = 0x001f;
+      fmt = GST_VIDEO_FORMAT_RGB16;
       break;
     case PIX_FMT_RGB555:
-      bpp = 16;
-      depth = 15;
-      endianness = G_BYTE_ORDER;
-      r_mask = 0x7c00;
-      g_mask = 0x03e0;
-      b_mask = 0x001f;
+      fmt = GST_VIDEO_FORMAT_RGB15;
       break;
     case PIX_FMT_PAL8:
-      bpp = depth = 8;
-      endianness = G_BYTE_ORDER;
+      fmt = GST_VIDEO_FORMAT_RGB8_PALETTED;
       break;
     case PIX_FMT_GRAY8:
-      bpp = depth = 8;
-      caps = gst_ff_vid_caps_new (context, codec_id, "video/x-raw-gray",
-          "bpp", G_TYPE_INT, bpp, "depth", G_TYPE_INT, depth, NULL);
+      fmt = GST_VIDEO_FORMAT_GRAY8;
       break;
     default:
       /* give up ... */
+      fmt = GST_VIDEO_FORMAT_UNKNOWN;
       break;
   }
+  return fmt;
+}
 
-  if (caps == NULL) {
-    if (bpp != 0) {
-      if (r_mask != 0) {
-        if (a_mask) {
-          caps = gst_ff_vid_caps_new (context, codec_id, "video/x-raw-rgb",
-              "bpp", G_TYPE_INT, bpp,
-              "depth", G_TYPE_INT, depth,
-              "red_mask", G_TYPE_INT, r_mask,
-              "green_mask", G_TYPE_INT, g_mask,
-              "blue_mask", G_TYPE_INT, b_mask,
-              "alpha_mask", G_TYPE_INT, a_mask,
-              "endianness", G_TYPE_INT, endianness, NULL);
-        } else {
-          caps = gst_ff_vid_caps_new (context, codec_id, "video/x-raw-rgb",
-              "bpp", G_TYPE_INT, bpp,
-              "depth", G_TYPE_INT, depth,
-              "red_mask", G_TYPE_INT, r_mask,
-              "green_mask", G_TYPE_INT, g_mask,
-              "blue_mask", G_TYPE_INT, b_mask,
-              "endianness", G_TYPE_INT, endianness, NULL);
-        }
-      } else {
-        caps = gst_ff_vid_caps_new (context, codec_id, "video/x-raw-rgb",
-            "bpp", G_TYPE_INT, bpp,
-            "depth", G_TYPE_INT, depth,
-            "endianness", G_TYPE_INT, endianness, NULL);
-        if (caps && context) {
-          gst_ffmpeg_set_palette (caps, context);
-        }
-      }
-    } else if (fmt) {
-      caps = gst_ff_vid_caps_new (context, codec_id, "video/x-raw-yuv",
-          "format", GST_TYPE_FOURCC, fmt, NULL);
-    }
+/* Convert a FFMPEG Pixel Format and optional AVCodecContext
+ * to a GstCaps. If the context is ommitted, no fixed values
+ * for video/audio size will be included in the GstCaps
+ *
+ * See below for usefullness
+ */
+
+GstCaps *
+gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context,
+    enum CodecID codec_id)
+{
+  GstCaps *caps = NULL;
+  GstVideoFormat format;
+
+  format = gst_ffmpeg_pixfmt_to_video_format (pix_fmt);
+
+  if (format != GST_VIDEO_FORMAT_UNKNOWN) {
+    caps = gst_ff_vid_caps_new (context, codec_id, "video/x-raw",
+        "format", G_TYPE_STRING, gst_video_format_to_string (format), NULL);
   }
 
   if (caps != NULL) {
@@ -1847,50 +1765,31 @@ gst_ffmpeg_smpfmt_to_caps (enum SampleFormat sample_fmt,
     AVCodecContext * context, enum CodecID codec_id)
 {
   GstCaps *caps = NULL;
-
-  int bpp = 0;
-  gboolean integer = TRUE;
-  gboolean signedness = FALSE;
+  GstAudioFormat format;
 
   switch (sample_fmt) {
     case SAMPLE_FMT_S16:
-      signedness = TRUE;
-      bpp = 16;
+      format = GST_AUDIO_FORMAT_S16;
       break;
-
     case SAMPLE_FMT_S32:
-      signedness = TRUE;
-      bpp = 32;
+      format = GST_AUDIO_FORMAT_S32;
       break;
-
     case SAMPLE_FMT_FLT:
-      integer = FALSE;
-      bpp = 32;
+      format = GST_AUDIO_FORMAT_F32;
       break;
-
     case SAMPLE_FMT_DBL:
-      integer = FALSE;
-      bpp = 64;
+      format = GST_AUDIO_FORMAT_F64;
       break;
     default:
       /* .. */
+      format = GST_AUDIO_FORMAT_UNKNOWN;
       break;
   }
 
-  if (bpp) {
-    if (integer) {
-      caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-raw-int",
-          "signed", G_TYPE_BOOLEAN, signedness,
-          "endianness", G_TYPE_INT, G_BYTE_ORDER,
-          "width", G_TYPE_INT, bpp, "depth", G_TYPE_INT, bpp, NULL);
-    } else {
-      caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-raw-float",
-          "endianness", G_TYPE_INT, G_BYTE_ORDER,
-          "width", G_TYPE_INT, bpp, NULL);
-    }
-  }
-
-  if (caps != NULL) {
+  if (format != GST_AUDIO_FORMAT_UNKNOWN) {
+    caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-raw",
+        "format", G_TYPE_STRING, gst_audio_format_to_string (format),
+        "layout", G_TYPE_STRING, "interleaved", NULL);
     GST_LOG ("caps for sample_fmt=%d: %" GST_PTR_FORMAT, sample_fmt, caps);
   } else {
     GST_LOG ("No caps found for sample_fmt=%d", sample_fmt);
@@ -2012,11 +1911,11 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps,
     AVCodecContext * context, gboolean raw)
 {
   GstStructure *structure;
-  gint depth = 0, width = 0, endianness = 0;
-  gboolean signedness = FALSE;
-  const gchar *name;
+  const gchar *fmt;
+  GstAudioFormat format = GST_AUDIO_FORMAT_UNKNOWN;
 
   g_return_if_fail (gst_caps_get_size (caps) == 1);
+
   structure = gst_caps_get_structure (caps, 0);
 
   gst_structure_get_int (structure, "channels", &context->channels);
@@ -2027,35 +1926,29 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps,
   if (!raw)
     return;
 
-  name = gst_structure_get_name (structure);
-
-  if (!strcmp (name, "audio/x-raw-float")) {
-    /* FLOAT */
-    if (gst_structure_get_int (structure, "width", &width) &&
-        gst_structure_get_int (structure, "endianness", &endianness)) {
-      if (endianness == G_BYTE_ORDER) {
-        if (width == 32)
-          context->sample_fmt = SAMPLE_FMT_FLT;
-        else if (width == 64)
-          context->sample_fmt = SAMPLE_FMT_DBL;
-      }
-    }
-  } else {
-    /* INT */
-    if (gst_structure_get_int (structure, "width", &width) &&
-        gst_structure_get_int (structure, "depth", &depth) &&
-        gst_structure_get_boolean (structure, "signed", &signedness) &&
-        gst_structure_get_int (structure, "endianness", &endianness)) {
-      if ((endianness == G_BYTE_ORDER) && (signedness == TRUE)) {
-        if ((width == 16) && (depth == 16))
-          context->sample_fmt = SAMPLE_FMT_S16;
-        else if ((width == 32) && (depth == 32))
-          context->sample_fmt = SAMPLE_FMT_S32;
-      }
+  if (gst_structure_has_name (structure, "audio/x-raw")) {
+    if ((fmt = gst_structure_get_string (structure, "format"))) {
+      format = gst_audio_format_from_string (fmt);
     }
   }
-}
 
+  switch (format) {
+    case GST_AUDIO_FORMAT_F32:
+      context->sample_fmt = SAMPLE_FMT_FLT;
+      break;
+    case GST_AUDIO_FORMAT_F64:
+      context->sample_fmt = SAMPLE_FMT_DBL;
+      break;
+    case GST_AUDIO_FORMAT_S32:
+      context->sample_fmt = SAMPLE_FMT_S32;
+      break;
+    case GST_AUDIO_FORMAT_S16:
+      context->sample_fmt = SAMPLE_FMT_S16;
+      break;
+    default:
+      break;
+  }
+}
 
 /* Convert a GstCaps (video/raw) to a FFMPEG PixFmt
  * and other video properties in a AVCodecContext.
@@ -2070,6 +1963,8 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
   GstStructure *structure;
   const GValue *fps;
   const GValue *par = NULL;
+  const gchar *fmt;
+  GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN;
 
   GST_DEBUG ("converting caps %" GST_PTR_FORMAT, caps);
   g_return_if_fail (gst_caps_get_size (caps) == 1);
@@ -2109,88 +2004,65 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
 
   g_return_if_fail (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps));
 
-  if (strcmp (gst_structure_get_name (structure), "video/x-raw-yuv") == 0) {
-    guint32 fourcc;
-
-    if (gst_structure_get_fourcc (structure, "format", &fourcc)) {
-      switch (fourcc) {
-        case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
-          context->pix_fmt = PIX_FMT_YUYV422;
-          break;
-        case GST_MAKE_FOURCC ('I', '4', '2', '0'):
-          context->pix_fmt = PIX_FMT_YUV420P;
-          break;
-        case GST_MAKE_FOURCC ('A', '4', '2', '0'):
-          context->pix_fmt = PIX_FMT_YUVA420P;
-          break;
-        case GST_MAKE_FOURCC ('Y', '4', '1', 'B'):
-          context->pix_fmt = PIX_FMT_YUV411P;
-          break;
-        case GST_MAKE_FOURCC ('Y', '4', '2', 'B'):
-          context->pix_fmt = PIX_FMT_YUV422P;
-          break;
-        case GST_MAKE_FOURCC ('Y', 'U', 'V', '9'):
-          context->pix_fmt = PIX_FMT_YUV410P;
-          break;
-#if 0
-        case FIXME:
-          context->pix_fmt = PIX_FMT_YUV444P;
-          break;
-#endif
-      }
+  if (gst_structure_has_name (structure, "video/x-raw")) {
+    if ((fmt = gst_structure_get_string (structure, "format"))) {
+      format = gst_video_format_from_string (fmt);
     }
-  } else if (strcmp (gst_structure_get_name (structure),
-          "video/x-raw-rgb") == 0) {
-    gint bpp = 0, rmask = 0, endianness = 0;
+  }
 
-    if (gst_structure_get_int (structure, "bpp", &bpp) &&
-        gst_structure_get_int (structure, "endianness", &endianness)) {
-      if (gst_structure_get_int (structure, "red_mask", &rmask)) {
-        switch (bpp) {
-          case 32:
+  switch (format) {
+    case GST_VIDEO_FORMAT_YUY2:
+      context->pix_fmt = PIX_FMT_YUYV422;
+      break;
+    case GST_VIDEO_FORMAT_I420:
+      context->pix_fmt = PIX_FMT_YUV420P;
+      break;
+    case GST_VIDEO_FORMAT_A420:
+      context->pix_fmt = PIX_FMT_YUVA420P;
+      break;
+    case GST_VIDEO_FORMAT_Y41B:
+      context->pix_fmt = PIX_FMT_YUV411P;
+      break;
+    case GST_VIDEO_FORMAT_Y42B:
+      context->pix_fmt = PIX_FMT_YUV422P;
+      break;
+    case GST_VIDEO_FORMAT_YUV9:
+      context->pix_fmt = PIX_FMT_YUV410P;
+      break;
+    case GST_VIDEO_FORMAT_Y444:
+      context->pix_fmt = PIX_FMT_YUV444P;
+      break;
+    case GST_VIDEO_FORMAT_GRAY8:
+      context->pix_fmt = PIX_FMT_GRAY8;
+      break;
+    case GST_VIDEO_FORMAT_xRGB:
 #if (G_BYTE_ORDER == G_BIG_ENDIAN)
-            if (rmask == 0x00ff0000)
-#else
-            if (rmask == 0x0000ff00)
+      context->pix_fmt = PIX_FMT_RGB32;
 #endif
-              context->pix_fmt = PIX_FMT_RGB32;
-            break;
-          case 24:
-            if (rmask == 0x0000FF)
-              context->pix_fmt = PIX_FMT_BGR24;
-            else
-              context->pix_fmt = PIX_FMT_RGB24;
-            break;
-          case 16:
-            if (endianness == G_BYTE_ORDER)
-              context->pix_fmt = PIX_FMT_RGB565;
-            break;
-          case 15:
-            if (endianness == G_BYTE_ORDER)
-              context->pix_fmt = PIX_FMT_RGB555;
-            break;
-          default:
-            /* nothing */
-            break;
-        }
-      } else {
-        if (bpp == 8) {
-          context->pix_fmt = PIX_FMT_PAL8;
-          gst_ffmpeg_get_palette (caps, context);
-        }
-      }
-    }
-  } else if (strcmp (gst_structure_get_name (structure),
-          "video/x-raw-gray") == 0) {
-    gint bpp = 0;
-
-    if (gst_structure_get_int (structure, "bpp", &bpp)) {
-      switch (bpp) {
-        case 8:
-          context->pix_fmt = PIX_FMT_GRAY8;
-          break;
-      }
-    }
+      break;
+    case GST_VIDEO_FORMAT_BGRx:
+#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
+      context->pix_fmt = PIX_FMT_RGB32;
+#endif
+      break;
+    case GST_VIDEO_FORMAT_RGB:
+      context->pix_fmt = PIX_FMT_RGB24;
+      break;
+    case GST_VIDEO_FORMAT_BGR:
+      context->pix_fmt = PIX_FMT_BGR24;
+      break;
+    case GST_VIDEO_FORMAT_RGB16:
+      context->pix_fmt = PIX_FMT_RGB565;
+      break;
+    case GST_VIDEO_FORMAT_RGB15:
+      context->pix_fmt = PIX_FMT_RGB555;
+      break;
+    case GST_VIDEO_FORMAT_RGB8_PALETTED:
+      context->pix_fmt = PIX_FMT_PAL8;
+      gst_ffmpeg_get_palette (caps, context);
+      break;
+    default:
+      break;
   }
 }
 
@@ -2324,7 +2196,7 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
 {
   GstStructure *str;
   const GValue *value;
-  const GstBuffer *buf;
+  GstBuffer *buf;
 
   GST_LOG ("codec_id:%d, codec_type:%d, caps:%" GST_PTR_FORMAT " context:%p",
       codec_id, codec_type, caps, context);
@@ -2336,12 +2208,10 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
 
   /* extradata parsing (esds [mpeg4], wma/wmv, msmpeg4v1/2/3, etc.) */
   if ((value = gst_structure_get_value (str, "codec_data"))) {
-    guint size;
-    guint8 *data;
+    GstMapInfo map;
 
-    buf = GST_BUFFER_CAST (gst_value_get_mini_object (value));
-    size = GST_BUFFER_SIZE (buf);
-    data = GST_BUFFER_DATA (buf);
+    buf = gst_value_get_buffer (value);
+    gst_buffer_map (buf, &map, GST_MAP_READ);
 
     /* free the old one if it is there */
     if (context->extradata)
@@ -2371,17 +2241,20 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
       /* allocate with enough padding */
       GST_DEBUG ("copy codec_data");
       context->extradata =
-          av_mallocz (GST_ROUND_UP_16 (size + FF_INPUT_BUFFER_PADDING_SIZE));
-      memcpy (context->extradata, data, size);
-      context->extradata_size = size;
+          av_mallocz (GST_ROUND_UP_16 (map.size +
+              FF_INPUT_BUFFER_PADDING_SIZE));
+      memcpy (context->extradata, map.data, map.size);
+      context->extradata_size = map.size;
     }
 
     /* Hack for VC1. Sometimes the first (length) byte is 0 for some files */
-    if (codec_id == CODEC_ID_VC1 && size > 0 && data[0] == 0) {
-      context->extradata[0] = (guint8) size;
+    if (codec_id == CODEC_ID_VC1 && map.size > 0 && map.data[0] == 0) {
+      context->extradata[0] = (guint8) map.size;
     }
 
-    GST_DEBUG ("have codec data of size %d", size);
+    GST_DEBUG ("have codec data of size %" G_GSIZE_FORMAT, map.size);
+
+    gst_buffer_unmap (buf, &map);
   } else if (context->extradata == NULL && codec_id != CODEC_ID_AAC_LATM &&
       codec_id != CODEC_ID_FLAC) {
     /* no extradata, alloc dummy with 0 sized, some codecs insist on reading
@@ -2490,33 +2363,28 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
 
     case CODEC_ID_DVVIDEO:
     {
-      guint32 fourcc;
+      const gchar *format;
 
-      if (gst_structure_get_fourcc (str, "format", &fourcc))
-        switch (fourcc) {
-          case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
-            context->pix_fmt = PIX_FMT_YUYV422;
-            break;
-          case GST_MAKE_FOURCC ('I', '4', '2', '0'):
-            context->pix_fmt = PIX_FMT_YUV420P;
-            break;
-          case GST_MAKE_FOURCC ('A', '4', '2', '0'):
-            context->pix_fmt = PIX_FMT_YUVA420P;
-            break;
-          case GST_MAKE_FOURCC ('Y', '4', '1', 'B'):
-            context->pix_fmt = PIX_FMT_YUV411P;
-            break;
-          case GST_MAKE_FOURCC ('Y', '4', '2', 'B'):
-            context->pix_fmt = PIX_FMT_YUV422P;
-            break;
-          case GST_MAKE_FOURCC ('Y', 'U', 'V', '9'):
-            context->pix_fmt = PIX_FMT_YUV410P;
-            break;
-          default:
-            GST_WARNING ("couldn't convert fourcc %" GST_FOURCC_FORMAT
-                " to a pixel format", GST_FOURCC_ARGS (fourcc));
-            break;
+      if ((format = gst_structure_get_string (str, "format"))) {
+
+        if (g_str_equal (format, "YUY2"))
+          context->pix_fmt = PIX_FMT_YUYV422;
+        else if (g_str_equal (format, "I420"))
+          context->pix_fmt = PIX_FMT_YUV420P;
+        else if (g_str_equal (format, "A420"))
+          context->pix_fmt = PIX_FMT_YUVA420P;
+        else if (g_str_equal (format, "Y41B"))
+          context->pix_fmt = PIX_FMT_YUV411P;
+        else if (g_str_equal (format, "Y42B"))
+          context->pix_fmt = PIX_FMT_YUV422P;
+        else if (g_str_equal (format, "YUV9"))
+          context->pix_fmt = PIX_FMT_YUV410P;
+        else {
+          GST_WARNING ("couldn't convert format %s" " to a pixel format",
+              format);
         }
+      } else
+        GST_WARNING ("No specified format");
       break;
     }
     case CODEC_ID_H263P:
@@ -2607,34 +2475,34 @@ gst_ffmpeg_formatid_to_caps (const gchar * format_name)
     caps = gst_caps_new_simple ("application/x-pn-realmedia",
         "systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
   } else if (!strcmp (format_name, "asf")) {
-    caps = gst_caps_new_simple ("video/x-ms-asf", NULL);
+    caps = gst_caps_new_empty_simple ("video/x-ms-asf");
   } else if (!strcmp (format_name, "avi")) {
-    caps = gst_caps_new_simple ("video/x-msvideo", NULL);
+    caps = gst_caps_new_empty_simple ("video/x-msvideo");
   } else if (!strcmp (format_name, "wav")) {
-    caps = gst_caps_new_simple ("audio/x-wav", NULL);
+    caps = gst_caps_new_empty_simple ("audio/x-wav");
   } else if (!strcmp (format_name, "ape")) {
-    caps = gst_caps_new_simple ("application/x-ape", NULL);
+    caps = gst_caps_new_empty_simple ("application/x-ape");
   } else if (!strcmp (format_name, "swf")) {
-    caps = gst_caps_new_simple ("application/x-shockwave-flash", NULL);
+    caps = gst_caps_new_empty_simple ("application/x-shockwave-flash");
   } else if (!strcmp (format_name, "au")) {
-    caps = gst_caps_new_simple ("audio/x-au", NULL);
+    caps = gst_caps_new_empty_simple ("audio/x-au");
   } else if (!strcmp (format_name, "dv")) {
     caps = gst_caps_new_simple ("video/x-dv",
         "systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
   } else if (!strcmp (format_name, "4xm")) {
-    caps = gst_caps_new_simple ("video/x-4xm", NULL);
+    caps = gst_caps_new_empty_simple ("video/x-4xm");
   } else if (!strcmp (format_name, "matroska")) {
-    caps = gst_caps_new_simple ("video/x-matroska", NULL);
+    caps = gst_caps_new_empty_simple ("video/x-matroska");
   } else if (!strcmp (format_name, "mp3")) {
-    caps = gst_caps_new_simple ("application/x-id3", NULL);
+    caps = gst_caps_new_empty_simple ("application/x-id3");
   } else if (!strcmp (format_name, "flic")) {
-    caps = gst_caps_new_simple ("video/x-fli", NULL);
+    caps = gst_caps_new_empty_simple ("video/x-fli");
   } else if (!strcmp (format_name, "flv")) {
-    caps = gst_caps_new_simple ("video/x-flv", NULL);
+    caps = gst_caps_new_empty_simple ("video/x-flv");
   } else if (!strcmp (format_name, "tta")) {
-    caps = gst_caps_new_simple ("audio/x-ttafile", NULL);
+    caps = gst_caps_new_empty_simple ("audio/x-ttafile");
   } else if (!strcmp (format_name, "aiff")) {
-    caps = gst_caps_new_simple ("audio/x-aiff", NULL);
+    caps = gst_caps_new_empty_simple ("audio/x-aiff");
   } else if (!strcmp (format_name, "mov_mp4_m4a_3gp_3g2")) {
     caps =
         gst_caps_from_string
@@ -2675,12 +2543,14 @@ gst_ffmpeg_formatid_to_caps (const gchar * format_name)
     caps = gst_caps_from_string ("audio/x-amr-nb-sh");
   } else if (!strcmp (format_name, "webm")) {
     caps = gst_caps_from_string ("video/webm");
+  } else if (!strcmp (format_name, "voc")) {
+    caps = gst_caps_from_string ("audio/x-voc");
   } else {
     gchar *name;
 
     GST_LOG ("Could not create stream format caps for %s", format_name);
     name = g_strdup_printf ("application/x-gst_ff-%s", format_name);
-    caps = gst_caps_new_simple (name, NULL);
+    caps = gst_caps_new_empty_simple (name);
     g_free (name);
   }
 
@@ -2874,43 +2744,33 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
 
   mimetype = gst_structure_get_name (structure);
 
-  if (!strcmp (mimetype, "video/x-raw-rgb") ||
-      !strcmp (mimetype, "video/x-raw-yuv")) {
+  if (!strcmp (mimetype, "video/x-raw")) {
     id = CODEC_ID_RAWVIDEO;
     video = TRUE;
-  } else if (!strcmp (mimetype, "audio/x-raw-int")) {
-    gint depth, width, endianness;
-    gboolean signedness;
-
-    if (gst_structure_get_int (structure, "endianness", &endianness) &&
-        gst_structure_get_boolean (structure, "signed", &signedness) &&
-        gst_structure_get_int (structure, "width", &width) &&
-        gst_structure_get_int (structure, "depth", &depth) && depth == width) {
-      switch (depth) {
-        case 8:
-          if (signedness) {
-            id = CODEC_ID_PCM_S8;
-          } else {
-            id = CODEC_ID_PCM_U8;
-          }
+  } else if (!strcmp (mimetype, "audio/x-raw")) {
+    GstAudioInfo info;
+
+    if (gst_audio_info_from_caps (&info, caps)) {
+      switch (GST_AUDIO_INFO_FORMAT (&info)) {
+        case GST_AUDIO_FORMAT_S8:
+          id = CODEC_ID_PCM_S8;
           break;
-        case 16:
-          switch (endianness) {
-            case G_BIG_ENDIAN:
-              if (signedness) {
-                id = CODEC_ID_PCM_S16BE;
-              } else {
-                id = CODEC_ID_PCM_U16BE;
-              }
-              break;
-            case G_LITTLE_ENDIAN:
-              if (signedness) {
-                id = CODEC_ID_PCM_S16LE;
-              } else {
-                id = CODEC_ID_PCM_U16LE;
-              }
-              break;
-          }
+        case GST_AUDIO_FORMAT_U8:
+          id = CODEC_ID_PCM_U8;
+          break;
+        case GST_AUDIO_FORMAT_S16LE:
+          id = CODEC_ID_PCM_S16LE;
+          break;
+        case GST_AUDIO_FORMAT_S16BE:
+          id = CODEC_ID_PCM_S16BE;
+          break;
+        case GST_AUDIO_FORMAT_U16LE:
+          id = CODEC_ID_PCM_U16LE;
+          break;
+        case GST_AUDIO_FORMAT_U16BE:
+          id = CODEC_ID_PCM_U16BE;
+          break;
+        default:
           break;
       }
       if (id != CODEC_ID_NONE)
@@ -2987,19 +2847,17 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
           break;
         case 3:
         {
-          guint32 fourcc;
+          const gchar *format;
 
           /* WMV3 unless the fourcc exists and says otherwise */
           id = CODEC_ID_WMV3;
 
-          if (gst_structure_get_fourcc (structure, "format", &fourcc)) {
-            if ((fourcc == GST_MAKE_FOURCC ('W', 'V', 'C', '1')) ||
-                (fourcc == GST_MAKE_FOURCC ('W', 'M', 'V', 'A'))) {
-              id = CODEC_ID_VC1;
-            }
-          }
-        }
+          if ((format = gst_structure_get_string (structure, "format")) &&
+              (g_str_equal (format, "WVC1") || g_str_equal (format, "WMVA")))
+            id = CODEC_ID_VC1;
+
           break;
+        }
       }
     }
     if (id != CODEC_ID_NONE)
index d3d6170..2c49afa 100644 (file)
 #ifndef __GST_FFMPEG_CODECMAP_H__
 #define __GST_FFMPEG_CODECMAP_H__
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #else
 #include <libavcodec/avcodec.h>
 #endif
 #include <gst/gst.h>
-
-#include <gst/audio/multichannel.h>
+#include <gst/audio/audio.h>
+#include <gst/video/video.h>
 
 /*
  * _codecid_to_caps () gets the GstCaps that belongs to
@@ -101,6 +101,9 @@ gst_ffmpeg_caps_with_codectype (enum AVMediaType  type,
 GstCaps *
 gst_ffmpeg_formatid_to_caps (const gchar *format_name);
 
+GstVideoFormat
+gst_ffmpeg_pixfmt_to_video_format (enum PixelFormat pix_fmt);
+
 /* Convert a FFMPEG Pixel Format and optional AVCodecContext
  * to a GstCaps. If the context is ommitted, no fixed values
  * for video/audio size will be included in the GstCaps
@@ -124,5 +127,8 @@ gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
                                  AVOutputFormat * plugin);
 
 
+gboolean
+gst_ffmpeg_channel_layout_to_gst (AVCodecContext * context,
+    GstAudioChannelPosition * pos);
 
 #endif /* __GST_FFMPEG_CODECMAP_H__ */
index 918abf8..4ab16b1 100644 (file)
@@ -24,7 +24,7 @@
 #include <assert.h>
 #include <string.h>
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #else
 #include <libavcodec/avcodec.h>
 
 #include <gst/gst.h>
 #include <gst/video/video.h>
+#include <gst/video/gstvideometa.h>
+#include <gst/video/gstvideopool.h>
 
 #include "gstffmpeg.h"
 #include "gstffmpegcodecmap.h"
 #include "gstffmpegutils.h"
 
-/* define to enable alternative buffer refcounting algorithm */
-#undef EXTRA_REF
+GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
 
 typedef struct _GstFFMpegDec GstFFMpegDec;
 
@@ -51,7 +52,8 @@ typedef struct _GstFFMpegDec GstFFMpegDec;
 typedef struct
 {
   gint idx;
-  GstClockTime timestamp;
+  GstClockTime dts;
+  GstClockTime pts;
   GstClockTime duration;
   gint64 offset;
 } GstTSInfo;
@@ -68,37 +70,52 @@ struct _GstFFMpegDec
   AVCodecContext *context;
   AVFrame *picture;
   gboolean opened;
+  GstBufferPool *pool;
+
+  /* from incoming caps */
+  gint in_width;
+  gint in_height;
+  gint in_par_n;
+  gint in_par_d;
+  gint in_fps_n;
+  gint in_fps_d;
+
+  /* current context */
+  enum PixelFormat ctx_pix_fmt;
+  gint ctx_width;
+  gint ctx_height;
+  gint ctx_par_n;
+  gint ctx_par_d;
+  gint ctx_ticks;
+  gint ctx_time_d;
+  gint ctx_time_n;
+  gint ctx_interlaced;
+
+  /* current output format */
+  GstVideoInfo out_info;
+
   union
   {
     struct
     {
-      gint width, height;
-      gint clip_width, clip_height;
-      gint par_n, par_d;
-      gint fps_n, fps_d;
-      gint old_fps_n, old_fps_d;
-      gboolean interlaced;
-
-      enum PixelFormat pix_fmt;
-    } video;
-    struct
-    {
       gint channels;
       gint samplerate;
       gint depth;
+
+      GstAudioChannelPosition ffmpeg_layout[64], gst_layout[64];
     } audio;
   } format;
+
+
   gboolean waiting_for_key;
   gboolean discont;
   gboolean clear_ts;
 
   /* for tracking DTS/PTS */
   gboolean has_b_frames;
-  gboolean reordered_in;
-  GstClockTime last_in;
+  GstClockTime last_dts;
   GstClockTime last_diff;
   guint last_frames;
-  gboolean reordered_out;
   GstClockTime last_out;
   GstClockTime next_out;
 
@@ -110,17 +127,13 @@ struct _GstFFMpegDec
   guint8 *padded;
   guint padded_size;
 
-  GValue *par;                  /* pixel aspect ratio of incoming data */
   gboolean current_dr;          /* if direct rendering is enabled */
-  gboolean extra_ref;           /* keep extra ref around in get/release */
 
   /* some properties */
   enum AVDiscard skip_frame;
   gint lowres;
   gboolean direct_rendering;
-  gboolean do_padding;
   gboolean debug_mv;
-  gboolean crop;
   int max_threads;
 
   /* QoS stuff *//* with LOCK */
@@ -140,8 +153,8 @@ struct _GstFFMpegDec
   /* reverse playback queue */
   GList *queued;
 
-  /* Can downstream allocate 16bytes aligned data. */
-  gboolean can_allocate_aligned;
+  /* prevent reopening the decoder on GST_EVENT_CAPS when caps are same as last time. */
+  GstCaps *last_caps;
 };
 
 typedef struct _GstFFMpegDecClass GstFFMpegDecClass;
@@ -158,12 +171,13 @@ struct _GstFFMpegDecClass
 static const GstTSInfo ts_info_none = { -1, -1, -1, -1 };
 
 static const GstTSInfo *
-gst_ts_info_store (GstFFMpegDec * dec, GstClockTime timestamp,
+gst_ts_info_store (GstFFMpegDec * dec, GstClockTime dts, GstClockTime pts,
     GstClockTime duration, gint64 offset)
 {
   gint idx = dec->ts_idx;
   dec->ts_info[idx].idx = idx;
-  dec->ts_info[idx].timestamp = timestamp;
+  dec->ts_info[idx].dts = dts;
+  dec->ts_info[idx].pts = pts;
   dec->ts_info[idx].duration = duration;
   dec->ts_info[idx].offset = offset;
   dec->ts_idx = (idx + 1) & MAX_TS_MASK;
@@ -194,10 +208,8 @@ gst_ts_info_get (GstFFMpegDec * dec, gint idx)
 #define DEFAULT_LOWRES                 0
 #define DEFAULT_SKIPFRAME              0
 #define DEFAULT_DIRECT_RENDERING       TRUE
-#define DEFAULT_DO_PADDING             TRUE
 #define DEFAULT_DEBUG_MV               FALSE
-#define DEFAULT_CROP                   TRUE
-#define DEFAULT_MAX_THREADS            0
+#define DEFAULT_MAX_THREADS            1
 
 enum
 {
@@ -205,9 +217,7 @@ enum
   PROP_LOWRES,
   PROP_SKIPFRAME,
   PROP_DIRECT_RENDERING,
-  PROP_DO_PADDING,
   PROP_DEBUG_MV,
-  PROP_CROP,
   PROP_MAX_THREADS,
   PROP_LAST
 };
@@ -218,12 +228,17 @@ static void gst_ffmpegdec_class_init (GstFFMpegDecClass * klass);
 static void gst_ffmpegdec_init (GstFFMpegDec * ffmpegdec);
 static void gst_ffmpegdec_finalize (GObject * object);
 
-static gboolean gst_ffmpegdec_query (GstPad * pad, GstQuery * query);
-static gboolean gst_ffmpegdec_src_event (GstPad * pad, GstEvent * event);
+static gboolean gst_ffmpegdec_src_query (GstPad * pad, GstObject * parent,
+    GstQuery * query);
+static gboolean gst_ffmpegdec_src_event (GstPad * pad, GstObject * parent,
+    GstEvent * event);
 
-static gboolean gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps);
-static gboolean gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event);
-static GstFlowReturn gst_ffmpegdec_chain (GstPad * pad, GstBuffer * buf);
+static gboolean gst_ffmpegdec_sink_event (GstPad * pad, GstObject * parent,
+    GstEvent * event);
+static gboolean gst_ffmpegdec_sink_query (GstPad * pad, GstObject * parent,
+    GstQuery * query);
+static GstFlowReturn gst_ffmpegdec_chain (GstPad * pad, GstObject * parent,
+    GstBuffer * buf);
 
 static GstStateChangeReturn gst_ffmpegdec_change_state (GstElement * element,
     GstStateChange transition);
@@ -233,7 +248,9 @@ static void gst_ffmpegdec_set_property (GObject * object,
 static void gst_ffmpegdec_get_property (GObject * object,
     guint prop_id, GValue * value, GParamSpec * pspec);
 
-static gboolean gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec,
+static gboolean gst_ffmpegdec_video_negotiate (GstFFMpegDec * ffmpegdec,
+    gboolean force);
+static gboolean gst_ffmpegdec_audio_negotiate (GstFFMpegDec * ffmpegdec,
     gboolean force);
 
 /* some sort of bufferpool handling, but different */
@@ -244,7 +261,7 @@ static void gst_ffmpegdec_release_buffer (AVCodecContext * context,
 
 static void gst_ffmpegdec_drain (GstFFMpegDec * ffmpegdec);
 
-#define GST_FFDEC_PARAMS_QDATA g_quark_from_static_string("ffdec-params")
+#define GST_FFDEC_PARAMS_QDATA g_quark_from_static_string("avdec-params")
 
 static GstElementClass *parent_class = NULL;
 
@@ -263,7 +280,7 @@ gst_ffmpegdec_lowres_get_type (void)
     };
 
     ffmpegdec_lowres_type =
-        g_enum_register_static ("GstFFMpegDecLowres", ffmpegdec_lowres);
+        g_enum_register_static ("GstLibAVDecLowres", ffmpegdec_lowres);
   }
 
   return ffmpegdec_lowres_type;
@@ -285,7 +302,7 @@ gst_ffmpegdec_skipframe_get_type (void)
     };
 
     ffmpegdec_skipframe_type =
-        g_enum_register_static ("GstFFMpegDecSkipFrame", ffmpegdec_skipframe);
+        g_enum_register_static ("GstLibAVDecSkipFrame", ffmpegdec_skipframe);
   }
 
   return ffmpegdec_skipframe_type;
@@ -306,12 +323,12 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass * klass)
   g_assert (in_plugin != NULL);
 
   /* construct the element details struct */
-  longname = g_strdup_printf ("FFmpeg %s decoder", in_plugin->long_name);
+  longname = g_strdup_printf ("libav %s decoder", in_plugin->long_name);
   classification = g_strdup_printf ("Codec/Decoder/%s",
       (in_plugin->type == AVMEDIA_TYPE_VIDEO) ? "Video" : "Audio");
-  description = g_strdup_printf ("FFmpeg %s decoder", in_plugin->name);
-  gst_element_class_set_details_simple (element_class, longname, classification,
-      description,
+  description = g_strdup_printf ("libav %s decoder", in_plugin->name);
+  gst_element_class_set_metadata (element_class, longname,
+      classification, description,
       "Wim Taymans <wim.taymans@gmail.com>, "
       "Ronald Bultje <rbultje@ronald.bitfreak.net>, "
       "Edward Hervey <bilboed@bilboed.com>");
@@ -326,7 +343,7 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass * klass)
     sinkcaps = gst_caps_from_string ("unknown/unknown");
   }
   if (in_plugin->type == AVMEDIA_TYPE_VIDEO) {
-    srccaps = gst_caps_from_string ("video/x-raw-rgb; video/x-raw-yuv");
+    srccaps = gst_caps_from_string ("video/x-raw");
   } else {
     srccaps = gst_ffmpeg_codectype_to_audio_caps (NULL,
         in_plugin->id, FALSE, in_plugin);
@@ -378,20 +395,10 @@ gst_ffmpegdec_class_init (GstFFMpegDecClass * klass)
         g_param_spec_boolean ("direct-rendering", "Direct Rendering",
             "Enable direct rendering", DEFAULT_DIRECT_RENDERING,
             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-    g_object_class_install_property (gobject_class, PROP_DO_PADDING,
-        g_param_spec_boolean ("do-padding", "Do Padding",
-            "Add 0 padding before decoding data", DEFAULT_DO_PADDING,
-            G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
     g_object_class_install_property (gobject_class, PROP_DEBUG_MV,
         g_param_spec_boolean ("debug-mv", "Debug motion vectors",
             "Whether ffmpeg should print motion vectors on top of the image",
             DEFAULT_DEBUG_MV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-#if 0
-    g_object_class_install_property (gobject_class, PROP_CROP,
-        g_param_spec_boolean ("crop", "Crop",
-            "Crop images to the display region",
-            DEFAULT_CROP, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-#endif
 
     caps = klass->in_plugin->capabilities;
     if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
@@ -415,10 +422,10 @@ gst_ffmpegdec_init (GstFFMpegDec * ffmpegdec)
 
   /* setup pads */
   ffmpegdec->sinkpad = gst_pad_new_from_template (oclass->sinktempl, "sink");
-  gst_pad_set_setcaps_function (ffmpegdec->sinkpad,
-      GST_DEBUG_FUNCPTR (gst_ffmpegdec_setcaps));
   gst_pad_set_event_function (ffmpegdec->sinkpad,
       GST_DEBUG_FUNCPTR (gst_ffmpegdec_sink_event));
+  gst_pad_set_query_function (ffmpegdec->sinkpad,
+      GST_DEBUG_FUNCPTR (gst_ffmpegdec_sink_query));
   gst_pad_set_chain_function (ffmpegdec->sinkpad,
       GST_DEBUG_FUNCPTR (gst_ffmpegdec_chain));
   gst_element_add_pad (GST_ELEMENT (ffmpegdec), ffmpegdec->sinkpad);
@@ -428,7 +435,7 @@ gst_ffmpegdec_init (GstFFMpegDec * ffmpegdec)
   gst_pad_set_event_function (ffmpegdec->srcpad,
       GST_DEBUG_FUNCPTR (gst_ffmpegdec_src_event));
   gst_pad_set_query_function (ffmpegdec->srcpad,
-      GST_DEBUG_FUNCPTR (gst_ffmpegdec_query));
+      GST_DEBUG_FUNCPTR (gst_ffmpegdec_src_query));
   gst_element_add_pad (GST_ELEMENT (ffmpegdec), ffmpegdec->srcpad);
 
   /* some ffmpeg data */
@@ -436,23 +443,14 @@ gst_ffmpegdec_init (GstFFMpegDec * ffmpegdec)
   ffmpegdec->picture = avcodec_alloc_frame ();
   ffmpegdec->pctx = NULL;
   ffmpegdec->pcache = NULL;
-  ffmpegdec->par = NULL;
   ffmpegdec->opened = FALSE;
   ffmpegdec->waiting_for_key = TRUE;
   ffmpegdec->skip_frame = ffmpegdec->lowres = 0;
   ffmpegdec->direct_rendering = DEFAULT_DIRECT_RENDERING;
-  ffmpegdec->do_padding = DEFAULT_DO_PADDING;
   ffmpegdec->debug_mv = DEFAULT_DEBUG_MV;
-  ffmpegdec->crop = DEFAULT_CROP;
   ffmpegdec->max_threads = DEFAULT_MAX_THREADS;
 
-  ffmpegdec->format.video.par_n = -1;
-  ffmpegdec->format.video.fps_n = -1;
-  ffmpegdec->format.video.old_fps_n = -1;
   gst_segment_init (&ffmpegdec->segment, GST_FORMAT_TIME);
-
-  /* We initially assume downstream can allocate 16 bytes aligned buffers */
-  ffmpegdec->can_allocate_aligned = TRUE;
 }
 
 static void
@@ -460,26 +458,25 @@ gst_ffmpegdec_finalize (GObject * object)
 {
   GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) object;
 
-  if (ffmpegdec->context != NULL) {
+  if (ffmpegdec->context != NULL)
     av_free (ffmpegdec->context);
-    ffmpegdec->context = NULL;
-  }
 
-  if (ffmpegdec->picture != NULL) {
+  if (ffmpegdec->picture != NULL)
     av_free (ffmpegdec->picture);
-    ffmpegdec->picture = NULL;
-  }
+
+  if (ffmpegdec->pool)
+    gst_object_unref (ffmpegdec->pool);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static gboolean
-gst_ffmpegdec_query (GstPad * pad, GstQuery * query)
+gst_ffmpegdec_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
 {
   GstFFMpegDec *ffmpegdec;
   gboolean res = FALSE;
 
-  ffmpegdec = (GstFFMpegDec *) gst_pad_get_parent (pad);
+  ffmpegdec = (GstFFMpegDec *) parent;
 
   switch (GST_QUERY_TYPE (query)) {
     case GST_QUERY_LATENCY:
@@ -492,11 +489,11 @@ gst_ffmpegdec_query (GstPad * pad, GstQuery * query)
           GstClockTime min_lat, max_lat, our_lat;
 
           gst_query_parse_latency (query, &live, &min_lat, &max_lat);
-          if (ffmpegdec->format.video.fps_n > 0)
+          if (ffmpegdec->out_info.fps_n > 0)
             our_lat =
                 gst_util_uint64_scale_int (ffmpegdec->context->has_b_frames *
-                GST_SECOND, ffmpegdec->format.video.fps_d,
-                ffmpegdec->format.video.fps_n);
+                GST_SECOND, ffmpegdec->out_info.fps_d,
+                ffmpegdec->out_info.fps_n);
           else
             our_lat =
                 gst_util_uint64_scale_int (ffmpegdec->context->has_b_frames *
@@ -511,25 +508,21 @@ gst_ffmpegdec_query (GstPad * pad, GstQuery * query)
     }
       break;
     default:
-      res = gst_pad_query_default (pad, query);
+      res = gst_pad_query_default (pad, parent, query);
       break;
   }
 
-  gst_object_unref (ffmpegdec);
-
   return res;
 }
 
 static void
 gst_ffmpegdec_reset_ts (GstFFMpegDec * ffmpegdec)
 {
-  ffmpegdec->last_in = GST_CLOCK_TIME_NONE;
+  ffmpegdec->last_dts = GST_CLOCK_TIME_NONE;
   ffmpegdec->last_diff = GST_CLOCK_TIME_NONE;
   ffmpegdec->last_frames = 0;
   ffmpegdec->last_out = GST_CLOCK_TIME_NONE;
   ffmpegdec->next_out = GST_CLOCK_TIME_NONE;
-  ffmpegdec->reordered_in = FALSE;
-  ffmpegdec->reordered_out = FALSE;
 }
 
 static void
@@ -564,21 +557,22 @@ gst_ffmpegdec_read_qos (GstFFMpegDec * ffmpegdec, gdouble * proportion,
 }
 
 static gboolean
-gst_ffmpegdec_src_event (GstPad * pad, GstEvent * event)
+gst_ffmpegdec_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
 {
   GstFFMpegDec *ffmpegdec;
   gboolean res;
 
-  ffmpegdec = (GstFFMpegDec *) gst_pad_get_parent (pad);
+  ffmpegdec = (GstFFMpegDec *) parent;
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_QOS:
     {
+      GstQOSType type;
       gdouble proportion;
       GstClockTimeDiff diff;
       GstClockTime timestamp;
 
-      gst_event_parse_qos (event, &proportion, &diff, &timestamp);
+      gst_event_parse_qos (event, &type, &proportion, &diff, &timestamp);
 
       /* update our QoS values */
       gst_ffmpegdec_update_qos (ffmpegdec, proportion, timestamp + diff);
@@ -593,8 +587,6 @@ gst_ffmpegdec_src_event (GstPad * pad, GstEvent * event)
       break;
   }
 
-  gst_object_unref (ffmpegdec);
-
   return res;
 }
 
@@ -607,10 +599,7 @@ gst_ffmpegdec_close (GstFFMpegDec * ffmpegdec)
 
   GST_LOG_OBJECT (ffmpegdec, "closing ffmpeg codec");
 
-  if (ffmpegdec->par) {
-    g_free (ffmpegdec->par);
-    ffmpegdec->par = NULL;
-  }
+  gst_caps_replace (&ffmpegdec->last_caps, NULL);
 
   if (ffmpegdec->context->priv_data)
     gst_ffmpeg_avcodec_close (ffmpegdec->context);
@@ -634,11 +623,6 @@ gst_ffmpegdec_close (GstFFMpegDec * ffmpegdec)
     av_parser_close (ffmpegdec->pctx);
     ffmpegdec->pctx = NULL;
   }
-
-  ffmpegdec->format.video.par_n = -1;
-  ffmpegdec->format.video.fps_n = -1;
-  ffmpegdec->format.video.old_fps_n = -1;
-  ffmpegdec->format.video.interlaced = FALSE;
 }
 
 /* with LOCK */
@@ -699,12 +683,15 @@ gst_ffmpegdec_open (GstFFMpegDec * ffmpegdec)
 
   switch (oclass->in_plugin->type) {
     case AVMEDIA_TYPE_VIDEO:
-      ffmpegdec->format.video.width = 0;
-      ffmpegdec->format.video.height = 0;
-      ffmpegdec->format.video.clip_width = -1;
-      ffmpegdec->format.video.clip_height = -1;
-      ffmpegdec->format.video.pix_fmt = PIX_FMT_NB;
-      ffmpegdec->format.video.interlaced = FALSE;
+      /* clear values */
+      ffmpegdec->ctx_pix_fmt = PIX_FMT_NB;
+      ffmpegdec->ctx_width = 0;
+      ffmpegdec->ctx_height = 0;
+      ffmpegdec->ctx_ticks = 1;
+      ffmpegdec->ctx_time_n = 0;
+      ffmpegdec->ctx_time_d = 0;
+      ffmpegdec->ctx_par_n = 0;
+      ffmpegdec->ctx_par_d = 0;
       break;
     case AVMEDIA_TYPE_AUDIO:
       ffmpegdec->format.audio.samplerate = 0;
@@ -716,8 +703,9 @@ gst_ffmpegdec_open (GstFFMpegDec * ffmpegdec)
   }
 
   gst_ffmpegdec_reset_ts (ffmpegdec);
-  /* FIXME, reset_qos holds the LOCK */
-  ffmpegdec->proportion = 0.0;
+  /* FIXME, reset_qos will take the LOCK and this function is already called
+   * with the LOCK */
+  ffmpegdec->proportion = 0.5;
   ffmpegdec->earliest_time = -1;
 
   return TRUE;
@@ -726,26 +714,24 @@ gst_ffmpegdec_open (GstFFMpegDec * ffmpegdec)
 could_not_open:
   {
     gst_ffmpegdec_close (ffmpegdec);
-    GST_DEBUG_OBJECT (ffmpegdec, "ffdec_%s: Failed to open FFMPEG codec",
+    GST_DEBUG_OBJECT (ffmpegdec, "avdec_%s: Failed to open FFMPEG codec",
         oclass->in_plugin->name);
     return FALSE;
   }
 }
 
 static gboolean
-gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
+gst_ffmpegdec_setcaps (GstFFMpegDec * ffmpegdec, GstCaps * caps)
 {
-  GstFFMpegDec *ffmpegdec;
   GstFFMpegDecClass *oclass;
   GstStructure *structure;
   const GValue *par;
   const GValue *fps;
   gboolean ret = TRUE;
 
-  ffmpegdec = (GstFFMpegDec *) (gst_pad_get_parent (pad));
   oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
 
-  GST_DEBUG_OBJECT (pad, "setcaps called");
+  GST_DEBUG_OBJECT (ffmpegdec, "setcaps called");
 
   GST_OBJECT_LOCK (ffmpegdec);
 
@@ -797,63 +783,29 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
   structure = gst_caps_get_structure (caps, 0);
 
   par = gst_structure_get_value (structure, "pixel-aspect-ratio");
-  if (par) {
+  if (par != NULL && GST_VALUE_HOLDS_FRACTION (par)) {
+    ffmpegdec->in_par_n = gst_value_get_fraction_numerator (par);
+    ffmpegdec->in_par_d = gst_value_get_fraction_denominator (par);
     GST_DEBUG_OBJECT (ffmpegdec, "sink caps have pixel-aspect-ratio of %d:%d",
-        gst_value_get_fraction_numerator (par),
-        gst_value_get_fraction_denominator (par));
-    /* should be NULL */
-    if (ffmpegdec->par)
-      g_free (ffmpegdec->par);
-    ffmpegdec->par = g_new0 (GValue, 1);
-    gst_value_init_and_copy (ffmpegdec->par, par);
+        ffmpegdec->in_par_n, ffmpegdec->in_par_d);
+  } else {
+    GST_DEBUG_OBJECT (ffmpegdec, "no input pixel-aspect-ratio");
+    ffmpegdec->in_par_n = 0;
+    ffmpegdec->in_par_d = 0;
   }
 
-  /* get the framerate from incoming caps. fps_n is set to -1 when
+  /* get the framerate from incoming caps. fps_n is set to 0 when
    * there is no valid framerate */
   fps = gst_structure_get_value (structure, "framerate");
   if (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps)) {
-    ffmpegdec->format.video.fps_n = gst_value_get_fraction_numerator (fps);
-    ffmpegdec->format.video.fps_d = gst_value_get_fraction_denominator (fps);
-    GST_DEBUG_OBJECT (ffmpegdec, "Using framerate %d/%d from incoming caps",
-        ffmpegdec->format.video.fps_n, ffmpegdec->format.video.fps_d);
+    ffmpegdec->in_fps_n = gst_value_get_fraction_numerator (fps);
+    ffmpegdec->in_fps_d = gst_value_get_fraction_denominator (fps);
+    GST_DEBUG_OBJECT (ffmpegdec, "sink caps have framerate of %d/%d",
+        ffmpegdec->in_fps_n, ffmpegdec->in_fps_d);
   } else {
-    ffmpegdec->format.video.fps_n = -1;
-    GST_DEBUG_OBJECT (ffmpegdec, "Using framerate from codec");
-  }
-
-  /* figure out if we can use direct rendering */
-  ffmpegdec->current_dr = FALSE;
-  ffmpegdec->extra_ref = FALSE;
-  if (ffmpegdec->direct_rendering) {
-    GST_DEBUG_OBJECT (ffmpegdec, "trying to enable direct rendering");
-    if (oclass->in_plugin->capabilities & CODEC_CAP_DR1) {
-      if (oclass->in_plugin->id == CODEC_ID_H264) {
-        GST_DEBUG_OBJECT (ffmpegdec, "disable direct rendering setup for H264");
-        /* does not work, many stuff reads outside of the planes */
-        ffmpegdec->current_dr = FALSE;
-        ffmpegdec->extra_ref = TRUE;
-      } else if ((oclass->in_plugin->id == CODEC_ID_SVQ1) ||
-          (oclass->in_plugin->id == CODEC_ID_VP5) ||
-          (oclass->in_plugin->id == CODEC_ID_VP6) ||
-          (oclass->in_plugin->id == CODEC_ID_VP6F) ||
-          (oclass->in_plugin->id == CODEC_ID_VP6A)) {
-        GST_DEBUG_OBJECT (ffmpegdec,
-            "disable direct rendering setup for broken stride support");
-        /* does not work, uses a incompatible stride. See #610613 */
-        ffmpegdec->current_dr = FALSE;
-        ffmpegdec->extra_ref = TRUE;
-      } else {
-        GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering");
-        ffmpegdec->current_dr = TRUE;
-      }
-    } else {
-      GST_DEBUG_OBJECT (ffmpegdec, "direct rendering not supported");
-    }
-  }
-  if (ffmpegdec->current_dr) {
-    /* do *not* draw edges when in direct rendering, for some reason it draws
-     * outside of the memory. */
-    ffmpegdec->context->flags |= CODEC_FLAG_EMU_EDGE;
+    GST_DEBUG_OBJECT (ffmpegdec, "no input framerate ");
+    ffmpegdec->in_fps_n = 0;
+    ffmpegdec->in_fps_d = 0;
   }
 
   /* for AAC we only use av_parse if not on stream-format==raw or ==loas */
@@ -900,123 +852,64 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps)
   if (!gst_ffmpegdec_open (ffmpegdec))
     goto open_failed;
 
-  /* clipping region */
-  gst_structure_get_int (structure, "width",
-      &ffmpegdec->format.video.clip_width);
-  gst_structure_get_int (structure, "height",
-      &ffmpegdec->format.video.clip_height);
-
-  GST_DEBUG_OBJECT (pad, "clipping to %dx%d",
-      ffmpegdec->format.video.clip_width, ffmpegdec->format.video.clip_height);
+  /* clipping region. take into account the lowres property */
+  if (gst_structure_get_int (structure, "width", &ffmpegdec->in_width))
+    ffmpegdec->in_width >>= ffmpegdec->lowres;
+  else
+    ffmpegdec->in_width = -1;
 
-  /* take into account the lowres property */
-  if (ffmpegdec->format.video.clip_width != -1)
-    ffmpegdec->format.video.clip_width >>= ffmpegdec->lowres;
-  if (ffmpegdec->format.video.clip_height != -1)
-    ffmpegdec->format.video.clip_height >>= ffmpegdec->lowres;
+  if (gst_structure_get_int (structure, "height", &ffmpegdec->in_height))
+    ffmpegdec->in_height >>= ffmpegdec->lowres;
+  else
+    ffmpegdec->in_height = -1;
 
-  GST_DEBUG_OBJECT (pad, "final clipping to %dx%d",
-      ffmpegdec->format.video.clip_width, ffmpegdec->format.video.clip_height);
+  GST_DEBUG_OBJECT (ffmpegdec, "clipping to %dx%d",
+      ffmpegdec->in_width, ffmpegdec->in_height);
 
 done:
   GST_OBJECT_UNLOCK (ffmpegdec);
 
-  gst_object_unref (ffmpegdec);
-
   return ret;
 
   /* ERRORS */
 open_failed:
   {
     GST_DEBUG_OBJECT (ffmpegdec, "Failed to open");
-    if (ffmpegdec->par) {
-      g_free (ffmpegdec->par);
-      ffmpegdec->par = NULL;
-    }
     ret = FALSE;
     goto done;
   }
 }
 
-static GstFlowReturn
-alloc_output_buffer (GstFFMpegDec * ffmpegdec, GstBuffer ** outbuf,
-    gint width, gint height)
+static void
+gst_ffmpegdec_fill_picture (GstFFMpegDec * ffmpegdec, GstVideoFrame * frame,
+    AVFrame * picture)
 {
-  GstFlowReturn ret;
-  gint fsize;
-
-  ret = GST_FLOW_ERROR;
-  *outbuf = NULL;
+  guint i;
 
-  GST_LOG_OBJECT (ffmpegdec, "alloc output buffer");
+  /* setup data pointers and strides */
+  for (i = 0; i < GST_VIDEO_FRAME_N_PLANES (frame); i++) {
+    picture->data[i] = GST_VIDEO_FRAME_PLANE_DATA (frame, i);
+    picture->linesize[i] = GST_VIDEO_FRAME_PLANE_STRIDE (frame, i);
 
-  /* see if we need renegotiation */
-  if (G_UNLIKELY (!gst_ffmpegdec_negotiate (ffmpegdec, FALSE)))
-    goto negotiate_failed;
-
-  /* get the size of the gstreamer output buffer given a
-   * width/height/format */
-  fsize = gst_ffmpeg_avpicture_get_size (ffmpegdec->context->pix_fmt,
-      width, height);
-
-  if (!ffmpegdec->context->palctrl && ffmpegdec->can_allocate_aligned) {
-    GST_LOG_OBJECT (ffmpegdec, "calling pad_alloc");
-    /* no pallete, we can use the buffer size to alloc */
-    ret = gst_pad_alloc_buffer_and_set_caps (ffmpegdec->srcpad,
-        GST_BUFFER_OFFSET_NONE, fsize,
-        GST_PAD_CAPS (ffmpegdec->srcpad), outbuf);
-    if (G_UNLIKELY (ret != GST_FLOW_OK))
-      goto alloc_failed;
-
-    /* If buffer isn't 128-bit aligned, create a memaligned one ourselves */
-    if (((uintptr_t) GST_BUFFER_DATA (*outbuf)) % 16) {
-      GST_DEBUG_OBJECT (ffmpegdec,
-          "Downstream can't allocate aligned buffers.");
-      ffmpegdec->can_allocate_aligned = FALSE;
-      gst_buffer_unref (*outbuf);
-      *outbuf = new_aligned_buffer (fsize, GST_PAD_CAPS (ffmpegdec->srcpad));
-    }
-  } else {
-    GST_LOG_OBJECT (ffmpegdec,
-        "not calling pad_alloc, we have a pallete or downstream can't give 16 byte aligned buffers.");
-    /* for paletted data we can't use pad_alloc_buffer(), because
-     * fsize contains the size of the palette, so the overall size
-     * is bigger than ffmpegcolorspace's unit size, which will
-     * prompt GstBaseTransform to complain endlessly ... */
-    *outbuf = new_aligned_buffer (fsize, GST_PAD_CAPS (ffmpegdec->srcpad));
-    ret = GST_FLOW_OK;
-  }
-  /* set caps, we do this here because the buffer is still writable here and we
-   * are sure to be negotiated */
-  gst_buffer_set_caps (*outbuf, GST_PAD_CAPS (ffmpegdec->srcpad));
-
-  return ret;
-
-  /* special cases */
-negotiate_failed:
-  {
-    GST_DEBUG_OBJECT (ffmpegdec, "negotiate failed");
-    return GST_FLOW_NOT_NEGOTIATED;
-  }
-alloc_failed:
-  {
-    GST_DEBUG_OBJECT (ffmpegdec, "pad_alloc failed %d (%s)", ret,
-        gst_flow_get_name (ret));
-    return ret;
+    GST_LOG_OBJECT (ffmpegdec, "plane %d: data %p, linesize %d", i,
+        picture->data[i], picture->linesize[i]);
   }
 }
 
+/* called when ffmpeg wants us to allocate a buffer to write the decoded frame
+ * into. We try to give it memory from our pool */
 static int
 gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
 {
   GstBuffer *buf = NULL;
   GstFFMpegDec *ffmpegdec;
-  gint width, height;
-  gint coded_width, coded_height;
-  gint res;
+  GstFlowReturn ret;
+  GstVideoFrame frame;
 
   ffmpegdec = (GstFFMpegDec *) context->opaque;
 
+  ffmpegdec->context->pix_fmt = context->pix_fmt;
+
   GST_DEBUG_OBJECT (ffmpegdec, "getting buffer");
 
   /* apply the last info we have seen to this picture, when we get the
@@ -1026,99 +919,74 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
   /* make sure we don't free the buffer when it's not ours */
   picture->opaque = NULL;
 
-  /* take width and height before clipping */
-  width = context->width;
-  height = context->height;
-  coded_width = context->coded_width;
-  coded_height = context->coded_height;
-
-  GST_LOG_OBJECT (ffmpegdec, "dimension %dx%d, coded %dx%d", width, height,
-      coded_width, coded_height);
-  if (!ffmpegdec->current_dr) {
-    GST_LOG_OBJECT (ffmpegdec, "direct rendering disabled, fallback alloc");
-    res = avcodec_default_get_buffer (context, picture);
-
-    GST_LOG_OBJECT (ffmpegdec, "linsize %d %d %d", picture->linesize[0],
-        picture->linesize[1], picture->linesize[2]);
-    GST_LOG_OBJECT (ffmpegdec, "data %u %u %u", 0,
-        (guint) (picture->data[1] - picture->data[0]),
-        (guint) (picture->data[2] - picture->data[0]));
-    return res;
-  }
-
-  switch (context->codec_type) {
-    case AVMEDIA_TYPE_VIDEO:
-      /* some ffmpeg video plugins don't see the point in setting codec_type ... */
-    case AVMEDIA_TYPE_UNKNOWN:
-    {
-      GstFlowReturn ret;
-      gint clip_width, clip_height;
-
-      /* take final clipped output size */
-      if ((clip_width = ffmpegdec->format.video.clip_width) == -1)
-        clip_width = width;
-      if ((clip_height = ffmpegdec->format.video.clip_height) == -1)
-        clip_height = height;
-
-      GST_LOG_OBJECT (ffmpegdec, "raw outsize %d/%d", width, height);
-
-      /* this is the size ffmpeg needs for the buffer */
-      avcodec_align_dimensions (context, &width, &height);
+  /* see if we need renegotiation */
+  if (G_UNLIKELY (!gst_ffmpegdec_video_negotiate (ffmpegdec, FALSE)))
+    goto negotiate_failed;
 
-      GST_LOG_OBJECT (ffmpegdec, "aligned outsize %d/%d, clip %d/%d",
-          width, height, clip_width, clip_height);
+  if (!ffmpegdec->current_dr)
+    goto no_dr;
 
-      if (width != clip_width || height != clip_height) {
-        /* We can't alloc if we need to clip the output buffer later */
-        GST_LOG_OBJECT (ffmpegdec, "we need clipping, fallback alloc");
-        return avcodec_default_get_buffer (context, picture);
-      }
+  /* alloc with aligned dimensions for ffmpeg */
+  GST_LOG_OBJECT (ffmpegdec, "doing alloc from pool");
+  ret = gst_buffer_pool_acquire_buffer (ffmpegdec->pool, &buf, NULL);
+  if (G_UNLIKELY (ret != GST_FLOW_OK))
+    goto alloc_failed;
 
-      /* alloc with aligned dimensions for ffmpeg */
-      ret = alloc_output_buffer (ffmpegdec, &buf, width, height);
-      if (G_UNLIKELY (ret != GST_FLOW_OK)) {
-        /* alloc default buffer when we can't get one from downstream */
-        GST_LOG_OBJECT (ffmpegdec, "alloc failed, fallback alloc");
-        return avcodec_default_get_buffer (context, picture);
-      }
+  if (!gst_video_frame_map (&frame, &ffmpegdec->out_info, buf,
+          GST_MAP_READWRITE))
+    goto invalid_frame;
 
-      /* copy the right pointers and strides in the picture object */
-      gst_ffmpeg_avpicture_fill ((AVPicture *) picture,
-          GST_BUFFER_DATA (buf), context->pix_fmt, width, height);
-      break;
-    }
-    case AVMEDIA_TYPE_AUDIO:
-    default:
-      GST_ERROR_OBJECT (ffmpegdec,
-          "_get_buffer() should never get called for non-video buffers !");
-      g_assert_not_reached ();
-      break;
-  }
+  gst_ffmpegdec_fill_picture (ffmpegdec, &frame, picture);
 
   /* tell ffmpeg we own this buffer, tranfer the ref we have on the buffer to
    * the opaque data. */
   picture->type = FF_BUFFER_TYPE_USER;
   picture->age = 256 * 256 * 256 * 64;
-  picture->opaque = buf;
+  picture->opaque = g_slice_dup (GstVideoFrame, &frame);
 
-#ifdef EXTRA_REF
-  if (picture->reference != 0 || ffmpegdec->extra_ref) {
-    GST_DEBUG_OBJECT (ffmpegdec, "adding extra ref");
-    gst_buffer_ref (buf);
-  }
-#endif
-
-  GST_LOG_OBJECT (ffmpegdec, "returned buffer %p", buf);
+  GST_LOG_OBJECT (ffmpegdec, "returned buffer %p in frame %p", buf,
+      picture->opaque);
 
   return 0;
+
+  /* fallbacks */
+negotiate_failed:
+  {
+    GST_DEBUG_OBJECT (ffmpegdec, "negotiate failed");
+    goto fallback;
+  }
+no_dr:
+  {
+    GST_LOG_OBJECT (ffmpegdec, "direct rendering disabled, fallback alloc");
+    goto fallback;
+  }
+alloc_failed:
+  {
+    /* alloc default buffer when we can't get one from downstream */
+    GST_LOG_OBJECT (ffmpegdec, "alloc failed, fallback alloc");
+    goto fallback;
+  }
+invalid_frame:
+  {
+    /* alloc default buffer when we can't get one from downstream */
+    GST_LOG_OBJECT (ffmpegdec, "failed to map frame, fallback alloc");
+    gst_buffer_unref (buf);
+    goto fallback;
+  }
+fallback:
+  {
+    return avcodec_default_get_buffer (context, picture);
+  }
 }
 
+/* called when ffmpeg is done with our buffer */
 static void
 gst_ffmpegdec_release_buffer (AVCodecContext * context, AVFrame * picture)
 {
   gint i;
   GstBuffer *buf;
   GstFFMpegDec *ffmpegdec;
+  GstVideoFrame *frame;
 
   ffmpegdec = (GstFFMpegDec *) context->opaque;
 
@@ -1130,18 +998,17 @@ gst_ffmpegdec_release_buffer (AVCodecContext * context, AVFrame * picture)
   }
 
   /* we remove the opaque data now */
-  buf = GST_BUFFER_CAST (picture->opaque);
-  GST_DEBUG_OBJECT (ffmpegdec, "release buffer %p", buf);
+  frame = picture->opaque;
   picture->opaque = NULL;
 
-#ifdef EXTRA_REF
-  if (picture->reference != 0 || ffmpegdec->extra_ref) {
-    GST_DEBUG_OBJECT (ffmpegdec, "remove extra ref");
-    gst_buffer_unref (buf);
-  }
-#else
+  /* unmap buffer data */
+  gst_video_frame_unmap (frame);
+  buf = frame->buffer;
+
+  GST_DEBUG_OBJECT (ffmpegdec, "release buffer %p in frame %p", buf, frame);
+
+  g_slice_free (GstVideoFrame, frame);
   gst_buffer_unref (buf);
-#endif
 
   /* zero out the reference in ffmpeg */
   for (i = 0; i < 4; i++) {
@@ -1151,8 +1018,7 @@ gst_ffmpegdec_release_buffer (AVCodecContext * context, AVFrame * picture)
 }
 
 static void
-gst_ffmpegdec_add_pixel_aspect_ratio (GstFFMpegDec * ffmpegdec,
-    GstStructure * s)
+gst_ffmpegdec_update_par (GstFFMpegDec * ffmpegdec, gint * par_n, gint * par_d)
 {
   gboolean demuxer_par_set = FALSE;
   gboolean decoder_par_set = FALSE;
@@ -1161,18 +1027,17 @@ gst_ffmpegdec_add_pixel_aspect_ratio (GstFFMpegDec * ffmpegdec,
 
   GST_OBJECT_LOCK (ffmpegdec);
 
-  if (ffmpegdec->par) {
-    demuxer_num = gst_value_get_fraction_numerator (ffmpegdec->par);
-    demuxer_denom = gst_value_get_fraction_denominator (ffmpegdec->par);
+  if (ffmpegdec->in_par_n && ffmpegdec->in_par_d) {
+    demuxer_num = ffmpegdec->in_par_n;
+    demuxer_denom = ffmpegdec->in_par_d;
     demuxer_par_set = TRUE;
     GST_DEBUG_OBJECT (ffmpegdec, "Demuxer PAR: %d:%d", demuxer_num,
         demuxer_denom);
   }
 
-  if (ffmpegdec->context->sample_aspect_ratio.num &&
-      ffmpegdec->context->sample_aspect_ratio.den) {
-    decoder_num = ffmpegdec->context->sample_aspect_ratio.num;
-    decoder_denom = ffmpegdec->context->sample_aspect_ratio.den;
+  if (ffmpegdec->ctx_par_n && ffmpegdec->ctx_par_d) {
+    decoder_num = ffmpegdec->ctx_par_n;
+    decoder_denom = ffmpegdec->ctx_par_d;
     decoder_par_set = TRUE;
     GST_DEBUG_OBJECT (ffmpegdec, "Decoder PAR: %d:%d", decoder_num,
         decoder_denom);
@@ -1206,8 +1071,8 @@ use_decoder_par:
     GST_DEBUG_OBJECT (ffmpegdec,
         "Setting decoder provided pixel-aspect-ratio of %u:%u", decoder_num,
         decoder_denom);
-    gst_structure_set (s, "pixel-aspect-ratio", GST_TYPE_FRACTION, decoder_num,
-        decoder_denom, NULL);
+    *par_n = decoder_num;
+    *par_d = decoder_denom;
     return;
   }
 
@@ -1216,123 +1081,375 @@ use_demuxer_par:
     GST_DEBUG_OBJECT (ffmpegdec,
         "Setting demuxer provided pixel-aspect-ratio of %u:%u", demuxer_num,
         demuxer_denom);
-    gst_structure_set (s, "pixel-aspect-ratio", GST_TYPE_FRACTION, demuxer_num,
-        demuxer_denom, NULL);
+    *par_n = demuxer_num;
+    *par_d = demuxer_denom;
     return;
   }
 no_par:
   {
     GST_DEBUG_OBJECT (ffmpegdec,
         "Neither demuxer nor codec provide a pixel-aspect-ratio");
+    *par_n = 1;
+    *par_d = 1;
     return;
   }
 }
 
 static gboolean
-gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force)
+gst_ffmpegdec_bufferpool (GstFFMpegDec * ffmpegdec, GstCaps * caps)
+{
+  GstQuery *query;
+  GstBufferPool *pool;
+  guint size, min, max;
+  GstStructure *config;
+  guint edge;
+  AVCodecContext *context = ffmpegdec->context;
+  gboolean have_videometa, have_alignment;
+  GstAllocationParams params = { 0, 0, 0, 15, };
+
+  GST_DEBUG_OBJECT (ffmpegdec, "setting up bufferpool");
+
+  /* find a pool for the negotiated caps now */
+  query = gst_query_new_allocation (caps, TRUE);
+
+  if (gst_pad_peer_query (ffmpegdec->srcpad, query)) {
+    have_videometa =
+        gst_query_has_allocation_meta (query, GST_VIDEO_META_API_TYPE);
+  } else {
+    /* use query defaults */
+    GST_DEBUG_OBJECT (ffmpegdec, "peer query failed, using defaults");
+    have_videometa = FALSE;
+  }
+
+  if (gst_query_get_n_allocation_pools (query) > 0) {
+    /* we got configuration from our peer, parse them */
+    gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
+
+    size = MAX (size, ffmpegdec->out_info.size);
+  } else {
+    pool = NULL;
+    size = ffmpegdec->out_info.size;
+    min = max = 0;
+  }
+
+  gst_query_unref (query);
+
+  if (pool == NULL) {
+    /* we did not get a pool, make one ourselves then */
+    pool = gst_video_buffer_pool_new ();
+  }
+
+  config = gst_buffer_pool_get_config (pool);
+  gst_buffer_pool_config_set_params (config, caps, size, min, max);
+  /* we are happy with the default allocator but we would like to have 16 bytes
+   * aligned memory */
+  gst_buffer_pool_config_set_allocator (config, NULL, &params);
+
+  have_alignment =
+      gst_buffer_pool_has_option (pool, GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
+
+  /* we can only enable the alignment if downstream supports the
+   * videometa api */
+  if (have_alignment && have_videometa) {
+    GstVideoAlignment align;
+    gint width, height;
+    gint linesize_align[4];
+    gint i;
+
+    width = ffmpegdec->ctx_width;
+    height = ffmpegdec->ctx_height;
+    /* let ffmpeg find the alignment and padding */
+    avcodec_align_dimensions2 (context, &width, &height, linesize_align);
+    edge = context->flags & CODEC_FLAG_EMU_EDGE ? 0 : avcodec_get_edge_width ();
+    /* increase the size for the padding */
+    width += edge << 1;
+    height += edge << 1;
+
+    align.padding_top = edge;
+    align.padding_left = edge;
+    align.padding_right = width - ffmpegdec->ctx_width - edge;
+    align.padding_bottom = height - ffmpegdec->ctx_height - edge;
+    for (i = 0; i < GST_VIDEO_MAX_PLANES; i++)
+      align.stride_align[i] =
+          (linesize_align[i] > 0 ? linesize_align[i] - 1 : 0);
+
+    GST_DEBUG_OBJECT (ffmpegdec, "aligned dimension %dx%d -> %dx%d "
+        "padding t:%u l:%u r:%u b:%u, stride_align %d:%d:%d:%d",
+        ffmpegdec->ctx_width, ffmpegdec->ctx_height, width, height,
+        align.padding_top, align.padding_left, align.padding_right,
+        align.padding_bottom, align.stride_align[0], align.stride_align[1],
+        align.stride_align[2], align.stride_align[3]);
+
+    gst_buffer_pool_config_add_option (config,
+        GST_BUFFER_POOL_OPTION_VIDEO_META);
+    gst_buffer_pool_config_add_option (config,
+        GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
+    gst_buffer_pool_config_set_video_alignment (config, &align);
+
+    if (ffmpegdec->direct_rendering) {
+      GstFFMpegDecClass *oclass;
+
+      GST_DEBUG_OBJECT (ffmpegdec, "trying to enable direct rendering");
+
+      oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
+
+      if (oclass->in_plugin->capabilities & CODEC_CAP_DR1) {
+        GST_DEBUG_OBJECT (ffmpegdec, "enabled direct rendering");
+        ffmpegdec->current_dr = TRUE;
+      } else {
+        GST_DEBUG_OBJECT (ffmpegdec, "direct rendering not supported");
+      }
+    }
+  } else {
+    GST_DEBUG_OBJECT (ffmpegdec,
+        "alignment or videometa not supported, disable direct rendering");
+    /* disable direct rendering. This will make us use the fallback ffmpeg
+     * picture allocation code with padding etc. We will then do the final
+     * copy (with cropping) into a buffer from our pool */
+    ffmpegdec->current_dr = FALSE;
+  }
+
+  /* and store */
+  gst_buffer_pool_set_config (pool, config);
+
+  if (ffmpegdec->pool) {
+    gst_buffer_pool_set_active (ffmpegdec->pool, FALSE);
+    gst_object_unref (ffmpegdec->pool);
+  }
+  ffmpegdec->pool = pool;
+
+  /* and activate */
+  gst_buffer_pool_set_active (pool, TRUE);
+
+  return TRUE;
+}
+
+static gboolean
+update_video_context (GstFFMpegDec * ffmpegdec, gboolean force)
+{
+  AVCodecContext *context = ffmpegdec->context;
+
+  if (!force && ffmpegdec->ctx_width == context->width
+      && ffmpegdec->ctx_height == context->height
+      && ffmpegdec->ctx_ticks == context->ticks_per_frame
+      && ffmpegdec->ctx_time_n == context->time_base.num
+      && ffmpegdec->ctx_time_d == context->time_base.den
+      && ffmpegdec->ctx_pix_fmt == context->pix_fmt
+      && ffmpegdec->ctx_par_n == context->sample_aspect_ratio.num
+      && ffmpegdec->ctx_par_d == context->sample_aspect_ratio.den)
+    return FALSE;
+
+  GST_DEBUG_OBJECT (ffmpegdec,
+      "Renegotiating video from %dx%d@ %d:%d PAR %d/%d fps to %dx%d@ %d:%d PAR %d/%d fps pixfmt %d",
+      ffmpegdec->ctx_width, ffmpegdec->ctx_height,
+      ffmpegdec->ctx_par_n, ffmpegdec->ctx_par_d,
+      ffmpegdec->ctx_time_n, ffmpegdec->ctx_time_d,
+      context->width, context->height,
+      context->sample_aspect_ratio.num,
+      context->sample_aspect_ratio.den,
+      context->time_base.num, context->time_base.den, context->pix_fmt);
+
+  ffmpegdec->ctx_width = context->width;
+  ffmpegdec->ctx_height = context->height;
+  ffmpegdec->ctx_ticks = context->ticks_per_frame;
+  ffmpegdec->ctx_time_n = context->time_base.num;
+  ffmpegdec->ctx_time_d = context->time_base.den;
+  ffmpegdec->ctx_pix_fmt = context->pix_fmt;
+  ffmpegdec->ctx_par_n = context->sample_aspect_ratio.num;
+  ffmpegdec->ctx_par_d = context->sample_aspect_ratio.den;
+
+  return TRUE;
+}
+
+static gboolean
+gst_ffmpegdec_video_negotiate (GstFFMpegDec * ffmpegdec, gboolean force)
 {
   GstFFMpegDecClass *oclass;
   GstCaps *caps;
+  gint width, height;
+  gint fps_n, fps_d;
+  GstVideoInfo info;
+  GstVideoFormat fmt;
 
   oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
 
-  switch (oclass->in_plugin->type) {
-    case AVMEDIA_TYPE_VIDEO:
-      if (!force && ffmpegdec->format.video.width == ffmpegdec->context->width
-          && ffmpegdec->format.video.height == ffmpegdec->context->height
-          && ffmpegdec->format.video.fps_n == ffmpegdec->format.video.old_fps_n
-          && ffmpegdec->format.video.fps_d == ffmpegdec->format.video.old_fps_d
-          && ffmpegdec->format.video.pix_fmt == ffmpegdec->context->pix_fmt
-          && ffmpegdec->format.video.par_n ==
-          ffmpegdec->context->sample_aspect_ratio.num
-          && ffmpegdec->format.video.par_d ==
-          ffmpegdec->context->sample_aspect_ratio.den)
-        return TRUE;
-      GST_DEBUG_OBJECT (ffmpegdec,
-          "Renegotiating video from %dx%d@ %d:%d PAR %d/%d fps to %dx%d@ %d:%d PAR %d/%d fps",
-          ffmpegdec->format.video.width, ffmpegdec->format.video.height,
-          ffmpegdec->format.video.par_n, ffmpegdec->format.video.par_d,
-          ffmpegdec->format.video.old_fps_n, ffmpegdec->format.video.old_fps_n,
-          ffmpegdec->context->width, ffmpegdec->context->height,
-          ffmpegdec->context->sample_aspect_ratio.num,
-          ffmpegdec->context->sample_aspect_ratio.den,
-          ffmpegdec->format.video.fps_n, ffmpegdec->format.video.fps_d);
-      ffmpegdec->format.video.width = ffmpegdec->context->width;
-      ffmpegdec->format.video.height = ffmpegdec->context->height;
-      ffmpegdec->format.video.old_fps_n = ffmpegdec->format.video.fps_n;
-      ffmpegdec->format.video.old_fps_d = ffmpegdec->format.video.fps_d;
-      ffmpegdec->format.video.pix_fmt = ffmpegdec->context->pix_fmt;
-      ffmpegdec->format.video.par_n =
-          ffmpegdec->context->sample_aspect_ratio.num;
-      ffmpegdec->format.video.par_d =
-          ffmpegdec->context->sample_aspect_ratio.den;
-      break;
-    case AVMEDIA_TYPE_AUDIO:
-    {
-      gint depth = av_smp_format_depth (ffmpegdec->context->sample_fmt);
-      if (!force && ffmpegdec->format.audio.samplerate ==
-          ffmpegdec->context->sample_rate &&
-          ffmpegdec->format.audio.channels == ffmpegdec->context->channels &&
-          ffmpegdec->format.audio.depth == depth)
-        return TRUE;
-      GST_DEBUG_OBJECT (ffmpegdec,
-          "Renegotiating audio from %dHz@%dchannels (%d) to %dHz@%dchannels (%d)",
-          ffmpegdec->format.audio.samplerate, ffmpegdec->format.audio.channels,
-          ffmpegdec->format.audio.depth,
-          ffmpegdec->context->sample_rate, ffmpegdec->context->channels, depth);
-      ffmpegdec->format.audio.samplerate = ffmpegdec->context->sample_rate;
-      ffmpegdec->format.audio.channels = ffmpegdec->context->channels;
-      ffmpegdec->format.audio.depth = depth;
+  force |= gst_pad_check_reconfigure (ffmpegdec->srcpad);
+
+  /* first check if anything changed */
+  if (!update_video_context (ffmpegdec, force))
+    return TRUE;
+
+  /* now we're going to construct the video info for the final output
+   * format */
+  gst_video_info_init (&info);
+
+  fmt = gst_ffmpeg_pixfmt_to_video_format (ffmpegdec->ctx_pix_fmt);
+  if (fmt == GST_VIDEO_FORMAT_UNKNOWN)
+    goto unknown_format;
+
+  /* determine the width and height, start with the dimension of the
+   * context */
+  width = ffmpegdec->ctx_width;
+  height = ffmpegdec->ctx_height;
+
+  /* if there is a width/height specified in the input, use that */
+  if (ffmpegdec->in_width != -1 && ffmpegdec->in_width < width)
+    width = ffmpegdec->in_width;
+  if (ffmpegdec->in_height != -1 && ffmpegdec->in_height < height)
+    height = ffmpegdec->in_height;
+
+  /* now store the values */
+  gst_video_info_set_format (&info, fmt, width, height);
+
+  /* set the interlaced flag */
+  if (ffmpegdec->ctx_interlaced)
+    info.interlace_mode = GST_VIDEO_INTERLACE_MODE_MIXED;
+  else
+    info.interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
+
+  /* try to find a good framerate */
+  if (ffmpegdec->in_fps_d) {
+    /* take framerate from input when it was specified (#313970) */
+    fps_n = ffmpegdec->in_fps_n;
+    fps_d = ffmpegdec->in_fps_d;
+  } else {
+    fps_n = ffmpegdec->ctx_time_d / ffmpegdec->ctx_ticks;
+    fps_d = ffmpegdec->ctx_time_n;
+
+    if (!fps_d) {
+      GST_LOG_OBJECT (ffmpegdec, "invalid framerate: %d/0, -> %d/1", fps_n,
+          fps_n);
+      fps_d = 1;
+    }
+    if (gst_util_fraction_compare (fps_n, fps_d, 1000, 1) > 0) {
+      GST_LOG_OBJECT (ffmpegdec, "excessive framerate: %d/%d, -> 0/1", fps_n,
+          fps_d);
+      fps_n = 0;
+      fps_d = 1;
     }
-      break;
-    default:
-      break;
   }
+  GST_LOG_OBJECT (ffmpegdec, "setting framerate: %d/%d", fps_n, fps_d);
+  info.fps_n = fps_n;
+  info.fps_d = fps_d;
+
+  /* calculate and update par now */
+  gst_ffmpegdec_update_par (ffmpegdec, &info.par_n, &info.par_d);
+
+  caps = gst_video_info_to_caps (&info);
+
+  if (!gst_pad_set_caps (ffmpegdec->srcpad, caps))
+    goto caps_failed;
+
+  ffmpegdec->out_info = info;
+
+  /* now figure out a bufferpool */
+  if (!gst_ffmpegdec_bufferpool (ffmpegdec, caps))
+    goto no_bufferpool;
+
+  gst_caps_unref (caps);
 
+  return TRUE;
+
+  /* ERRORS */
+unknown_format:
+  {
+#ifdef HAVE_LIBAV_UNINSTALLED
+    /* using internal ffmpeg snapshot */
+    GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
+        ("Could not find GStreamer caps mapping for libav pixfmt %d.",
+            ffmpegdec->ctx_pix_fmt), (NULL));
+#else
+    /* using external ffmpeg */
+    GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
+        ("Could not find GStreamer caps mapping for libav codec '%s', and "
+            "you are using an external libavcodec. This is most likely due to "
+            "a packaging problem and/or libavcodec having been upgraded to a "
+            "version that is not compatible with this version of "
+            "gstreamer-libav. Make sure your gstreamer-libav and libavcodec "
+            "packages come from the same source/repository.",
+            oclass->in_plugin->name), (NULL));
+#endif
+    return FALSE;
+  }
+caps_failed:
+  {
+    GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL),
+        ("Could not set caps for libav decoder (%s), not fixed?",
+            oclass->in_plugin->name));
+    gst_caps_unref (caps);
+
+    return FALSE;
+  }
+no_bufferpool:
+  {
+    GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL),
+        ("Could not create bufferpool for fmpeg decoder (%s)",
+            oclass->in_plugin->name));
+    gst_caps_unref (caps);
+
+    return FALSE;
+  }
+}
+
+static gboolean
+update_audio_context (GstFFMpegDec * ffmpegdec, gboolean force)
+{
+  AVCodecContext *context = ffmpegdec->context;
+  gint depth;
+  GstAudioChannelPosition pos[64] = { 0, };
+
+  depth = av_smp_format_depth (context->sample_fmt);
+
+  gst_ffmpeg_channel_layout_to_gst (context, pos);
+
+  if (!force && ffmpegdec->format.audio.samplerate ==
+      context->sample_rate &&
+      ffmpegdec->format.audio.channels == context->channels &&
+      ffmpegdec->format.audio.depth == depth &&
+      memcmp (ffmpegdec->format.audio.ffmpeg_layout, pos,
+          sizeof (GstAudioChannelPosition) * context->channels) == 0)
+    return FALSE;
+
+  GST_DEBUG_OBJECT (ffmpegdec,
+      "Renegotiating audio from %dHz@%dchannels (%d) to %dHz@%dchannels (%d)",
+      ffmpegdec->format.audio.samplerate, ffmpegdec->format.audio.channels,
+      ffmpegdec->format.audio.depth,
+      context->sample_rate, context->channels, depth);
+
+  ffmpegdec->format.audio.samplerate = context->sample_rate;
+  ffmpegdec->format.audio.channels = context->channels;
+  ffmpegdec->format.audio.depth = depth;
+  memcpy (ffmpegdec->format.audio.ffmpeg_layout, pos,
+      sizeof (GstAudioChannelPosition) * context->channels);
+
+  return TRUE;
+}
+
+static gboolean
+gst_ffmpegdec_audio_negotiate (GstFFMpegDec * ffmpegdec, gboolean force)
+{
+  GstFFMpegDecClass *oclass;
+  GstCaps *caps;
+
+  oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
+
+  if (!update_audio_context (ffmpegdec, force))
+    return TRUE;
+
+  /* convert the raw output format to caps */
   caps = gst_ffmpeg_codectype_to_caps (oclass->in_plugin->type,
       ffmpegdec->context, oclass->in_plugin->id, FALSE);
-
   if (caps == NULL)
     goto no_caps;
 
-  switch (oclass->in_plugin->type) {
-    case AVMEDIA_TYPE_VIDEO:
-    {
-      gint width, height;
-      gboolean interlaced;
+  /* Get GStreamer channel layout */
+  memcpy (ffmpegdec->format.audio.gst_layout,
+      ffmpegdec->format.audio.ffmpeg_layout,
+      sizeof (GstAudioChannelPosition) * ffmpegdec->format.audio.channels);
+  gst_audio_channel_positions_to_valid_order (ffmpegdec->format.
+      audio.gst_layout, ffmpegdec->format.audio.channels);
 
-      width = ffmpegdec->format.video.clip_width;
-      height = ffmpegdec->format.video.clip_height;
-      interlaced = ffmpegdec->format.video.interlaced;
-
-      if (width != -1 && height != -1) {
-        /* overwrite the output size with the dimension of the
-         * clipping region but only if they are smaller. */
-        if (width < ffmpegdec->context->width)
-          gst_caps_set_simple (caps, "width", G_TYPE_INT, width, NULL);
-        if (height < ffmpegdec->context->height)
-          gst_caps_set_simple (caps, "height", G_TYPE_INT, height, NULL);
-      }
-      gst_caps_set_simple (caps, "interlaced", G_TYPE_BOOLEAN, interlaced,
-          NULL);
-
-      /* If a demuxer provided a framerate then use it (#313970) */
-      if (ffmpegdec->format.video.fps_n != -1) {
-        gst_caps_set_simple (caps, "framerate",
-            GST_TYPE_FRACTION, ffmpegdec->format.video.fps_n,
-            ffmpegdec->format.video.fps_d, NULL);
-      }
-      gst_ffmpegdec_add_pixel_aspect_ratio (ffmpegdec,
-          gst_caps_get_structure (caps, 0));
-      break;
-    }
-    case AVMEDIA_TYPE_AUDIO:
-    {
-      break;
-    }
-    default:
-      break;
-  }
+  GST_LOG_OBJECT (ffmpegdec, "output caps %" GST_PTR_FORMAT, caps);
 
   if (!gst_pad_set_caps (ffmpegdec->srcpad, caps))
     goto caps_failed;
@@ -1344,19 +1461,19 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force)
   /* ERRORS */
 no_caps:
   {
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
     /* using internal ffmpeg snapshot */
     GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
-        ("Could not find GStreamer caps mapping for FFmpeg codec '%s'.",
+        ("Could not find GStreamer caps mapping for libav codec '%s'.",
             oclass->in_plugin->name), (NULL));
 #else
     /* using external ffmpeg */
     GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
-        ("Could not find GStreamer caps mapping for FFmpeg codec '%s', and "
+        ("Could not find GStreamer caps mapping for libav codec '%s', and "
             "you are using an external libavcodec. This is most likely due to "
             "a packaging problem and/or libavcodec having been upgraded to a "
             "version that is not compatible with this version of "
-            "gstreamer-ffmpeg. Make sure your gstreamer-ffmpeg and libavcodec "
+            "gstreamer-libav. Make sure your gstreamer-libav and libavcodec "
             "packages come from the same source/repository.",
             oclass->in_plugin->name), (NULL));
 #endif
@@ -1365,7 +1482,7 @@ no_caps:
 caps_failed:
   {
     GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL),
-        ("Could not set caps for ffmpeg decoder (%s), not fixed?",
+        ("Could not set caps for libav decoder (%s), not fixed?",
             oclass->in_plugin->name));
     gst_caps_unref (caps);
 
@@ -1496,7 +1613,7 @@ clip_video_buffer (GstFFMpegDec * dec, GstBuffer * buf, GstClockTime in_ts,
     GstClockTime in_dur)
 {
   gboolean res = TRUE;
-  gint64 cstart, cstop;
+  guint64 cstart, cstop;
   GstClockTime stop;
 
   GST_LOG_OBJECT (dec,
@@ -1589,67 +1706,72 @@ get_output_buffer (GstFFMpegDec * ffmpegdec, GstBuffer ** outbuf)
 {
   GstFlowReturn ret;
 
-  ret = GST_FLOW_OK;
-  *outbuf = NULL;
-
   if (ffmpegdec->picture->opaque != NULL) {
+    GstVideoFrame *frame;
+
     /* we allocated a picture already for ffmpeg to decode into, let's pick it
      * up and use it now. */
-    *outbuf = (GstBuffer *) ffmpegdec->picture->opaque;
-    GST_LOG_OBJECT (ffmpegdec, "using opaque buffer %p", *outbuf);
-#ifndef EXTRA_REF
+    frame = ffmpegdec->picture->opaque;
+    *outbuf = frame->buffer;
+    GST_LOG_OBJECT (ffmpegdec, "using opaque buffer %p on frame %p", *outbuf,
+        frame);
     gst_buffer_ref (*outbuf);
-#endif
   } else {
-    AVPicture pic, *outpic;
+    GstVideoFrame frame;
+    AVPicture *src, *dest;
+    AVFrame pic;
     gint width, height;
+    GstBuffer *buf;
 
-    GST_LOG_OBJECT (ffmpegdec, "get output buffer");
-
-    /* figure out size of output buffer, this is the clipped output size because
-     * we will copy the picture into it but only when the clipping region is
-     * smaller than the actual picture size. */
-    if ((width = ffmpegdec->format.video.clip_width) == -1)
-      width = ffmpegdec->context->width;
-    else if (width > ffmpegdec->context->width)
-      width = ffmpegdec->context->width;
+    GST_LOG_OBJECT (ffmpegdec, "allocating an output buffer");
 
-    if ((height = ffmpegdec->format.video.clip_height) == -1)
-      height = ffmpegdec->context->height;
-    else if (height > ffmpegdec->context->height)
-      height = ffmpegdec->context->height;
+    if (G_UNLIKELY (!gst_ffmpegdec_video_negotiate (ffmpegdec, FALSE)))
+      goto negotiate_failed;
 
-    GST_LOG_OBJECT (ffmpegdec, "clip width %d/height %d", width, height);
-
-    ret = alloc_output_buffer (ffmpegdec, outbuf, width, height);
+    ret = gst_buffer_pool_acquire_buffer (ffmpegdec->pool, &buf, NULL);
     if (G_UNLIKELY (ret != GST_FLOW_OK))
       goto alloc_failed;
 
-    /* original ffmpeg code does not handle odd sizes correctly.
-     * This patched up version does */
-    gst_ffmpeg_avpicture_fill (&pic, GST_BUFFER_DATA (*outbuf),
-        ffmpegdec->context->pix_fmt, width, height);
+    if (!gst_video_frame_map (&frame, &ffmpegdec->out_info, buf,
+            GST_MAP_READWRITE))
+      goto invalid_frame;
+
+    gst_ffmpegdec_fill_picture (ffmpegdec, &frame, &pic);
+
+    width = ffmpegdec->out_info.width;
+    height = ffmpegdec->out_info.height;
 
-    outpic = (AVPicture *) ffmpegdec->picture;
+    src = (AVPicture *) ffmpegdec->picture;
+    dest = (AVPicture *) & pic;
 
-    GST_LOG_OBJECT (ffmpegdec, "linsize %d %d %d", outpic->linesize[0],
-        outpic->linesize[1], outpic->linesize[2]);
-    GST_LOG_OBJECT (ffmpegdec, "data %u %u %u", 0,
-        (guint) (outpic->data[1] - outpic->data[0]),
-        (guint) (outpic->data[2] - outpic->data[0]));
+    GST_CAT_TRACE_OBJECT (GST_CAT_PERFORMANCE, ffmpegdec,
+        "copy picture to output buffer %dx%d", width, height);
+    av_picture_copy (dest, src, ffmpegdec->context->pix_fmt, width, height);
 
-    av_picture_copy (&pic, outpic, ffmpegdec->context->pix_fmt, width, height);
+    gst_video_frame_unmap (&frame);
+
+    *outbuf = buf;
   }
   ffmpegdec->picture->reordered_opaque = -1;
 
-  return ret;
+  return GST_FLOW_OK;
 
   /* special cases */
+negotiate_failed:
+  {
+    GST_DEBUG_OBJECT (ffmpegdec, "negotiation failed");
+    return GST_FLOW_NOT_NEGOTIATED;
+  }
 alloc_failed:
   {
-    GST_DEBUG_OBJECT (ffmpegdec, "pad_alloc failed");
+    GST_DEBUG_OBJECT (ffmpegdec, "buffer alloc failed");
     return ret;
   }
+invalid_frame:
+  {
+    GST_DEBUG_OBJECT (ffmpegdec, "could not map frame");
+    return GST_FLOW_ERROR;
+  }
 }
 
 static void
@@ -1696,9 +1818,7 @@ gst_avpacket_init (AVPacket * packet, guint8 * data, guint size)
  * ffmpegdec:
  * data: pointer to the data to decode
  * size: size of data in bytes
- * in_timestamp: incoming timestamp.
- * in_duration: incoming duration.
- * in_offset: incoming offset (frame number).
+ * dec_info: timestamp info
  * outbuf: outgoing buffer. Different from NULL ONLY if it contains decoded data.
  * ret: Return flow.
  *
@@ -1716,7 +1836,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
   gboolean mode_switch;
   gboolean decode;
   gint skip_frame = AVDISCARD_DEFAULT;
-  GstClockTime out_timestamp, out_duration, out_pts;
+  GstClockTime out_dts, out_pts, out_duration;
   gint64 out_offset;
   const GstTSInfo *out_info;
   AVPacket packet;
@@ -1731,7 +1851,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
 
   /* run QoS code, we don't stop decoding the frame when we are late because
    * else we might skip a reference frame */
-  decode = gst_ffmpegdec_do_qos (ffmpegdec, dec_info->timestamp, &mode_switch);
+  decode = gst_ffmpegdec_do_qos (ffmpegdec, dec_info->pts, &mode_switch);
 
   if (ffmpegdec->is_realvideo && data != NULL) {
     gint slice_count;
@@ -1794,13 +1914,15 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
 
   /* get the output picture timing info again */
   out_info = gst_ts_info_get (ffmpegdec, ffmpegdec->picture->reordered_opaque);
-  out_pts = out_info->timestamp;
+  out_dts = out_info->dts;
+  out_pts = out_info->pts;
   out_duration = out_info->duration;
   out_offset = out_info->offset;
 
   GST_DEBUG_OBJECT (ffmpegdec,
-      "pts %" G_GUINT64_FORMAT " duration %" G_GUINT64_FORMAT " offset %"
-      G_GINT64_FORMAT, out_pts, out_duration, out_offset);
+      "dts %" G_GUINT64_FORMAT " pts %" G_GUINT64_FORMAT " duration %"
+      G_GUINT64_FORMAT " offset %" G_GINT64_FORMAT, out_dts, out_pts,
+      out_duration, out_offset);
   GST_DEBUG_OBJECT (ffmpegdec, "picture: pts %" G_GUINT64_FORMAT,
       (guint64) ffmpegdec->picture->pts);
   GST_DEBUG_OBJECT (ffmpegdec, "picture: num %d",
@@ -1819,15 +1941,13 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
       ffmpegdec->picture->interlaced_frame);
 
   if (G_UNLIKELY (ffmpegdec->picture->interlaced_frame !=
-          ffmpegdec->format.video.interlaced)) {
+          ffmpegdec->ctx_interlaced)) {
     GST_WARNING ("Change in interlacing ! picture:%d, recorded:%d",
-        ffmpegdec->picture->interlaced_frame,
-        ffmpegdec->format.video.interlaced);
-    ffmpegdec->format.video.interlaced = ffmpegdec->picture->interlaced_frame;
-    gst_ffmpegdec_negotiate (ffmpegdec, TRUE);
+        ffmpegdec->picture->interlaced_frame, ffmpegdec->ctx_interlaced);
+    ffmpegdec->ctx_interlaced = ffmpegdec->picture->interlaced_frame;
+    gst_ffmpegdec_video_negotiate (ffmpegdec, TRUE);
   }
-
-
+#if 0
   /* Whether a frame is interlaced or not is unknown at the time of
      buffer allocation, so caps on the buffer in opaque will have
      the previous frame's interlaced flag set. So if interlacedness
@@ -1848,27 +1968,12 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
       }
     }
   }
+#endif
 
   /* check if we are dealing with a keyframe here, this will also check if we
    * are dealing with B frames. */
   iskeyframe = check_keyframe (ffmpegdec);
 
-  /* check that the timestamps go upwards */
-  if (ffmpegdec->last_out != -1 && ffmpegdec->last_out > out_pts) {
-    /* timestamps go backwards, this means frames were reordered and we must
-     * be dealing with DTS as the buffer timestamps */
-    if (!ffmpegdec->reordered_out) {
-      GST_DEBUG_OBJECT (ffmpegdec, "detected reordered out timestamps");
-      ffmpegdec->reordered_out = TRUE;
-    }
-    if (ffmpegdec->reordered_in) {
-      /* we reset the input reordering here because we want to recover from an
-       * occasionally wrong reordered input timestamp */
-      GST_DEBUG_OBJECT (ffmpegdec, "assuming DTS input timestamps");
-      ffmpegdec->reordered_in = FALSE;
-    }
-  }
-
   if (out_pts == 0 && out_pts == ffmpegdec->last_out) {
     GST_LOG_OBJECT (ffmpegdec, "ffmpeg returns 0 timestamps, ignoring");
     /* some codecs only output 0 timestamps, when that happens, make us select an
@@ -1879,17 +1984,11 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
   } else
     ffmpegdec->last_out = out_pts;
 
-  /* we assume DTS as input timestamps unless we see reordered input
-   * timestamps */
-  if (!ffmpegdec->reordered_in && ffmpegdec->reordered_out) {
-    /* PTS and DTS are the same for keyframes */
-    if (!iskeyframe && ffmpegdec->next_out != -1) {
-      /* interpolate all timestamps except for keyframes, FIXME, this is
-       * wrong when QoS is active. */
-      GST_DEBUG_OBJECT (ffmpegdec, "interpolate timestamps");
-      out_pts = -1;
-      out_offset = -1;
-    }
+
+  if (iskeyframe && out_pts == -1) {
+    GST_DEBUG_OBJECT (ffmpegdec, "keyframe, use DTS %" GST_TIME_FORMAT,
+        GST_TIME_ARGS (out_dts));
+    out_pts = out_dts;
   }
 
   /* when we're waiting for a keyframe, see if we have one or drop the current
@@ -1914,24 +2013,21 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
    *  2) else interpolate from previous output timestamp
    *  3) else copy input timestamp
    */
-  out_timestamp = -1;
   if (out_pts != -1) {
-    /* Get (interpolated) timestamp from FFMPEG */
-    out_timestamp = (GstClockTime) out_pts;
+    /* Use (interpolated) timestamp from FFMPEG */
     GST_LOG_OBJECT (ffmpegdec, "using timestamp %" GST_TIME_FORMAT
-        " returned by ffmpeg", GST_TIME_ARGS (out_timestamp));
-  }
-  if (!GST_CLOCK_TIME_IS_VALID (out_timestamp) && ffmpegdec->next_out != -1) {
-    out_timestamp = ffmpegdec->next_out;
+        " returned by ffmpeg", GST_TIME_ARGS (out_pts));
+  } else if (ffmpegdec->next_out != -1) {
+    out_pts = ffmpegdec->next_out;
     GST_LOG_OBJECT (ffmpegdec, "using next timestamp %" GST_TIME_FORMAT,
-        GST_TIME_ARGS (out_timestamp));
-  }
-  if (!GST_CLOCK_TIME_IS_VALID (out_timestamp)) {
-    out_timestamp = dec_info->timestamp;
+        GST_TIME_ARGS (out_pts));
+  } else {
+    out_pts = dec_info->pts;
     GST_LOG_OBJECT (ffmpegdec, "using in timestamp %" GST_TIME_FORMAT,
-        GST_TIME_ARGS (out_timestamp));
+        GST_TIME_ARGS (out_pts));
   }
-  GST_BUFFER_TIMESTAMP (*outbuf) = out_timestamp;
+  GST_BUFFER_DTS (*outbuf) = out_pts;
+  GST_BUFFER_PTS (*outbuf) = out_pts;
 
   /*
    * Offset:
@@ -1942,16 +2038,15 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
   if (out_offset != GST_BUFFER_OFFSET_NONE) {
     /* out_offset already contains the offset from ts_info */
     GST_LOG_OBJECT (ffmpegdec, "Using offset returned by ffmpeg");
-  } else if (out_timestamp != GST_CLOCK_TIME_NONE) {
-    GstFormat out_fmt = GST_FORMAT_DEFAULT;
+  } else if (out_pts != GST_CLOCK_TIME_NONE) {
     GST_LOG_OBJECT (ffmpegdec, "Using offset converted from timestamp");
     /* FIXME, we should really remove this as it's not nice at all to do
      * upstream queries for each frame to get the frame offset. We also can't
      * really remove this because it is the only way of setting frame offsets
      * on outgoing buffers. We should have metadata so that the upstream peer
      * can set a frame number on the encoded data. */
-    gst_pad_query_peer_convert (ffmpegdec->sinkpad,
-        GST_FORMAT_TIME, out_timestamp, &out_fmt, &out_offset);
+    gst_pad_peer_query_convert (ffmpegdec->sinkpad,
+        GST_FORMAT_TIME, out_pts, GST_FORMAT_DEFAULT, &out_offset);
   } else if (dec_info->offset != GST_BUFFER_OFFSET_NONE) {
     /* FIXME, the input offset is input media specific and might not
      * be the same for the output media. (byte offset as input, frame number
@@ -1975,32 +2070,38 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
    */
   if (GST_CLOCK_TIME_IS_VALID (out_duration)) {
     /* We have a valid (reordered) duration */
-    GST_LOG_OBJECT (ffmpegdec, "Using duration returned by ffmpeg");
+    GST_LOG_OBJECT (ffmpegdec,
+        "Using duration returned by ffmpeg %" GST_TIME_FORMAT,
+        GST_TIME_ARGS (out_duration));
   } else if (GST_CLOCK_TIME_IS_VALID (dec_info->duration)) {
-    GST_LOG_OBJECT (ffmpegdec, "using in_duration");
     out_duration = dec_info->duration;
+    GST_LOG_OBJECT (ffmpegdec, "using in_duration %" GST_TIME_FORMAT,
+        GST_TIME_ARGS (out_duration));
   } else if (GST_CLOCK_TIME_IS_VALID (ffmpegdec->last_diff)) {
-    GST_LOG_OBJECT (ffmpegdec, "using last-diff");
     out_duration = ffmpegdec->last_diff;
+    GST_LOG_OBJECT (ffmpegdec, "using last-diff %" GST_TIME_FORMAT,
+        GST_TIME_ARGS (out_duration));
   } else {
     /* if we have an input framerate, use that */
-    if (ffmpegdec->format.video.fps_n != -1 &&
-        (ffmpegdec->format.video.fps_n != 1000 &&
-            ffmpegdec->format.video.fps_d != 1)) {
-      GST_LOG_OBJECT (ffmpegdec, "using input framerate for duration");
+    if (ffmpegdec->out_info.fps_n != -1 &&
+        (ffmpegdec->out_info.fps_n != 1000 && ffmpegdec->out_info.fps_d != 1)) {
       out_duration = gst_util_uint64_scale_int (GST_SECOND,
-          ffmpegdec->format.video.fps_d, ffmpegdec->format.video.fps_n);
+          ffmpegdec->out_info.fps_d, ffmpegdec->out_info.fps_n);
+      GST_LOG_OBJECT (ffmpegdec,
+          "using input framerate for duration %" GST_TIME_FORMAT,
+          GST_TIME_ARGS (out_duration));
     } else {
       /* don't try to use the decoder's framerate when it seems a bit abnormal,
        * which we assume when den >= 1000... */
       if (ffmpegdec->context->time_base.num != 0 &&
           (ffmpegdec->context->time_base.den > 0 &&
               ffmpegdec->context->time_base.den < 1000)) {
-        GST_LOG_OBJECT (ffmpegdec, "using decoder's framerate for duration");
         out_duration = gst_util_uint64_scale_int (GST_SECOND,
             ffmpegdec->context->time_base.num *
             ffmpegdec->context->ticks_per_frame,
             ffmpegdec->context->time_base.den);
+        GST_LOG_OBJECT (ffmpegdec, "using decoder's framerate for duration %"
+            GST_TIME_FORMAT, GST_TIME_ARGS (out_duration));
       } else {
         GST_LOG_OBJECT (ffmpegdec, "no valid duration found");
       }
@@ -2009,22 +2110,30 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
 
   /* Take repeat_pict into account */
   if (GST_CLOCK_TIME_IS_VALID (out_duration)) {
+    GST_LOG_OBJECT (ffmpegdec, "repeat pict %d",
+        ffmpegdec->picture->repeat_pict);
     out_duration += out_duration * ffmpegdec->picture->repeat_pict / 2;
   }
   GST_BUFFER_DURATION (*outbuf) = out_duration;
 
-  if (out_timestamp != -1 && out_duration != -1 && out_duration != 0)
-    ffmpegdec->next_out = out_timestamp + out_duration;
+  if (out_dts != -1 && out_duration != -1 && out_duration != 0)
+    ffmpegdec->next_out = out_pts + out_duration;
   else
     ffmpegdec->next_out = -1;
 
+  GST_LOG_OBJECT (ffmpegdec, "next out %" GST_TIME_FORMAT,
+      GST_TIME_ARGS (ffmpegdec->next_out));
+
   /* palette is not part of raw video frame in gst and the size
    * of the outgoing buffer needs to be adjusted accordingly */
-  if (ffmpegdec->context->palctrl != NULL)
-    GST_BUFFER_SIZE (*outbuf) -= AVPALETTE_SIZE;
+  if (ffmpegdec->context->palctrl != NULL) {
+
+    gst_buffer_resize (*outbuf, 0,
+        gst_buffer_get_size (*outbuf) - AVPALETTE_SIZE);
+  }
 
   /* now see if we need to clip the buffer against the segment boundaries. */
-  if (G_UNLIKELY (!clip_video_buffer (ffmpegdec, *outbuf, out_timestamp,
+  if (G_UNLIKELY (!clip_video_buffer (ffmpegdec, *outbuf, out_pts,
               out_duration)))
     goto clipped;
 
@@ -2033,7 +2142,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
     GST_BUFFER_FLAG_SET (*outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
 
   if (ffmpegdec->picture->top_field_first)
-    GST_BUFFER_FLAG_SET (*outbuf, GST_VIDEO_BUFFER_TFF);
+    GST_BUFFER_FLAG_SET (*outbuf, GST_VIDEO_BUFFER_FLAG_TFF);
 
 
 beach:
@@ -2069,13 +2178,18 @@ clip_audio_buffer (GstFFMpegDec * dec, GstBuffer * buf, GstClockTime in_ts,
     GstClockTime in_dur)
 {
   GstClockTime stop;
-  gint64 diff, ctime, cstop;
+  gint64 diff;
+  guint64 ctime, cstop;
   gboolean res = TRUE;
+  gsize size, offset;
+
+  size = gst_buffer_get_size (buf);
+  offset = 0;
 
   GST_LOG_OBJECT (dec,
       "timestamp:%" GST_TIME_FORMAT ", duration:%" GST_TIME_FORMAT
-      ", size %u", GST_TIME_ARGS (in_ts), GST_TIME_ARGS (in_dur),
-      GST_BUFFER_SIZE (buf));
+      ", size %" G_GSIZE_FORMAT, GST_TIME_ARGS (in_ts), GST_TIME_ARGS (in_dur),
+      size);
 
   /* can't clip without TIME segment */
   if (G_UNLIKELY (dec->segment.format != GST_FORMAT_TIME))
@@ -2103,8 +2217,8 @@ clip_audio_buffer (GstFFMpegDec * dec, GstBuffer * buf, GstClockTime in_ts,
     GST_DEBUG_OBJECT (dec, "clipping start to %" GST_TIME_FORMAT " %"
         G_GINT64_FORMAT " bytes", GST_TIME_ARGS (ctime), diff);
 
-    GST_BUFFER_SIZE (buf) -= diff;
-    GST_BUFFER_DATA (buf) += diff;
+    offset += diff;
+    size -= diff;
   }
   if (G_UNLIKELY ((diff = stop - cstop) > 0)) {
     /* bring clipped time to bytes */
@@ -2115,8 +2229,9 @@ clip_audio_buffer (GstFFMpegDec * dec, GstBuffer * buf, GstClockTime in_ts,
     GST_DEBUG_OBJECT (dec, "clipping stop to %" GST_TIME_FORMAT " %"
         G_GINT64_FORMAT " bytes", GST_TIME_ARGS (cstop), diff);
 
-    GST_BUFFER_SIZE (buf) -= diff;
+    size -= diff;
   }
+  gst_buffer_resize (buf, offset, size);
   GST_BUFFER_TIMESTAMP (buf) = ctime;
   GST_BUFFER_DURATION (buf) = cstop - ctime;
 
@@ -2139,38 +2254,45 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
 {
   gint len = -1;
   gint have_data = AVCODEC_MAX_AUDIO_FRAME_SIZE;
-  GstClockTime out_timestamp, out_duration;
+  GstClockTime out_pts, out_duration;
+  GstMapInfo map;
   gint64 out_offset;
+  int16_t *odata;
   AVPacket packet;
 
   GST_DEBUG_OBJECT (ffmpegdec,
-      "size:%d, offset:%" G_GINT64_FORMAT ", ts:%" GST_TIME_FORMAT ", dur:%"
-      GST_TIME_FORMAT ", ffmpegdec->next_out:%" GST_TIME_FORMAT, size,
-      dec_info->offset, GST_TIME_ARGS (dec_info->timestamp),
-      GST_TIME_ARGS (dec_info->duration), GST_TIME_ARGS (ffmpegdec->next_out));
+      "size:%d, offset:%" G_GINT64_FORMAT ", dts:%" GST_TIME_FORMAT ", pts:%"
+      GST_TIME_FORMAT ", dur:%" GST_TIME_FORMAT ", ffmpegdec->next_out:%"
+      GST_TIME_FORMAT, size, dec_info->offset, GST_TIME_ARGS (dec_info->dts),
+      GST_TIME_ARGS (dec_info->pts), GST_TIME_ARGS (dec_info->duration),
+      GST_TIME_ARGS (ffmpegdec->next_out));
+
+  *outbuf = new_aligned_buffer (AVCODEC_MAX_AUDIO_FRAME_SIZE);
 
-  *outbuf =
-      new_aligned_buffer (AVCODEC_MAX_AUDIO_FRAME_SIZE,
-      GST_PAD_CAPS (ffmpegdec->srcpad));
+  gst_buffer_map (*outbuf, &map, GST_MAP_WRITE);
+  odata = (int16_t *) map.data;
 
   gst_avpacket_init (&packet, data, size);
-  len = avcodec_decode_audio3 (ffmpegdec->context,
-      (int16_t *) GST_BUFFER_DATA (*outbuf), &have_data, &packet);
+  len = avcodec_decode_audio3 (ffmpegdec->context, odata, &have_data, &packet);
+
   GST_DEBUG_OBJECT (ffmpegdec,
       "Decode audio: len=%d, have_data=%d", len, have_data);
 
   if (len >= 0 && have_data > 0) {
+    GstAudioFormat fmt;
+
+    /* Buffer size */
+    gst_buffer_unmap (*outbuf, &map);
+    gst_buffer_resize (*outbuf, 0, have_data);
+
     GST_DEBUG_OBJECT (ffmpegdec, "Creating output buffer");
-    if (!gst_ffmpegdec_negotiate (ffmpegdec, FALSE)) {
+    if (!gst_ffmpegdec_audio_negotiate (ffmpegdec, FALSE)) {
       gst_buffer_unref (*outbuf);
       *outbuf = NULL;
       len = -1;
       goto beach;
     }
 
-    /* Buffer size */
-    GST_BUFFER_SIZE (*outbuf) = have_data;
-
     /*
      * Timestamps:
      *
@@ -2178,10 +2300,10 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
      *  2) else interpolate from previous input timestamp
      */
     /* always take timestamps from the input buffer if any */
-    if (GST_CLOCK_TIME_IS_VALID (dec_info->timestamp)) {
-      out_timestamp = dec_info->timestamp;
+    if (GST_CLOCK_TIME_IS_VALID (dec_info->pts)) {
+      out_pts = dec_info->pts;
     } else {
-      out_timestamp = ffmpegdec->next_out;
+      out_pts = ffmpegdec->next_out;
     }
 
     /*
@@ -2200,25 +2322,36 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
     out_offset = dec_info->offset;
 
     GST_DEBUG_OBJECT (ffmpegdec,
-        "Buffer created. Size:%d , timestamp:%" GST_TIME_FORMAT " , duration:%"
+        "Buffer created. Size:%d , pts:%" GST_TIME_FORMAT " , duration:%"
         GST_TIME_FORMAT, have_data,
-        GST_TIME_ARGS (out_timestamp), GST_TIME_ARGS (out_duration));
+        GST_TIME_ARGS (out_pts), GST_TIME_ARGS (out_duration));
 
-    GST_BUFFER_TIMESTAMP (*outbuf) = out_timestamp;
+    GST_BUFFER_PTS (*outbuf) = out_pts;
     GST_BUFFER_DURATION (*outbuf) = out_duration;
     GST_BUFFER_OFFSET (*outbuf) = out_offset;
-    gst_buffer_set_caps (*outbuf, GST_PAD_CAPS (ffmpegdec->srcpad));
 
     /* the next timestamp we'll use when interpolating */
-    if (GST_CLOCK_TIME_IS_VALID (out_timestamp))
-      ffmpegdec->next_out = out_timestamp + out_duration;
+    if (GST_CLOCK_TIME_IS_VALID (out_pts))
+      ffmpegdec->next_out = out_pts + out_duration;
 
     /* now see if we need to clip the buffer against the segment boundaries. */
-    if (G_UNLIKELY (!clip_audio_buffer (ffmpegdec, *outbuf, out_timestamp,
+    if (G_UNLIKELY (!clip_audio_buffer (ffmpegdec, *outbuf, out_pts,
                 out_duration)))
       goto clipped;
 
+
+    /* Reorder channels to the GStreamer channel order */
+    /* Only the width really matters here... and it's stored as depth */
+    fmt =
+        gst_audio_format_build_integer (TRUE, G_BYTE_ORDER,
+        ffmpegdec->format.audio.depth * 8, ffmpegdec->format.audio.depth * 8);
+
+    gst_audio_buffer_reorder_channels (*outbuf, fmt,
+        ffmpegdec->format.audio.channels,
+        ffmpegdec->format.audio.ffmpeg_layout,
+        ffmpegdec->format.audio.gst_layout);
   } else {
+    gst_buffer_unmap (*outbuf, &map);
     gst_buffer_unref (*outbuf);
     *outbuf = NULL;
   }
@@ -2228,7 +2361,7 @@ gst_ffmpegdec_audio_frame (GstFFMpegDec * ffmpegdec,
   if (len == -1 && (in_plugin->id == CODEC_ID_AAC
           || in_plugin->id == CODEC_ID_AAC_LATM)) {
     GST_ELEMENT_ERROR (ffmpegdec, STREAM, DECODE, (NULL),
-        ("Decoding of AAC stream by FFMPEG failed."));
+        ("Decoding of AAC stream by libav failed."));
     *ret = GST_FLOW_ERROR;
   }
 
@@ -2311,7 +2444,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
 
   if (len < 0 || have_data < 0) {
     GST_WARNING_OBJECT (ffmpegdec,
-        "ffdec_%s: decoding error (len: %d, have_data: %d)",
+        "avdec_%s: decoding error (len: %d, have_data: %d)",
         oclass->in_plugin->name, len, have_data);
     *got_data = 0;
     goto beach;
@@ -2336,7 +2469,6 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
       GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
       ffmpegdec->discont = FALSE;
     }
-
     if (ffmpegdec->segment.rate > 0.0) {
       /* and off we go */
       *ret = gst_pad_push (ffmpegdec->srcpad, outbuf);
@@ -2372,7 +2504,7 @@ gst_ffmpegdec_drain (GstFFMpegDec * ffmpegdec)
     gint have_data, len, try = 0;
 
     GST_LOG_OBJECT (ffmpegdec,
-        "codec has delay capabilities, calling until ffmpeg has drained everything");
+        "codec has delay capabilities, calling until libav has drained everything");
 
     do {
       GstFlowReturn ret;
@@ -2416,12 +2548,12 @@ gst_ffmpegdec_flush_pcache (GstFFMpegDec * ffmpegdec)
 }
 
 static gboolean
-gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
+gst_ffmpegdec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
 {
   GstFFMpegDec *ffmpegdec;
   gboolean ret = FALSE;
 
-  ffmpegdec = (GstFFMpegDec *) gst_pad_get_parent (pad);
+  ffmpegdec = (GstFFMpegDec *) parent;
 
   GST_DEBUG_OBJECT (ffmpegdec, "Handling %s event",
       GST_EVENT_TYPE_NAME (event));
@@ -2445,17 +2577,32 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
       clear_queued (ffmpegdec);
       break;
     }
-    case GST_EVENT_NEWSEGMENT:
+    case GST_EVENT_CAPS:
+    {
+      GstCaps *caps;
+
+      gst_event_parse_caps (event, &caps);
+
+      if (!ffmpegdec->last_caps
+          || !gst_caps_is_equal (ffmpegdec->last_caps, caps)) {
+        ret = gst_ffmpegdec_setcaps (ffmpegdec, caps);
+        if (ret) {
+          gst_caps_replace (&ffmpegdec->last_caps, caps);
+        }
+      } else {
+        ret = TRUE;
+      }
+
+      gst_event_unref (event);
+      goto done;
+    }
+    case GST_EVENT_SEGMENT:
     {
-      gboolean update;
-      GstFormat fmt;
-      gint64 start, stop, time;
-      gdouble rate, arate;
+      GstSegment segment;
 
-      gst_event_parse_new_segment_full (event, &update, &rate, &arate, &fmt,
-          &start, &stop, &time);
+      gst_event_copy_segment (event, &segment);
 
-      switch (fmt) {
+      switch (segment.format) {
         case GST_FORMAT_TIME:
           /* fine, our native segment format */
           break;
@@ -2472,23 +2619,25 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
           GST_DEBUG_OBJECT (ffmpegdec, "bitrate: %d", bit_rate);
 
           /* convert values to TIME */
-          if (start != -1)
-            start = gst_util_uint64_scale_int (start, GST_SECOND, bit_rate);
-          if (stop != -1)
-            stop = gst_util_uint64_scale_int (stop, GST_SECOND, bit_rate);
-          if (time != -1)
-            time = gst_util_uint64_scale_int (time, GST_SECOND, bit_rate);
+          if (segment.start != -1)
+            segment.start =
+                gst_util_uint64_scale_int (segment.start, GST_SECOND, bit_rate);
+          if (segment.stop != -1)
+            segment.stop =
+                gst_util_uint64_scale_int (segment.stop, GST_SECOND, bit_rate);
+          if (segment.time != -1)
+            segment.time =
+                gst_util_uint64_scale_int (segment.time, GST_SECOND, bit_rate);
 
           /* unref old event */
           gst_event_unref (event);
 
           /* create new converted time segment */
-          fmt = GST_FORMAT_TIME;
+          segment.format = GST_FORMAT_TIME;
           /* FIXME, bitrate is not good enough too find a good stop, let's
            * hope start and time were 0... meh. */
-          stop = -1;
-          event = gst_event_new_new_segment (update, rate, fmt,
-              start, stop, time);
+          segment.stop = -1;
+          event = gst_event_new_segment (&segment);
           break;
         }
         default:
@@ -2501,13 +2650,11 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
       if (ffmpegdec->context->codec)
         gst_ffmpegdec_drain (ffmpegdec);
 
-      GST_DEBUG_OBJECT (ffmpegdec,
-          "NEWSEGMENT in time start %" GST_TIME_FORMAT " -- stop %"
-          GST_TIME_FORMAT, GST_TIME_ARGS (start), GST_TIME_ARGS (stop));
+      GST_DEBUG_OBJECT (ffmpegdec, "SEGMENT in time %" GST_SEGMENT_FORMAT,
+          &segment);
 
       /* and store the values */
-      gst_segment_set_newsegment_full (&ffmpegdec->segment, update,
-          rate, arate, fmt, start, stop, time);
+      gst_segment_copy_into (&segment, &ffmpegdec->segment);
       break;
     }
     default:
@@ -2518,7 +2665,6 @@ gst_ffmpegdec_sink_event (GstPad * pad, GstEvent * event)
   ret = gst_pad_push_event (ffmpegdec->srcpad, event);
 
 done:
-  gst_object_unref (ffmpegdec);
 
   return ret;
 
@@ -2537,22 +2683,73 @@ invalid_format:
   }
 }
 
+static gboolean
+gst_ffmpegdec_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
+{
+  GstFFMpegDec *ffmpegdec;
+  gboolean ret = FALSE;
+
+  ffmpegdec = (GstFFMpegDec *) parent;
+
+  GST_DEBUG_OBJECT (ffmpegdec, "Handling %s query",
+      GST_QUERY_TYPE_NAME (query));
+
+  switch (GST_QUERY_TYPE (query)) {
+    case GST_QUERY_ACCEPT_CAPS:
+    {
+      GstPadTemplate *templ;
+
+      ret = FALSE;
+      if ((templ = GST_PAD_PAD_TEMPLATE (pad))) {
+        GstCaps *tcaps;
+
+        if ((tcaps = GST_PAD_TEMPLATE_CAPS (templ))) {
+          GstCaps *caps;
+
+          gst_query_parse_accept_caps (query, &caps);
+          gst_query_set_accept_caps_result (query,
+              gst_caps_is_subset (caps, tcaps));
+          ret = TRUE;
+        }
+      }
+      break;
+    }
+    case GST_QUERY_ALLOCATION:
+    {
+      GstAllocationParams params;
+
+      gst_allocation_params_init (&params);
+      params.flags = GST_MEMORY_FLAG_ZERO_PADDED;
+      params.padding = FF_INPUT_BUFFER_PADDING_SIZE;
+      /* we would like to have some padding so that we don't have to
+       * memcpy. We don't suggest an allocator. */
+      gst_query_add_allocation_param (query, NULL, &params);
+      ret = TRUE;
+      break;
+    }
+    default:
+      ret = gst_pad_query_default (pad, parent, query);
+      break;
+  }
+  return ret;
+}
+
 static GstFlowReturn
-gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
+gst_ffmpegdec_chain (GstPad * pad, GstObject * parent, GstBuffer * inbuf)
 {
   GstFFMpegDec *ffmpegdec;
   GstFFMpegDecClass *oclass;
   guint8 *data, *bdata;
+  GstMapInfo map;
   gint size, bsize, len, have_data;
   GstFlowReturn ret = GST_FLOW_OK;
-  GstClockTime in_timestamp;
-  GstClockTime in_duration;
-  gboolean discont;
+  GstClockTime in_pts, in_dts, in_duration;
+  gboolean discont, do_padding;
   gint64 in_offset;
   const GstTSInfo *in_info;
   const GstTSInfo *dec_info;
 
-  ffmpegdec = (GstFFMpegDec *) (GST_PAD_PARENT (pad));
+  ffmpegdec = (GstFFMpegDec *) parent;
 
   if (G_UNLIKELY (!ffmpegdec->opened))
     goto not_negotiated;
@@ -2593,50 +2790,36 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
   if (ffmpegdec->pcache) {
     /* join with previous data */
     GST_LOG_OBJECT (ffmpegdec, "join parse cache");
-    inbuf = gst_buffer_join (ffmpegdec->pcache, inbuf);
+    inbuf = gst_buffer_append (ffmpegdec->pcache, inbuf);
     /* no more cached data, we assume we can consume the complete cache */
     ffmpegdec->pcache = NULL;
   }
 
-  in_timestamp = GST_BUFFER_TIMESTAMP (inbuf);
+  in_dts = GST_BUFFER_DTS (inbuf);
+  in_pts = GST_BUFFER_PTS (inbuf);
   in_duration = GST_BUFFER_DURATION (inbuf);
   in_offset = GST_BUFFER_OFFSET (inbuf);
 
   /* get handle to timestamp info, we can pass this around to ffmpeg */
-  in_info = gst_ts_info_store (ffmpegdec, in_timestamp, in_duration, in_offset);
-
-  if (in_timestamp != -1) {
-    /* check for increasing timestamps if they are jumping backwards, we
-     * probably are dealing with PTS as timestamps */
-    if (!ffmpegdec->reordered_in && ffmpegdec->last_in != -1) {
-      if (in_timestamp < ffmpegdec->last_in) {
-        GST_LOG_OBJECT (ffmpegdec, "detected reordered input timestamps");
-        ffmpegdec->reordered_in = TRUE;
-        ffmpegdec->last_diff = GST_CLOCK_TIME_NONE;
-      } else if (in_timestamp > ffmpegdec->last_in) {
-        GstClockTime diff;
-        /* keep track of timestamp diff to estimate duration */
-        diff = in_timestamp - ffmpegdec->last_in;
-        /* need to scale with amount of frames in the interval */
-        if (ffmpegdec->last_frames)
-          diff /= ffmpegdec->last_frames;
-
-        GST_LOG_OBJECT (ffmpegdec, "estimated duration %" GST_TIME_FORMAT " %u",
-            GST_TIME_ARGS (diff), ffmpegdec->last_frames);
-
-        ffmpegdec->last_diff = diff;
-      }
-    }
-    ffmpegdec->last_in = in_timestamp;
+  in_info =
+      gst_ts_info_store (ffmpegdec, in_dts, in_pts, in_duration, in_offset);
+
+  if (in_dts != -1) {
+    GstClockTime diff;
+    /* keep track of timestamp diff to estimate duration */
+    diff = in_dts - ffmpegdec->last_dts;
+    /* need to scale with amount of frames in the interval */
+    if (ffmpegdec->last_frames)
+      diff /= ffmpegdec->last_frames;
+
+    GST_LOG_OBJECT (ffmpegdec, "estimated duration %" GST_TIME_FORMAT " %u",
+        GST_TIME_ARGS (diff), ffmpegdec->last_frames);
+
+    ffmpegdec->last_diff = diff;
+    ffmpegdec->last_dts = in_dts;
     ffmpegdec->last_frames = 0;
   }
 
-  GST_LOG_OBJECT (ffmpegdec,
-      "Received new data of size %u, offset:%" G_GUINT64_FORMAT ", ts:%"
-      GST_TIME_FORMAT ", dur:%" GST_TIME_FORMAT ", info %d",
-      GST_BUFFER_SIZE (inbuf), GST_BUFFER_OFFSET (inbuf),
-      GST_TIME_ARGS (in_timestamp), GST_TIME_ARGS (in_duration), in_info->idx);
-
   /* workarounds, functions write to buffers:
    *  libavcodec/svq1.c:svq1_decode_frame writes to the given buffer.
    *  libavcodec/svq3.c:svq3_decode_slice_header too.
@@ -2646,10 +2829,19 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
     inbuf = gst_buffer_make_writable (inbuf);
   }
 
-  bdata = GST_BUFFER_DATA (inbuf);
-  bsize = GST_BUFFER_SIZE (inbuf);
+  gst_buffer_map (inbuf, &map, GST_MAP_READ);
+
+  bdata = map.data;
+  bsize = map.size;
 
-  if (ffmpegdec->do_padding) {
+  GST_LOG_OBJECT (ffmpegdec,
+      "Received new data of size %u, offset:%" G_GUINT64_FORMAT ", dts:%"
+      GST_TIME_FORMAT ", pts:%" GST_TIME_FORMAT ", dur:%" GST_TIME_FORMAT
+      ", info %d", bsize, in_offset, GST_TIME_ARGS (in_dts),
+      GST_TIME_ARGS (in_pts), GST_TIME_ARGS (in_duration), in_info->idx);
+
+  if (!GST_MEMORY_IS_ZERO_PADDED (map.memory)
+      || (map.maxsize - map.size) < FF_INPUT_BUFFER_PADDING_SIZE) {
     /* add padding */
     if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
       ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
@@ -2657,6 +2849,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
       GST_LOG_OBJECT (ffmpegdec, "resized padding buffer to %d",
           ffmpegdec->padded_size);
     }
+    GST_CAT_TRACE_OBJECT (GST_CAT_PERFORMANCE, ffmpegdec,
+        "Copy input to add padding");
     memcpy (ffmpegdec->padded, bdata, bsize);
     memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
 
@@ -2670,10 +2864,10 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
     if (ffmpegdec->pctx) {
       gint res;
 
+      do_padding = TRUE;
       GST_LOG_OBJECT (ffmpegdec,
           "Calling av_parser_parse2 with offset %" G_GINT64_FORMAT ", ts:%"
-          GST_TIME_FORMAT " size %d", in_offset, GST_TIME_ARGS (in_timestamp),
-          bsize);
+          GST_TIME_FORMAT " size %d", in_offset, GST_TIME_ARGS (in_pts), bsize);
 
       /* feed the parser. We pass the timestamp info so that we can recover all
        * info again later */
@@ -2682,7 +2876,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
 
       GST_LOG_OBJECT (ffmpegdec,
           "parser returned res %d and size %d, id %" G_GINT64_FORMAT, res, size,
-          ffmpegdec->pctx->pts);
+          (gint64) ffmpegdec->pctx->pts);
 
       /* store pts for decoding */
       if (ffmpegdec->pctx->pts != AV_NOPTS_VALUE && ffmpegdec->pctx->pts != -1)
@@ -2717,14 +2911,17 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
           break;
       }
     } else {
+      do_padding = FALSE;
       data = bdata;
       size = bsize;
 
       dec_info = in_info;
     }
 
-    if (ffmpegdec->do_padding) {
+    if (do_padding) {
       /* add temporary padding */
+      GST_CAT_TRACE_OBJECT (GST_CAT_PERFORMANCE, ffmpegdec,
+          "Add temporary input padding");
       memcpy (tmp_padding, data + size, FF_INPUT_BUFFER_PADDING_SIZE);
       memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
     }
@@ -2733,14 +2930,14 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
     len =
         gst_ffmpegdec_frame (ffmpegdec, data, size, &have_data, dec_info, &ret);
 
-    if (ffmpegdec->do_padding) {
+    if (do_padding) {
       memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
     }
 
     if (ret != GST_FLOW_OK) {
       GST_LOG_OBJECT (ffmpegdec, "breaking because of flow ret %s",
           gst_flow_get_name (ret));
-      /* bad flow retun, make sure we discard all data and exit */
+      /* bad flow return, make sure we discard all data and exit */
       bsize = 0;
       break;
     }
@@ -2778,7 +2975,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
     /* make sure we don't use the same old timestamp for the next frame and let
      * the interpollation take care of it. */
     if (ffmpegdec->clear_ts) {
-      in_timestamp = GST_CLOCK_TIME_NONE;
+      in_dts = GST_CLOCK_TIME_NONE;
+      in_pts = GST_CLOCK_TIME_NONE;
       in_duration = GST_CLOCK_TIME_NONE;
       in_offset = GST_BUFFER_OFFSET_NONE;
       in_info = GST_TS_INFO_NONE;
@@ -2786,25 +2984,30 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
       ffmpegdec->clear_ts = TRUE;
     }
     ffmpegdec->last_frames++;
+    do_padding = TRUE;
 
     GST_LOG_OBJECT (ffmpegdec, "Before (while bsize>0).  bsize:%d , bdata:%p",
         bsize, bdata);
   } while (bsize > 0);
 
+  gst_buffer_unmap (inbuf, &map);
+
   /* keep left-over */
   if (ffmpegdec->pctx && bsize > 0) {
-    in_timestamp = GST_BUFFER_TIMESTAMP (inbuf);
+    in_pts = GST_BUFFER_PTS (inbuf);
+    in_dts = GST_BUFFER_DTS (inbuf);
     in_offset = GST_BUFFER_OFFSET (inbuf);
 
     GST_LOG_OBJECT (ffmpegdec,
-        "Keeping %d bytes of data with offset %" G_GINT64_FORMAT ", timestamp %"
-        GST_TIME_FORMAT, bsize, in_offset, GST_TIME_ARGS (in_timestamp));
+        "Keeping %d bytes of data with offset %" G_GINT64_FORMAT ", pts %"
+        GST_TIME_FORMAT, bsize, in_offset, GST_TIME_ARGS (in_pts));
 
-    ffmpegdec->pcache = gst_buffer_create_sub (inbuf,
-        GST_BUFFER_SIZE (inbuf) - bsize, bsize);
+    ffmpegdec->pcache = gst_buffer_copy_region (inbuf, GST_BUFFER_COPY_ALL,
+        gst_buffer_get_size (inbuf) - bsize, bsize);
     /* we keep timestamp, even though all we really know is that the correct
      * timestamp is not below the one from inbuf */
-    GST_BUFFER_TIMESTAMP (ffmpegdec->pcache) = in_timestamp;
+    GST_BUFFER_PTS (ffmpegdec->pcache) = in_pts;
+    GST_BUFFER_DTS (ffmpegdec->pcache) = in_dts;
     GST_BUFFER_OFFSET (ffmpegdec->pcache) = in_offset;
   } else if (bsize > 0) {
     GST_DEBUG_OBJECT (ffmpegdec, "Dropping %d bytes of data", bsize);
@@ -2818,7 +3021,7 @@ not_negotiated:
   {
     oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
     GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL),
-        ("ffdec_%s: input format was not set before data start",
+        ("avdec_%s: input format was not set before data start",
             oclass->in_plugin->name));
     gst_buffer_unref (inbuf);
     return GST_FLOW_NOT_NEGOTIATED;
@@ -2848,7 +3051,11 @@ gst_ffmpegdec_change_state (GstElement * element, GstStateChange transition)
       g_free (ffmpegdec->padded);
       ffmpegdec->padded = NULL;
       ffmpegdec->padded_size = 0;
-      ffmpegdec->can_allocate_aligned = TRUE;
+      if (ffmpegdec->pool) {
+        gst_buffer_pool_set_active (ffmpegdec->pool, FALSE);
+        gst_object_unref (ffmpegdec->pool);
+      }
+      ffmpegdec->pool = NULL;
       break;
     default:
       break;
@@ -2874,16 +3081,10 @@ gst_ffmpegdec_set_property (GObject * object,
     case PROP_DIRECT_RENDERING:
       ffmpegdec->direct_rendering = g_value_get_boolean (value);
       break;
-    case PROP_DO_PADDING:
-      ffmpegdec->do_padding = g_value_get_boolean (value);
-      break;
     case PROP_DEBUG_MV:
       ffmpegdec->debug_mv = ffmpegdec->context->debug_mv =
           g_value_get_boolean (value);
       break;
-    case PROP_CROP:
-      ffmpegdec->crop = g_value_get_boolean (value);
-      break;
     case PROP_MAX_THREADS:
       ffmpegdec->max_threads = g_value_get_int (value);
       break;
@@ -2909,15 +3110,9 @@ gst_ffmpegdec_get_property (GObject * object,
     case PROP_DIRECT_RENDERING:
       g_value_set_boolean (value, ffmpegdec->direct_rendering);
       break;
-    case PROP_DO_PADDING:
-      g_value_set_boolean (value, ffmpegdec->do_padding);
-      break;
     case PROP_DEBUG_MV:
       g_value_set_boolean (value, ffmpegdec->context->debug_mv);
       break;
-    case PROP_CROP:
-      g_value_set_boolean (value, ffmpegdec->crop);
-      break;
     case PROP_MAX_THREADS:
       g_value_set_int (value, ffmpegdec->max_threads);
       break;
@@ -2982,14 +3177,14 @@ gst_ffmpegdec_register (GstPlugin * plugin)
      * outside of ffmpeg. */
     if (g_str_has_suffix (in_plugin->name, "_vdpau")) {
       GST_DEBUG
-          ("Ignoring VDPAU decoder %s. We can't handle this outside of ffmpeg",
+          ("Ignoring VDPAU decoder %s. We can't handle this outside of libav",
           in_plugin->name);
       goto next;
     }
 
     if (g_str_has_suffix (in_plugin->name, "_xvmc")) {
       GST_DEBUG
-          ("Ignoring XVMC decoder %s. We can't handle this outside of ffmpeg",
+          ("Ignoring XVMC decoder %s. We can't handle this outside of libav",
           in_plugin->name);
       goto next;
     }
@@ -3022,7 +3217,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
     /* construct the type */
     plugin_name = g_strdup ((gchar *) in_plugin->name);
     g_strdelimit (plugin_name, NULL, '_');
-    type_name = g_strdup_printf ("ffdec_%s", plugin_name);
+    type_name = g_strdup_printf ("avdec_%s", plugin_name);
     g_free (plugin_name);
 
     type = g_type_from_name (type_name);
index 40fea5e..56aa1aa 100644 (file)
@@ -24,7 +24,7 @@
 #  include "config.h"
 #endif
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #  include <avcodec.h>
 #else
 #  include <libavcodec/avcodec.h>
@@ -73,7 +73,7 @@ gst_ffmpegdeinterlace_modes_get_type (void)
 
   if (!deinterlace_modes_type) {
     deinterlace_modes_type =
-        g_enum_register_static ("GstFFMpegDeinterlaceModes", modes_types);
+        g_enum_register_static ("GstLibAVDeinterlaceModes", modes_types);
   }
   return deinterlace_modes_type;
 }
@@ -125,37 +125,25 @@ static void gst_ffmpegdeinterlace_get_property (GObject * self, guint prop_id,
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420"))
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("I420"))
     );
 
 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420"))
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("I420"))
     );
 
-GST_BOILERPLATE (GstFFMpegDeinterlace, gst_ffmpegdeinterlace, GstElement,
-    GST_TYPE_ELEMENT);
+G_DEFINE_TYPE (GstFFMpegDeinterlace, gst_ffmpegdeinterlace, GST_TYPE_ELEMENT);
 
 static GstFlowReturn gst_ffmpegdeinterlace_chain (GstPad * pad,
-    GstBuffer * inbuf);
-
-static void
-gst_ffmpegdeinterlace_base_init (gpointer g_class)
-{
-  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
-
-  gst_element_class_add_static_pad_template (element_class, &src_factory);
-  gst_element_class_add_static_pad_template (element_class, &sink_factory);
-  gst_element_class_set_details_simple (element_class,
-      "FFMPEG Deinterlace element", "Filter/Effect/Video/Deinterlace",
-      "Deinterlace video", "Luca Ognibene <luogni@tin.it>");
-}
+    GstObject * parent, GstBuffer * inbuf);
 
 static void
 gst_ffmpegdeinterlace_class_init (GstFFMpegDeinterlaceClass * klass)
 {
   GObjectClass *gobject_class = (GObjectClass *) klass;
+  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
 
   gobject_class->set_property = gst_ffmpegdeinterlace_set_property;
   gobject_class->get_property = gst_ffmpegdeinterlace_get_property;
@@ -174,6 +162,15 @@ gst_ffmpegdeinterlace_class_init (GstFFMpegDeinterlaceClass * klass)
           GST_TYPE_FFMPEGDEINTERLACE_MODES,
           DEFAULT_MODE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
       );
+
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&src_factory));
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&sink_factory));
+
+  gst_element_class_set_static_metadata (element_class,
+      "libav Deinterlace element", "Filter/Effect/Video/Deinterlace",
+      "Deinterlace video", "Luca Ognibene <luogni@tin.it>");
 }
 
 static void
@@ -232,14 +229,38 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
   return ret;
 }
 
+static gboolean
+gst_ffmpegdeinterlace_sink_event (GstPad * pad, GstObject * parent,
+    GstEvent * event)
+{
+  GstFFMpegDeinterlace *deinterlace = GST_FFMPEGDEINTERLACE (parent);
+  gboolean ret = FALSE;
+
+  switch (GST_EVENT_TYPE (event)) {
+    case GST_EVENT_CAPS:
+    {
+      GstCaps *caps;
+
+      gst_event_parse_caps (event, &caps);
+      ret = gst_ffmpegdeinterlace_sink_setcaps (pad, caps);
+      gst_event_unref (event);
+      break;
+    }
+    default:
+      ret = gst_pad_push_event (deinterlace->srcpad, event);
+      break;
+  }
+
+  return ret;
+}
+
 static void
-gst_ffmpegdeinterlace_init (GstFFMpegDeinterlace * deinterlace,
-    GstFFMpegDeinterlaceClass * klass)
+gst_ffmpegdeinterlace_init (GstFFMpegDeinterlace * deinterlace)
 {
   deinterlace->sinkpad =
       gst_pad_new_from_static_template (&sink_factory, "sink");
-  gst_pad_set_setcaps_function (deinterlace->sinkpad,
-      gst_ffmpegdeinterlace_sink_setcaps);
+  gst_pad_set_event_function (deinterlace->sinkpad,
+      gst_ffmpegdeinterlace_sink_event);
   gst_pad_set_chain_function (deinterlace->sinkpad,
       gst_ffmpegdeinterlace_chain);
   gst_element_add_pad (GST_ELEMENT (deinterlace), deinterlace->sinkpad);
@@ -257,12 +278,13 @@ gst_ffmpegdeinterlace_init (GstFFMpegDeinterlace * deinterlace,
 }
 
 static GstFlowReturn
-gst_ffmpegdeinterlace_chain (GstPad * pad, GstBuffer * inbuf)
+gst_ffmpegdeinterlace_chain (GstPad * pad, GstObject * parent,
+    GstBuffer * inbuf)
 {
-  GstFFMpegDeinterlace *deinterlace =
-      GST_FFMPEGDEINTERLACE (gst_pad_get_parent (pad));
+  GstFFMpegDeinterlace *deinterlace = GST_FFMPEGDEINTERLACE (parent);
   GstBuffer *outbuf = NULL;
   GstFlowReturn result;
+  GstMapInfo from_map, to_map;
 
   GST_OBJECT_LOCK (deinterlace);
   if (deinterlace->reconfigure) {
@@ -272,9 +294,13 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstBuffer * inbuf)
 
     deinterlace->reconfigure = FALSE;
     GST_OBJECT_UNLOCK (deinterlace);
-    if (GST_PAD_CAPS (deinterlace->srcpad))
-      gst_ffmpegdeinterlace_sink_setcaps (deinterlace->sinkpad,
-          GST_PAD_CAPS (deinterlace->sinkpad));
+    if (gst_pad_has_current_caps (deinterlace->srcpad)) {
+      GstCaps *caps;
+
+      caps = gst_pad_get_current_caps (deinterlace->sinkpad);
+      gst_ffmpegdeinterlace_sink_setcaps (deinterlace->sinkpad, caps);
+      gst_caps_unref (caps);
+    }
   } else {
     GST_OBJECT_UNLOCK (deinterlace);
   }
@@ -282,24 +308,24 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstBuffer * inbuf)
   if (deinterlace->passthrough)
     return gst_pad_push (deinterlace->srcpad, inbuf);
 
-  result =
-      gst_pad_alloc_buffer (deinterlace->srcpad, GST_BUFFER_OFFSET_NONE,
-      deinterlace->to_size, GST_PAD_CAPS (deinterlace->srcpad), &outbuf);
-  if (result == GST_FLOW_OK) {
-    gst_ffmpeg_avpicture_fill (&deinterlace->from_frame,
-        GST_BUFFER_DATA (inbuf), deinterlace->pixfmt, deinterlace->width,
-        deinterlace->height);
+  outbuf = gst_buffer_new_and_alloc (deinterlace->to_size);
 
-    gst_ffmpeg_avpicture_fill (&deinterlace->to_frame, GST_BUFFER_DATA (outbuf),
-        deinterlace->pixfmt, deinterlace->width, deinterlace->height);
+  gst_buffer_map (inbuf, &from_map, GST_MAP_READ);
+  gst_ffmpeg_avpicture_fill (&deinterlace->from_frame, from_map.data,
+      deinterlace->pixfmt, deinterlace->width, deinterlace->height);
 
-    avpicture_deinterlace (&deinterlace->to_frame, &deinterlace->from_frame,
-        deinterlace->pixfmt, deinterlace->width, deinterlace->height);
+  gst_buffer_map (outbuf, &to_map, GST_MAP_WRITE);
+  gst_ffmpeg_avpicture_fill (&deinterlace->to_frame, to_map.data,
+      deinterlace->pixfmt, deinterlace->width, deinterlace->height);
 
-    gst_buffer_copy_metadata (outbuf, inbuf, GST_BUFFER_COPY_TIMESTAMPS);
+  avpicture_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);
 
-    result = gst_pad_push (deinterlace->srcpad, outbuf);
-  }
+  gst_buffer_copy_into (outbuf, inbuf, GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
+
+  result = gst_pad_push (deinterlace->srcpad, outbuf);
 
   gst_buffer_unref (inbuf);
 
@@ -309,7 +335,7 @@ gst_ffmpegdeinterlace_chain (GstPad * pad, GstBuffer * inbuf)
 gboolean
 gst_ffmpegdeinterlace_register (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "ffdeinterlace",
+  return gst_element_register (plugin, "avdeinterlace",
       GST_RANK_NONE, GST_TYPE_FFMPEGDEINTERLACE);
 }
 
@@ -328,7 +354,7 @@ gst_ffmpegdeinterlace_set_property (GObject * object, guint prop_id,
 
       GST_OBJECT_LOCK (self);
       new_mode = g_value_get_enum (value);
-      if (self->mode != new_mode && GST_PAD_CAPS (self->srcpad)) {
+      if (self->mode != new_mode && gst_pad_has_current_caps (self->srcpad)) {
         self->reconfigure = TRUE;
         self->new_mode = new_mode;
       } else {
index 82e61c9..6fd7b7b 100644 (file)
@@ -24,7 +24,7 @@
 #endif
 
 #include <string.h>
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avformat.h>
 #ifdef HAVE_AVI_H
 #include <avi.h>
@@ -89,7 +89,6 @@ struct _GstFFMpegDemux
 
   /* segment stuff */
   GstSegment segment;
-  gboolean running;
 
   /* cached seek in READY */
   GstEvent *seek_event;
@@ -100,7 +99,7 @@ struct _GstFFMpegDemux
   /* push mode data */
   GstFFMpegPipe ffpipe;
   GstTask *task;
-  GStaticRecMutex *task_lock;
+  GRecMutex task_lock;
 };
 
 typedef struct _GstFFMpegDemuxClass GstFFMpegDemuxClass;
@@ -121,15 +120,16 @@ static void gst_ffmpegdemux_base_init (GstFFMpegDemuxClass * klass);
 static void gst_ffmpegdemux_init (GstFFMpegDemux * demux);
 static void gst_ffmpegdemux_finalize (GObject * object);
 
-static gboolean gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstEvent * event);
-static GstFlowReturn gst_ffmpegdemux_chain (GstPad * sinkpad, GstBuffer * buf);
+static gboolean gst_ffmpegdemux_sink_event (GstPad * sinkpad,
+    GstObject * parent, GstEvent * event);
+static GstFlowReturn gst_ffmpegdemux_chain (GstPad * sinkpad,
+    GstObject * parent, GstBuffer * buf);
 
 static void gst_ffmpegdemux_loop (GstFFMpegDemux * demux);
-static gboolean gst_ffmpegdemux_sink_activate (GstPad * sinkpad);
-static gboolean
-gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active);
-static gboolean
-gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active);
+static gboolean gst_ffmpegdemux_sink_activate (GstPad * sinkpad,
+    GstObject * parent);
+static gboolean gst_ffmpegdemux_sink_activate_mode (GstPad * sinkpad,
+    GstObject * parent, GstPadMode mode, gboolean active);
 
 #if 0
 static gboolean
@@ -142,7 +142,7 @@ gst_ffmpegdemux_send_event (GstElement * element, GstEvent * event);
 static GstStateChangeReturn
 gst_ffmpegdemux_change_state (GstElement * element, GstStateChange transition);
 
-#define GST_FFDEMUX_PARAMS_QDATA g_quark_from_static_string("ffdemux-params")
+#define GST_FFDEMUX_PARAMS_QDATA g_quark_from_static_string("avdemux-params")
 
 static GstElementClass *parent_class = NULL;
 
@@ -200,9 +200,9 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass * klass)
   }
 
   /* construct the element details struct */
-  longname = g_strdup_printf ("FFmpeg %s demuxer", in_plugin->long_name);
-  description = g_strdup_printf ("FFmpeg %s demuxer", in_plugin->long_name);
-  gst_element_class_set_details_simple (element_class, longname,
+  longname = g_strdup_printf ("libav %s demuxer", in_plugin->long_name);
+  description = g_strdup_printf ("libav %s demuxer", in_plugin->long_name);
+  gst_element_class_set_metadata (element_class, longname,
       "Codec/Demuxer", description,
       "Wim Taymans <wim@fluendo.com>, "
       "Ronald Bultje <rbultje@ronald.bitfreak.net>, "
@@ -214,9 +214,9 @@ gst_ffmpegdemux_base_init (GstFFMpegDemuxClass * klass)
   sinkcaps = gst_ffmpeg_formatid_to_caps (name);
   sinktempl = gst_pad_template_new ("sink",
       GST_PAD_SINK, GST_PAD_ALWAYS, sinkcaps);
-  videosrctempl = gst_pad_template_new ("video_%02d",
+  videosrctempl = gst_pad_template_new ("video_%u",
       GST_PAD_SRC, GST_PAD_SOMETIMES, GST_CAPS_ANY);
-  audiosrctempl = gst_pad_template_new ("audio_%02d",
+  audiosrctempl = gst_pad_template_new ("audio_%u",
       GST_PAD_SRC, GST_PAD_SOMETIMES, GST_CAPS_ANY);
 
   gst_element_class_add_pad_template (element_class, videosrctempl);
@@ -256,10 +256,8 @@ gst_ffmpegdemux_init (GstFFMpegDemux * demux)
   demux->sinkpad = gst_pad_new_from_template (oclass->sinktempl, "sink");
   gst_pad_set_activate_function (demux->sinkpad,
       GST_DEBUG_FUNCPTR (gst_ffmpegdemux_sink_activate));
-  gst_pad_set_activatepull_function (demux->sinkpad,
-      GST_DEBUG_FUNCPTR (gst_ffmpegdemux_sink_activate_pull));
-  gst_pad_set_activatepush_function (demux->sinkpad,
-      GST_DEBUG_FUNCPTR (gst_ffmpegdemux_sink_activate_push));
+  gst_pad_set_activatemode_function (demux->sinkpad,
+      GST_DEBUG_FUNCPTR (gst_ffmpegdemux_sink_activate_mode));
   gst_element_add_pad (GST_ELEMENT (demux), demux->sinkpad);
 
   /* push based setup */
@@ -269,10 +267,9 @@ gst_ffmpegdemux_init (GstFFMpegDemux * demux)
   gst_pad_set_chain_function (demux->sinkpad,
       GST_DEBUG_FUNCPTR (gst_ffmpegdemux_chain));
   /* task for driving ffmpeg in loop function */
-  demux->task = gst_task_create ((GstTaskFunction) gst_ffmpegdemux_loop, demux);
-  demux->task_lock = g_new (GStaticRecMutex, 1);
-  g_static_rec_mutex_init (demux->task_lock);
-  gst_task_set_lock (demux->task, demux->task_lock);
+  demux->task = gst_task_new ((GstTaskFunction) gst_ffmpegdemux_loop, demux);
+  g_rec_mutex_init (&demux->task_lock);
+  gst_task_set_lock (demux->task, &demux->task_lock);
 
   demux->opened = FALSE;
   demux->context = NULL;
@@ -310,8 +307,7 @@ gst_ffmpegdemux_finalize (GObject * object)
   gst_object_unref (demux->ffpipe.adapter);
 
   gst_object_unref (demux->task);
-  g_static_rec_mutex_free (demux->task_lock);
-  g_free (demux->task_lock);
+  g_rec_mutex_clear (&demux->task_lock);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -451,7 +447,7 @@ gst_ffmpegdemux_do_seek (GstFFMpegDemux * demux, GstSegment * segment)
   /* get the stream for seeking */
   stream = demux->context->streams[index];
   /* initial seek position */
-  target = segment->last_stop;
+  target = segment->position;
   /* convert target to ffmpeg time */
   fftarget = gst_ffmpeg_time_gst_to_ff (target, stream->time_base);
 
@@ -494,7 +490,7 @@ gst_ffmpegdemux_do_seek (GstFFMpegDemux * demux, GstSegment * segment)
 
   GST_DEBUG_OBJECT (demux, "seek success, returned %d", seekret);
 
-  segment->last_stop = target;
+  segment->position = target;
   segment->time = target;
   segment->start = target;
 
@@ -541,9 +537,9 @@ gst_ffmpegdemux_perform_seek (GstFFMpegDemux * demux, GstEvent * event)
       res = TRUE;
       /* FIXME, use source pad */
       if (cur_type != GST_SEEK_TYPE_NONE && cur != -1)
-        res = gst_pad_query_convert (demux->sinkpad, format, cur, &fmt, &cur);
+        res = gst_pad_query_convert (demux->sinkpad, format, cur, fmt, &cur);
       if (res && stop_type != GST_SEEK_TYPE_NONE && stop != -1)
-        res = gst_pad_query_convert (demux->sinkpad, format, stop, &fmt, &stop);
+        res = gst_pad_query_convert (demux->sinkpad, format, stop, fmt, &stop);
       if (!res)
         goto no_format;
 
@@ -578,13 +574,13 @@ gst_ffmpegdemux_perform_seek (GstFFMpegDemux * demux, GstEvent * event)
 
   /* now configure the seek segment */
   if (event) {
-    gst_segment_set_seek (&seeksegment, rate, format, flags,
+    gst_segment_do_seek (&seeksegment, rate, format, flags,
         cur_type, cur, stop_type, stop, &update);
   }
 
   GST_DEBUG_OBJECT (demux, "segment configured from %" G_GINT64_FORMAT
       " to %" G_GINT64_FORMAT ", position %" G_GINT64_FORMAT,
-      seeksegment.start, seeksegment.stop, seeksegment.last_stop);
+      seeksegment.start, seeksegment.stop, seeksegment.position);
 
   /* make the sinkpad available for data passing since we might need
    * it when doing the seek */
@@ -592,10 +588,10 @@ gst_ffmpegdemux_perform_seek (GstFFMpegDemux * demux, GstEvent * event)
     GST_OBJECT_LOCK (demux);
     demux->flushing = FALSE;
     GST_OBJECT_UNLOCK (demux);
-    gst_pad_push_event (demux->sinkpad, gst_event_new_flush_stop ());
+    gst_pad_push_event (demux->sinkpad, gst_event_new_flush_stop (TRUE));
   }
 
-  /* do the seek, segment.last_stop contains new position. */
+  /* do the seek, segment.position contains new position. */
   res = gst_ffmpegdemux_do_seek (demux, &seeksegment);
 
   /* and prepare to continue streaming */
@@ -604,23 +600,11 @@ gst_ffmpegdemux_perform_seek (GstFFMpegDemux * demux, GstEvent * event)
 
     /* send flush stop, peer will accept data and events again. We
      * are not yet providing data as we still have the STREAM_LOCK. */
-    gst_ffmpegdemux_push_event (demux, gst_event_new_flush_stop ());
+    gst_ffmpegdemux_push_event (demux, gst_event_new_flush_stop (TRUE));
     for (n = 0; n < MAX_STREAMS; ++n) {
       if (demux->streams[n])
         demux->streams[n]->last_flow = GST_FLOW_OK;
     }
-  } else if (res && demux->running) {
-    /* we are running the current segment and doing a non-flushing seek,
-     * close the segment first based on the last_stop. */
-    GST_DEBUG_OBJECT (demux, "closing running segment %" G_GINT64_FORMAT
-        " to %" G_GINT64_FORMAT, demux->segment.start,
-        demux->segment.last_stop);
-
-    gst_ffmpegdemux_push_event (demux,
-        gst_event_new_new_segment (TRUE,
-            demux->segment.rate, demux->segment.format,
-            demux->segment.start, demux->segment.last_stop,
-            demux->segment.time));
   }
   /* if successfull seek, we update our real segment and push
    * out the new segment. */
@@ -630,18 +614,14 @@ gst_ffmpegdemux_perform_seek (GstFFMpegDemux * demux, GstEvent * event)
     if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
       gst_element_post_message (GST_ELEMENT (demux),
           gst_message_new_segment_start (GST_OBJECT (demux),
-              demux->segment.format, demux->segment.last_stop));
+              demux->segment.format, demux->segment.position));
     }
 
-    /* now send the newsegment */
-    GST_DEBUG_OBJECT (demux, "Sending newsegment from %" G_GINT64_FORMAT
-        " to %" G_GINT64_FORMAT, demux->segment.last_stop, demux->segment.stop);
+    /* now send the newsegment, FIXME, do this from the streaming thread */
+    GST_DEBUG_OBJECT (demux, "Sending newsegment %" GST_SEGMENT_FORMAT,
+        &demux->segment);
 
-    gst_ffmpegdemux_push_event (demux,
-        gst_event_new_new_segment (FALSE,
-            demux->segment.rate, demux->segment.format,
-            demux->segment.last_stop, demux->segment.stop,
-            demux->segment.time));
+    gst_ffmpegdemux_push_event (demux, gst_event_new_segment (&demux->segment));
   }
 
   /* Mark discont on all srcpads and remove eos */
@@ -649,7 +629,6 @@ gst_ffmpegdemux_perform_seek (GstFFMpegDemux * demux, GstEvent * event)
 
   /* and restart the task in case it got paused explicitely or by
    * the FLUSH_START event we pushed out. */
-  demux->running = TRUE;
   gst_pad_start_task (demux->sinkpad, (GstTaskFunction) gst_ffmpegdemux_loop,
       demux->sinkpad);
 
@@ -667,7 +646,7 @@ no_format:
 }
 
 static gboolean
-gst_ffmpegdemux_src_event (GstPad * pad, GstEvent * event)
+gst_ffmpegdemux_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
 {
   GstFFMpegDemux *demux;
   GstFFStream *stream;
@@ -676,7 +655,7 @@ gst_ffmpegdemux_src_event (GstPad * pad, GstEvent * event)
   if (!(stream = gst_pad_get_element_private (pad)))
     return FALSE;
 
-  demux = (GstFFMpegDemux *) gst_pad_get_parent (pad);
+  demux = (GstFFMpegDemux *) parent;
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_SEEK:
@@ -694,24 +673,9 @@ gst_ffmpegdemux_src_event (GstPad * pad, GstEvent * event)
       break;
   }
 
-  gst_object_unref (demux);
-
   return res;
 }
 
-static const GstQueryType *
-gst_ffmpegdemux_src_query_list (GstPad * pad)
-{
-  static const GstQueryType src_types[] = {
-    GST_QUERY_DURATION,
-    GST_QUERY_POSITION,
-    GST_QUERY_SEEKING,
-    0
-  };
-
-  return src_types;
-}
-
 static gboolean
 gst_ffmpegdemux_send_event (GstElement * element, GstEvent * event)
 {
@@ -745,7 +709,7 @@ gst_ffmpegdemux_send_event (GstElement * element, GstEvent * event)
 }
 
 static gboolean
-gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
+gst_ffmpegdemux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
 {
   GstFFMpegDemux *demux;
   GstFFStream *stream;
@@ -757,7 +721,7 @@ gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
 
   avstream = stream->avstream;
 
-  demux = (GstFFMpegDemux *) GST_PAD_PARENT (pad);
+  demux = (GstFFMpegDemux *) parent;
 
   switch (GST_QUERY_TYPE (query)) {
     case GST_QUERY_POSITION:
@@ -785,7 +749,7 @@ gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
         case GST_FORMAT_BYTES:
           if (demux->videopads + demux->audiopads == 1 &&
               GST_PAD_PEER (demux->sinkpad) != NULL)
-            res = gst_pad_query_default (pad, query);
+            res = gst_pad_query_default (pad, parent, query);
           break;
         default:
           break;
@@ -822,7 +786,7 @@ gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
         case GST_FORMAT_BYTES:
           if (demux->videopads + demux->audiopads == 1 &&
               GST_PAD_PEER (demux->sinkpad) != NULL)
-            res = gst_pad_query_default (pad, query);
+            res = gst_pad_query_default (pad, parent, query);
           break;
         default:
           break;
@@ -836,7 +800,7 @@ gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
 
       gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
       seekable = demux->seekable;
-      if (!gst_pad_query_duration (pad, &format, &dur)) {
+      if (!gst_pad_query_duration (pad, format, &dur)) {
         /* unlikely that we don't know duration but can seek */
         seekable = FALSE;
         dur = -1;
@@ -847,7 +811,7 @@ gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
     }
     default:
       /* FIXME : ADD GST_QUERY_CONVERT */
-      res = gst_pad_query_default (pad, query);
+      res = gst_pad_query_default (pad, parent, query);
       break;
   }
 
@@ -939,9 +903,12 @@ gst_ffmpegdemux_create_padname (const gchar * templ, gint n)
 {
   GString *string;
 
+  /* FIXME, we just want to printf the number according to the template but
+   * then the format string is not a literal and we can't check arguments and
+   * this generates a compiler error */
   string = g_string_new (templ);
-  g_string_truncate (string, string->len - 4);
-  g_string_append_printf (string, "%02d", n);
+  g_string_truncate (string, string->len - 2);
+  g_string_append_printf (string, "%u", n);
 
   return g_string_free (string, FALSE);
 }
@@ -1007,10 +974,10 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
   g_free (padname);
 
   gst_pad_use_fixed_caps (pad);
+  gst_pad_set_active (pad, TRUE);
   gst_pad_set_caps (pad, caps);
   gst_caps_unref (caps);
 
-  gst_pad_set_query_type_function (pad, gst_ffmpegdemux_src_query_list);
   gst_pad_set_query_function (pad, gst_ffmpegdemux_src_query);
   gst_pad_set_event_function (pad, gst_ffmpegdemux_src_event);
 
@@ -1035,12 +1002,11 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
   demux->streams[avstream->index] = stream;
 
   /* activate and add */
-  gst_pad_set_active (pad, TRUE);
   gst_element_add_pad (GST_ELEMENT (demux), pad);
 
   /* metadata */
   if ((codec = gst_ffmpeg_get_codecid_longname (ctx->codec_id))) {
-    stream->tags = gst_tag_list_new ();
+    stream->tags = gst_tag_list_new_empty ();
 
     gst_tag_list_add (stream->tags, GST_TAG_MERGE_REPLACE,
         (ctx->codec_type == AVMEDIA_TYPE_VIDEO) ?
@@ -1208,7 +1174,7 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux)
       GST_TIME_ARGS (demux->duration));
 
   /* store duration in the segment as well */
-  gst_segment_set_duration (&demux->segment, GST_FORMAT_TIME, demux->duration);
+  demux->segment.duration = demux->duration;
 
   GST_OBJECT_LOCK (demux);
   demux->opened = TRUE;
@@ -1222,16 +1188,14 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux)
     gst_ffmpegdemux_perform_seek (demux, event);
     gst_event_unref (event);
   } else {
-    gst_ffmpegdemux_push_event (demux,
-        gst_event_new_new_segment (FALSE,
-            demux->segment.rate, demux->segment.format,
-            demux->segment.start, demux->segment.stop, demux->segment.time));
+    GST_DEBUG_OBJECT (demux, "Sending segment %" GST_SEGMENT_FORMAT,
+        &demux->segment);
+    gst_ffmpegdemux_push_event (demux, gst_event_new_segment (&demux->segment));
   }
 
   while (cached_events) {
     event = cached_events->data;
-    GST_INFO_OBJECT (demux, "pushing cached %s event: %" GST_PTR_FORMAT,
-        GST_EVENT_TYPE_NAME (event), event->structure);
+    GST_INFO_OBJECT (demux, "pushing cached event: %" GST_PTR_FORMAT, event);
     gst_ffmpegdemux_push_event (demux, event);
     cached_events = g_list_delete_link (cached_events, cached_events);
   }
@@ -1256,8 +1220,8 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux)
     if (stream->tags != NULL && stream->pad != NULL) {
       GST_INFO_OBJECT (stream->pad, "stream tags: %" GST_PTR_FORMAT,
           stream->tags);
-      gst_element_found_tags_for_pad (GST_ELEMENT (demux), stream->pad,
-          gst_tag_list_copy (stream->tags));
+      gst_pad_push_event (stream->pad,
+          gst_event_new_tag (gst_tag_list_copy (stream->tags)));
     }
   }
 
@@ -1284,7 +1248,7 @@ no_info:
 static void
 gst_ffmpegdemux_type_find (GstTypeFind * tf, gpointer priv)
 {
-  guint8 *data;
+  const guint8 *data;
   AVInputFormat *in_plugin = (AVInputFormat *) priv;
   gint res = 0;
   guint64 length;
@@ -1311,7 +1275,7 @@ gst_ffmpegdemux_type_find (GstTypeFind * tf, gpointer priv)
     AVProbeData probe_data;
 
     probe_data.filename = "";
-    probe_data.buf = data;
+    probe_data.buf = (guint8 *) data;
     probe_data.buf_size = length;
 
     res = in_plugin->read_probe (&probe_data);
@@ -1326,7 +1290,7 @@ gst_ffmpegdemux_type_find (GstTypeFind * tf, gpointer priv)
 
       sinkcaps = gst_ffmpeg_formatid_to_caps (in_plugin->name);
 
-      GST_LOG ("ffmpeg typefinder '%s' suggests %" GST_PTR_FORMAT ", p=%u%%",
+      GST_LOG ("libav typefinder '%s' suggests %" GST_PTR_FORMAT ", p=%u%%",
           in_plugin->name, sinkcaps, res);
 
       gst_type_find_suggest (tf, res, sinkcaps);
@@ -1394,8 +1358,10 @@ gst_ffmpegdemux_loop (GstFFMpegDemux * demux)
       pkt.stream_index, pkt.flags, GST_TIME_ARGS (duration), (gint64) pkt.pos);
 
   /* check start_time */
+#if 0
   if (demux->start_time != -1 && demux->start_time > timestamp)
     goto drop;
+#endif
 
   if (GST_CLOCK_TIME_IS_VALID (timestamp))
     timestamp -= demux->start_time;
@@ -1416,22 +1382,18 @@ gst_ffmpegdemux_loop (GstFFMpegDemux * demux)
   else
     outsize = pkt.size;
 
-  stream->last_flow = gst_pad_alloc_buffer_and_set_caps (srcpad,
-      GST_CLOCK_TIME_NONE, outsize, GST_PAD_CAPS (srcpad), &outbuf);
+  outbuf = gst_buffer_new_and_alloc (outsize);
 
   if ((ret = gst_ffmpegdemux_aggregated_flow (demux)) != GST_FLOW_OK)
     goto no_buffer;
 
-  /* If the buffer allocation failed, don't try sending it ! */
-  if (stream->last_flow != GST_FLOW_OK)
-    goto done;
-
   /* copy the data from packet into the target buffer
    * and do conversions for raw video packets */
   if (rawvideo) {
     AVPicture src, dst;
     const gchar *plugin_name =
         ((GstFFMpegDemuxClass *) (G_OBJECT_GET_CLASS (demux)))->in_plugin->name;
+    GstMapInfo map;
 
     if (strcmp (plugin_name, "gif") == 0) {
       src.data[0] = pkt.data;
@@ -1445,14 +1407,16 @@ gst_ffmpegdemux_loop (GstFFMpegDemux * demux)
           avstream->codec->height);
     }
 
-    gst_ffmpeg_avpicture_fill (&dst, GST_BUFFER_DATA (outbuf),
+    gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
+    gst_ffmpeg_avpicture_fill (&dst, map.data,
         avstream->codec->pix_fmt, avstream->codec->width,
         avstream->codec->height);
 
     av_picture_copy (&dst, &src, avstream->codec->pix_fmt,
         avstream->codec->width, avstream->codec->height);
+    gst_buffer_unmap (outbuf, &map);
   } else {
-    memcpy (GST_BUFFER_DATA (outbuf), pkt.data, outsize);
+    gst_buffer_fill (outbuf, 0, pkt.data, outsize);
   }
 
   GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
@@ -1471,8 +1435,8 @@ gst_ffmpegdemux_loop (GstFFMpegDemux * demux)
   }
 
   GST_DEBUG_OBJECT (demux,
-      "Sending out buffer time:%" GST_TIME_FORMAT " size:%d",
-      GST_TIME_ARGS (timestamp), GST_BUFFER_SIZE (outbuf));
+      "Sending out buffer time:%" GST_TIME_FORMAT " size:%" G_GSIZE_FORMAT,
+      GST_TIME_ARGS (timestamp), gst_buffer_get_size (outbuf));
 
   ret = stream->last_flow = gst_pad_push (srcpad, outbuf);
 
@@ -1495,7 +1459,6 @@ pause:
   {
     GST_LOG_OBJECT (demux, "pausing task, reason %d (%s)", ret,
         gst_flow_get_name (ret));
-    demux->running = FALSE;
     if (demux->seekable)
       gst_pad_pause_task (demux->sinkpad);
     else {
@@ -1504,13 +1467,13 @@ pause:
       GST_FFMPEG_PIPE_MUTEX_LOCK (ffpipe);
       /* pause task and make sure loop stops */
       gst_task_pause (demux->task);
-      g_static_rec_mutex_lock (demux->task_lock);
-      g_static_rec_mutex_unlock (demux->task_lock);
+      g_rec_mutex_lock (&demux->task_lock);
+      g_rec_mutex_unlock (&demux->task_lock);
       demux->ffpipe.srcresult = ret;
       GST_FFMPEG_PIPE_MUTEX_UNLOCK (ffpipe);
     }
 
-    if (ret == GST_FLOW_UNEXPECTED) {
+    if (ret == GST_FLOW_EOS) {
       if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
         gint64 stop;
 
@@ -1525,7 +1488,7 @@ pause:
         GST_LOG_OBJECT (demux, "pushing eos");
         gst_ffmpegdemux_push_event (demux, gst_event_new_eos ());
       }
-    } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
+    } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
       GST_ELEMENT_ERROR (demux, STREAM, FAILED,
           ("Internal data stream error."),
           ("streaming stopped, reason %s", gst_flow_get_name (ret)));
@@ -1546,11 +1509,11 @@ read_failed:
     GST_OBJECT_LOCK (demux);
     /* pause appropriatly based on if we are flushing or not */
     if (demux->flushing)
-      ret = GST_FLOW_WRONG_STATE;
+      ret = GST_FLOW_FLUSHING;
     else if (gst_ffmpegdemux_has_outputted (demux)
         || gst_ffmpegdemux_is_eos (demux)) {
       GST_DEBUG_OBJECT (demux, "We are EOS");
-      ret = GST_FLOW_UNEXPECTED;
+      ret = GST_FLOW_EOS;
     } else
       ret = GST_FLOW_ERROR;
     GST_OBJECT_UNLOCK (demux);
@@ -1564,7 +1527,7 @@ drop:
     if (gst_ffmpegdemux_is_eos (demux)) {
       av_free_packet (&pkt);
       GST_DEBUG_OBJECT (demux, "we are eos");
-      ret = GST_FLOW_UNEXPECTED;
+      ret = GST_FLOW_EOS;
       goto pause;
     } else {
       GST_DEBUG_OBJECT (demux, "some streams are not yet eos");
@@ -1580,26 +1543,26 @@ no_buffer:
 
 
 static gboolean
-gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstEvent * event)
+gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstObject * parent,
+    GstEvent * event)
 {
   GstFFMpegDemux *demux;
   GstFFMpegPipe *ffpipe;
   gboolean result = TRUE;
 
-  demux = (GstFFMpegDemux *) (GST_PAD_PARENT (sinkpad));
+  demux = (GstFFMpegDemux *) parent;
   ffpipe = &(demux->ffpipe);
 
-  GST_LOG_OBJECT (demux, "%s event: %" GST_PTR_FORMAT,
-      GST_EVENT_TYPE_NAME (event), event->structure);
+  GST_LOG_OBJECT (demux, "event: %" GST_PTR_FORMAT, event);
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_FLUSH_START:
       /* forward event */
-      gst_pad_event_default (sinkpad, event);
+      gst_pad_event_default (sinkpad, parent, event);
 
       /* now unblock the chain function */
       GST_FFMPEG_PIPE_MUTEX_LOCK (ffpipe);
-      ffpipe->srcresult = GST_FLOW_WRONG_STATE;
+      ffpipe->srcresult = GST_FLOW_FLUSHING;
       GST_FFMPEG_PIPE_SIGNAL (ffpipe);
       GST_FFMPEG_PIPE_MUTEX_UNLOCK (ffpipe);
 
@@ -1610,7 +1573,7 @@ gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstEvent * event)
       goto done;
     case GST_EVENT_FLUSH_STOP:
       /* forward event */
-      gst_pad_event_default (sinkpad, event);
+      gst_pad_event_default (sinkpad, parent, event);
 
       GST_OBJECT_LOCK (demux);
       g_list_foreach (demux->cached_events, (GFunc) gst_mini_object_unref,
@@ -1622,7 +1585,6 @@ gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstEvent * event)
       ffpipe->srcresult = GST_FLOW_OK;
       /* loop may have decided to end itself as a result of flush WRONG_STATE */
       gst_task_start (demux->task);
-      demux->running = TRUE;
       demux->flushing = FALSE;
       GST_LOG_OBJECT (demux, "loop started");
       GST_FFMPEG_PIPE_MUTEX_UNLOCK (ffpipe);
@@ -1660,7 +1622,7 @@ gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstEvent * event)
       break;
   }
 
-  result = gst_pad_event_default (sinkpad, event);
+  result = gst_pad_event_default (sinkpad, parent, event);
 
 done:
 
@@ -1668,12 +1630,12 @@ done:
 }
 
 static GstFlowReturn
-gst_ffmpegdemux_chain (GstPad * sinkpad, GstBuffer * buffer)
+gst_ffmpegdemux_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buffer)
 {
   GstFFMpegDemux *demux;
   GstFFMpegPipe *ffpipe;
 
-  demux = (GstFFMpegDemux *) (GST_PAD_PARENT (sinkpad));
+  demux = (GstFFMpegDemux *) parent;
   ffpipe = &demux->ffpipe;
 
   GST_FFMPEG_PIPE_MUTEX_LOCK (ffpipe);
@@ -1684,7 +1646,8 @@ gst_ffmpegdemux_chain (GstPad * sinkpad, GstBuffer * buffer)
   if (G_UNLIKELY (ffpipe->srcresult != GST_FLOW_OK))
     goto ignore;
 
-  GST_DEBUG ("Giving a buffer of %d bytes", GST_BUFFER_SIZE (buffer));
+  GST_DEBUG ("Giving a buffer of %" G_GSIZE_FORMAT " bytes",
+      gst_buffer_get_size (buffer));
   gst_adapter_push (ffpipe->adapter, buffer);
   buffer = NULL;
   while (gst_adapter_available (ffpipe->adapter) >= ffpipe->needed) {
@@ -1708,7 +1671,7 @@ eos:
     GST_FFMPEG_PIPE_MUTEX_UNLOCK (ffpipe);
 
     gst_buffer_unref (buffer);
-    return GST_FLOW_UNEXPECTED;
+    return GST_FLOW_EOS;
   }
 ignore:
   {
@@ -1718,27 +1681,37 @@ ignore:
 
     if (buffer)
       gst_buffer_unref (buffer);
-    return GST_FLOW_WRONG_STATE;
+    return GST_FLOW_FLUSHING;
   }
 }
 
 static gboolean
-gst_ffmpegdemux_sink_activate (GstPad * sinkpad)
+gst_ffmpegdemux_sink_activate (GstPad * sinkpad, GstObject * parent)
 {
-  GstFFMpegDemux *demux;
-  gboolean res;
+  GstQuery *query;
+  gboolean pull_mode;
+
+  query = gst_query_new_scheduling ();
+
+  if (!gst_pad_peer_query (sinkpad, query)) {
+    gst_query_unref (query);
+    goto activate_push;
+  }
 
-  demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
+  pull_mode = gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL);
+  gst_query_unref (query);
 
-  res = FALSE;
+  if (!pull_mode)
+    goto activate_push;
 
-  if (gst_pad_check_pull_range (sinkpad))
-    res = gst_pad_activate_pull (sinkpad, TRUE);
-  else {
-    res = gst_pad_activate_push (sinkpad, TRUE);
+  GST_DEBUG_OBJECT (sinkpad, "activating pull");
+  return gst_pad_activate_mode (sinkpad, GST_PAD_MODE_PULL, TRUE);
+
+activate_push:
+  {
+    GST_DEBUG_OBJECT (sinkpad, "activating push");
+    return gst_pad_activate_mode (sinkpad, GST_PAD_MODE_PUSH, TRUE);
   }
-  gst_object_unref (demux);
-  return res;
 }
 
 /* push mode:
@@ -1747,12 +1720,13 @@ gst_ffmpegdemux_sink_activate (GstPad * sinkpad)
  * - (independently managed) task driving ffmpeg
  */
 static gboolean
-gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
+gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, GstObject * parent,
+    gboolean active)
 {
   GstFFMpegDemux *demux;
   gboolean res = FALSE;
 
-  demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
+  demux = (GstFFMpegDemux *) (parent);
 
   if (active) {
     if (demux->can_push == FALSE) {
@@ -1762,7 +1736,6 @@ gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
     demux->ffpipe.eos = FALSE;
     demux->ffpipe.srcresult = GST_FLOW_OK;
     demux->ffpipe.needed = 0;
-    demux->running = TRUE;
     demux->seekable = FALSE;
     res = gst_task_start (demux->task);
   } else {
@@ -1770,7 +1743,7 @@ gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
 
     /* release chain and loop */
     GST_FFMPEG_PIPE_MUTEX_LOCK (ffpipe);
-    demux->ffpipe.srcresult = GST_FLOW_WRONG_STATE;
+    demux->ffpipe.srcresult = GST_FLOW_FLUSHING;
     /* end streaming by making ffmpeg believe eos */
     demux->ffpipe.eos = TRUE;
     GST_FFMPEG_PIPE_SIGNAL (ffpipe);
@@ -1778,16 +1751,13 @@ gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
 
     /* make sure streaming ends */
     gst_task_stop (demux->task);
-    g_static_rec_mutex_lock (demux->task_lock);
-    g_static_rec_mutex_unlock (demux->task_lock);
+    g_rec_mutex_lock (&demux->task_lock);
+    g_rec_mutex_unlock (&demux->task_lock);
     res = gst_task_join (demux->task);
-    demux->running = FALSE;
     demux->seekable = FALSE;
   }
 
 beach:
-  gst_object_unref (demux);
-
   return res;
 }
 
@@ -1797,26 +1767,43 @@ beach:
  * - task driving ffmpeg based on sink pad
  */
 static gboolean
-gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active)
+gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, GstObject * parent,
+    gboolean active)
 {
   GstFFMpegDemux *demux;
   gboolean res;
 
-  demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
+  demux = (GstFFMpegDemux *) parent;
 
   if (active) {
-    demux->running = TRUE;
     demux->seekable = TRUE;
     res = gst_pad_start_task (sinkpad, (GstTaskFunction) gst_ffmpegdemux_loop,
         demux);
   } else {
-    demux->running = FALSE;
     res = gst_pad_stop_task (sinkpad);
     demux->seekable = FALSE;
   }
 
-  gst_object_unref (demux);
+  return res;
+}
+
+static gboolean
+gst_ffmpegdemux_sink_activate_mode (GstPad * sinkpad, GstObject * parent,
+    GstPadMode mode, gboolean active)
+{
+  gboolean res;
 
+  switch (mode) {
+    case GST_PAD_MODE_PUSH:
+      res = gst_ffmpegdemux_sink_activate_push (sinkpad, parent, active);
+      break;
+    case GST_PAD_MODE_PULL:
+      res = gst_ffmpegdemux_sink_activate_pull (sinkpad, parent, active);
+      break;
+    default:
+      res = FALSE;
+      break;
+  }
   return res;
 }
 
@@ -1863,7 +1850,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
 {
   GType type;
   AVInputFormat *in_plugin;
-  gchar **extensions;
+  gchar *extensions;
   GTypeInfo typeinfo = {
     sizeof (GstFFMpegDemuxClass),
     (GBaseInitFunc) gst_ffmpegdemux_base_init,
@@ -1886,7 +1873,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
     gint rank;
     gboolean register_typefind_func = TRUE;
 
-    GST_LOG ("Attempting to handle ffmpeg demuxer plugin %s [%s]",
+    GST_LOG ("Attempting to handle libav demuxer plugin %s [%s]",
         in_plugin->name, in_plugin->long_name);
 
     /* no emulators */
@@ -1995,7 +1982,8 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
       rank = GST_RANK_MARGINAL;
     else {
       GST_DEBUG ("ignoring %s", in_plugin->name);
-      goto next;
+      rank = GST_RANK_MARGINAL;
+      //goto next;
     }
 
     p = name = g_strdup (in_plugin->name);
@@ -2006,7 +1994,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
     }
 
     /* construct the type */
-    type_name = g_strdup_printf ("ffdemux_%s", name);
+    type_name = g_strdup_printf ("avdemux_%s", name);
 
     /* if it's already registered, drop it */
     if (g_type_from_name (type_name)) {
@@ -2014,14 +2002,14 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
       goto next;
     }
 
-    typefind_name = g_strdup_printf ("fftype_%s", name);
+    typefind_name = g_strdup_printf ("avtype_%s", name);
 
     /* create the type now */
     type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0);
     g_type_set_qdata (type, GST_FFDEMUX_PARAMS_QDATA, (gpointer) in_plugin);
 
     if (in_plugin->extensions)
-      extensions = g_strsplit (in_plugin->extensions, " ", 0);
+      extensions = g_strdelimit (g_strdup (in_plugin->extensions), " ", ',');
     else
       extensions = NULL;
 
@@ -2030,7 +2018,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
             !gst_type_find_register (plugin, typefind_name, rank,
                 gst_ffmpegdemux_type_find, extensions, NULL, in_plugin,
                 NULL))) {
-      g_warning ("Register of type ffdemux_%s failed", name);
+      g_warning ("Register of type avdemux_%s failed", name);
       g_free (type_name);
       g_free (typefind_name);
       return FALSE;
@@ -2038,8 +2026,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
 
     g_free (type_name);
     g_free (typefind_name);
-    if (extensions)
-      g_strfreev (extensions);
+    g_free (extensions);
 
   next:
     g_free (name);
index f3dd34d..9bc426e 100644 (file)
@@ -28,7 +28,7 @@
 #include <glib/gstdio.h>
 #include <errno.h>
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #else
 #include <libavcodec/avcodec.h>
@@ -85,7 +85,7 @@ gst_ffmpegenc_me_method_get_type (void)
   };
   if (!ffmpegenc_me_method_type) {
     ffmpegenc_me_method_type =
-        g_enum_register_static ("GstFFMpegEncMeMethod", ffmpegenc_me_methods);
+        g_enum_register_static ("GstLibAVEncMeMethod", ffmpegenc_me_methods);
   }
   return ffmpegenc_me_method_type;
 }
@@ -96,14 +96,19 @@ static void gst_ffmpegenc_base_init (GstFFMpegEncClass * klass);
 static void gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc);
 static void gst_ffmpegenc_finalize (GObject * object);
 
-static gboolean gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps);
-static GstCaps *gst_ffmpegenc_getcaps (GstPad * pad);
+static gboolean gst_ffmpegenc_setcaps (GstFFMpegEnc * ffmpegenc,
+    GstCaps * caps);
+static GstCaps *gst_ffmpegenc_getcaps (GstPad * pad, GstCaps * filter);
 static GstFlowReturn gst_ffmpegenc_chain_video (GstPad * pad,
-    GstBuffer * buffer);
+    GstObject * parent, GstBuffer * buffer);
 static GstFlowReturn gst_ffmpegenc_chain_audio (GstPad * pad,
-    GstBuffer * buffer);
-static gboolean gst_ffmpegenc_event_video (GstPad * pad, GstEvent * event);
-static gboolean gst_ffmpegenc_event_src (GstPad * pad, GstEvent * event);
+    GstObject * parent, GstBuffer * buffer);
+static gboolean gst_ffmpegenc_event_sink (GstPad * pad, GstObject * parent,
+    GstEvent * event);
+static gboolean gst_ffmpegenc_event_src (GstPad * pad, GstObject * parent,
+    GstEvent * event);
+static gboolean gst_ffmpegenc_query_sink (GstPad * pad, GstObject * parent,
+    GstQuery * query);
 
 static void gst_ffmpegenc_set_property (GObject * object,
     guint prop_id, const GValue * value, GParamSpec * pspec);
@@ -113,7 +118,7 @@ static void gst_ffmpegenc_get_property (GObject * object,
 static GstStateChangeReturn gst_ffmpegenc_change_state (GstElement * element,
     GstStateChange transition);
 
-#define GST_FFENC_PARAMS_QDATA g_quark_from_static_string("ffenc-params")
+#define GST_FFENC_PARAMS_QDATA g_quark_from_static_string("avenc-params")
 
 static GstElementClass *parent_class = NULL;
 
@@ -134,12 +139,12 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass * klass)
   g_assert (in_plugin != NULL);
 
   /* construct the element details struct */
-  longname = g_strdup_printf ("FFmpeg %s encoder", in_plugin->long_name);
+  longname = g_strdup_printf ("libav %s encoder", in_plugin->long_name);
   classification = g_strdup_printf ("Codec/Encoder/%s",
       (in_plugin->type == AVMEDIA_TYPE_VIDEO) ? "Video" : "Audio");
-  description = g_strdup_printf ("FFmpeg %s encoder", in_plugin->name);
-  gst_element_class_set_details_simple (element_class, longname, classification,
-      description,
+  description = g_strdup_printf ("libav %s encoder", in_plugin->name);
+  gst_element_class_set_metadata (element_class, longname,
+      classification, description,
       "Wim Taymans <wim.taymans@gmail.com>, "
       "Ronald Bultje <rbultje@ronald.bitfreak.net>");
   g_free (longname);
@@ -148,19 +153,18 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass * klass)
 
   if (!(srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, TRUE))) {
     GST_DEBUG ("Couldn't get source caps for encoder '%s'", in_plugin->name);
-    srccaps = gst_caps_new_simple ("unknown/unknown", NULL);
+    srccaps = gst_caps_new_empty_simple ("unknown/unknown");
   }
 
   if (in_plugin->type == AVMEDIA_TYPE_VIDEO) {
-    sinkcaps = gst_caps_from_string
-        ("video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray");
+    sinkcaps = gst_caps_from_string ("video/x-raw");
   } else {
     sinkcaps = gst_ffmpeg_codectype_to_audio_caps (NULL,
         in_plugin->id, TRUE, in_plugin);
   }
   if (!sinkcaps) {
     GST_DEBUG ("Couldn't get sink caps for encoder '%s'", in_plugin->name);
-    sinkcaps = gst_caps_new_simple ("unknown/unknown", NULL);
+    sinkcaps = gst_caps_new_empty_simple ("unknown/unknown");
   }
 
   /* pad templates */
@@ -242,8 +246,7 @@ gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc)
 
   /* setup pads */
   ffmpegenc->sinkpad = gst_pad_new_from_template (oclass->sinktempl, "sink");
-  gst_pad_set_setcaps_function (ffmpegenc->sinkpad, gst_ffmpegenc_setcaps);
-  gst_pad_set_getcaps_function (ffmpegenc->sinkpad, gst_ffmpegenc_getcaps);
+  gst_pad_set_query_function (ffmpegenc->sinkpad, gst_ffmpegenc_query_sink);
   ffmpegenc->srcpad = gst_pad_new_from_template (oclass->srctempl, "src");
   gst_pad_use_fixed_caps (ffmpegenc->srcpad);
 
@@ -255,10 +258,11 @@ gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc)
   ffmpegenc->file = NULL;
   ffmpegenc->delay = g_queue_new ();
 
+  gst_pad_set_event_function (ffmpegenc->sinkpad, gst_ffmpegenc_event_sink);
+
   if (oclass->in_plugin->type == AVMEDIA_TYPE_VIDEO) {
     gst_pad_set_chain_function (ffmpegenc->sinkpad, gst_ffmpegenc_chain_video);
     /* so we know when to flush the buffers on EOS */
-    gst_pad_set_event_function (ffmpegenc->sinkpad, gst_ffmpegenc_event_video);
     gst_pad_set_event_function (ffmpegenc->srcpad, gst_ffmpegenc_event_src);
 
     ffmpegenc->bitrate = DEFAULT_VIDEO_BITRATE;
@@ -311,27 +315,28 @@ gst_ffmpegenc_finalize (GObject * object)
 
 static GstCaps *
 gst_ffmpegenc_get_possible_sizes (GstFFMpegEnc * ffmpegenc, GstPad * pad,
-    const GstCaps * caps)
+    GstCaps * caps)
 {
-  GstCaps *othercaps = NULL;
+  GstCaps *templ, *othercaps = NULL;
   GstCaps *tmpcaps = NULL;
   GstCaps *intersect = NULL;
   guint i;
 
-  othercaps = gst_pad_peer_get_caps (ffmpegenc->srcpad);
+  othercaps = gst_pad_peer_query_caps (ffmpegenc->srcpad, NULL);
 
   if (!othercaps)
-    return gst_caps_copy (caps);
+    return gst_caps_ref (caps);
 
-  intersect = gst_caps_intersect (othercaps,
-      gst_pad_get_pad_template_caps (ffmpegenc->srcpad));
+  templ = gst_pad_get_pad_template_caps (ffmpegenc->srcpad);
+  intersect = gst_caps_intersect (othercaps, templ);
   gst_caps_unref (othercaps);
+  gst_caps_unref (templ);
 
   if (gst_caps_is_empty (intersect))
     return intersect;
 
   if (gst_caps_is_any (intersect))
-    return gst_caps_copy (caps);
+    return gst_caps_ref (caps);
 
   tmpcaps = gst_caps_new_empty ();
 
@@ -346,20 +351,15 @@ gst_ffmpegenc_get_possible_sizes (GstFFMpegEnc * ffmpegenc, GstPad * pad,
     width = gst_structure_get_value (s, "width");
     framerate = gst_structure_get_value (s, "framerate");
 
-    tmps = gst_structure_new ("video/x-raw-rgb", NULL);
+    tmps = gst_structure_new_empty ("video/x-raw");
     if (width)
       gst_structure_set_value (tmps, "width", width);
     if (height)
       gst_structure_set_value (tmps, "height", height);
     if (framerate)
       gst_structure_set_value (tmps, "framerate", framerate);
-    gst_caps_merge_structure (tmpcaps, gst_structure_copy (tmps));
-
-    gst_structure_set_name (tmps, "video/x-raw-yuv");
-    gst_caps_merge_structure (tmpcaps, gst_structure_copy (tmps));
 
-    gst_structure_set_name (tmps, "video/x-raw-gray");
-    gst_caps_merge_structure (tmpcaps, tmps);
+    tmpcaps = gst_caps_merge_structure (tmpcaps, tmps);
   }
   gst_caps_unref (intersect);
 
@@ -371,25 +371,30 @@ gst_ffmpegenc_get_possible_sizes (GstFFMpegEnc * ffmpegenc, GstPad * pad,
 
 
 static GstCaps *
-gst_ffmpegenc_getcaps (GstPad * pad)
+gst_ffmpegenc_getcaps (GstPad * pad, GstCaps * filter)
 {
   GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) GST_PAD_PARENT (pad);
   GstFFMpegEncClass *oclass =
       (GstFFMpegEncClass *) G_OBJECT_GET_CLASS (ffmpegenc);
   AVCodecContext *ctx = NULL;
   enum PixelFormat pixfmt;
-  GstCaps *caps = NULL;
+  GstCaps *templ, *caps = NULL;
   GstCaps *finalcaps = NULL;
   gint i;
 
-  GST_DEBUG_OBJECT (ffmpegenc, "getting caps");
+  GST_DEBUG_OBJECT (ffmpegenc, "getting caps, filter %" GST_PTR_FORMAT, filter);
 
   /* audio needs no special care */
   if (oclass->in_plugin->type == AVMEDIA_TYPE_AUDIO) {
-    caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+    templ = gst_pad_get_pad_template_caps (pad);
+    if (filter) {
+      caps = gst_caps_intersect_full (filter, templ, GST_CAPS_INTERSECT_FIRST);
+      gst_caps_unref (templ);
+    } else
+      caps = templ;
 
-    GST_DEBUG_OBJECT (ffmpegenc, "audio caps, return template %" GST_PTR_FORMAT,
-        caps);
+    GST_DEBUG_OBJECT (ffmpegenc, "audio caps, return intersected template %"
+        GST_PTR_FORMAT, caps);
 
     return caps;
   }
@@ -397,8 +402,16 @@ gst_ffmpegenc_getcaps (GstPad * pad)
   /* cached */
   if (oclass->sinkcaps) {
     caps = gst_ffmpegenc_get_possible_sizes (ffmpegenc, pad, oclass->sinkcaps);
-    GST_DEBUG_OBJECT (ffmpegenc, "return cached caps %" GST_PTR_FORMAT, caps);
-    return caps;
+    if (filter) {
+      finalcaps =
+          gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+      gst_caps_unref (caps);
+    } else {
+      finalcaps = caps;
+    }
+    GST_DEBUG_OBJECT (ffmpegenc,
+        "return intersected cached caps %" GST_PTR_FORMAT, finalcaps);
+    return finalcaps;
   }
 
   /* create cache etc. */
@@ -495,30 +508,44 @@ gst_ffmpegenc_getcaps (GstPad * pad)
 
   /* make sure we have something */
   if (!caps) {
-    caps = gst_ffmpegenc_get_possible_sizes (ffmpegenc, pad,
-        gst_pad_get_pad_template_caps (pad));
+    templ = gst_pad_get_pad_template_caps (pad);
+    caps = gst_ffmpegenc_get_possible_sizes (ffmpegenc, pad, templ);
+    gst_caps_unref (templ);
+    if (filter) {
+      finalcaps =
+          gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+      gst_caps_unref (caps);
+    } else {
+      finalcaps = caps;
+    }
     GST_DEBUG_OBJECT (ffmpegenc, "probing gave nothing, "
-        "return template %" GST_PTR_FORMAT, caps);
-    return caps;
+        "return intersected template %" GST_PTR_FORMAT, finalcaps);
+    return finalcaps;
   }
 
   GST_DEBUG_OBJECT (ffmpegenc, "probed caps gave %" GST_PTR_FORMAT, caps);
-  oclass->sinkcaps = gst_caps_copy (caps);
+  oclass->sinkcaps = caps;
 
-  finalcaps = gst_ffmpegenc_get_possible_sizes (ffmpegenc, pad, caps);
-  gst_caps_unref (caps);
+  finalcaps =
+      gst_ffmpegenc_get_possible_sizes (ffmpegenc, pad, oclass->sinkcaps);
+
+  if (filter) {
+    caps = finalcaps;
+    finalcaps =
+        gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+    gst_caps_unref (caps);
+  }
 
   return finalcaps;
 }
 
 static gboolean
-gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
+gst_ffmpegenc_setcaps (GstFFMpegEnc * ffmpegenc, GstCaps * caps)
 {
   GstCaps *other_caps;
   GstCaps *allowed_caps;
   GstCaps *icaps;
   enum PixelFormat pix_fmt;
-  GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) GST_PAD_PARENT (pad);
   GstFFMpegEncClass *oclass =
       (GstFFMpegEncClass *) G_OBJECT_GET_CLASS (ffmpegenc);
 
@@ -526,9 +553,6 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
   if (ffmpegenc->opened) {
     gst_ffmpeg_avcodec_close (ffmpegenc->context);
     ffmpegenc->opened = FALSE;
-    /* fixed src caps;
-     * so clear src caps for proper (re-)negotiation */
-    gst_pad_set_caps (ffmpegenc->srcpad, NULL);
   }
 
   /* set defaults */
@@ -652,7 +676,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
       gst_ffmpeg_avcodec_close (ffmpegenc->context);
     if (ffmpegenc->context->stats_in)
       g_free (ffmpegenc->context->stats_in);
-    GST_DEBUG_OBJECT (ffmpegenc, "ffenc_%s: Failed to open FFMPEG codec",
+    GST_DEBUG_OBJECT (ffmpegenc, "avenc_%s: Failed to open libav codec",
         oclass->in_plugin->name);
     return FALSE;
   }
@@ -665,7 +689,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
   if (pix_fmt != ffmpegenc->context->pix_fmt) {
     gst_ffmpeg_avcodec_close (ffmpegenc->context);
     GST_DEBUG_OBJECT (ffmpegenc,
-        "ffenc_%s: AV wants different colourspace (%d given, %d wanted)",
+        "avenc_%s: AV wants different colourspace (%d given, %d wanted)",
         oclass->in_plugin->name, pix_fmt, ffmpegenc->context->pix_fmt);
     return FALSE;
   }
@@ -673,7 +697,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
    * and quite some codecs do not make up their own mind about that
    * in any case, _NONE can never work out later on */
   if (oclass->in_plugin->type == AVMEDIA_TYPE_VIDEO && pix_fmt == PIX_FMT_NONE) {
-    GST_DEBUG_OBJECT (ffmpegenc, "ffenc_%s: Failed to determine input format",
+    GST_DEBUG_OBJECT (ffmpegenc, "avenc_%s: Failed to determine input format",
         oclass->in_plugin->name);
     return FALSE;
   }
@@ -685,8 +709,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
     GST_DEBUG_OBJECT (ffmpegenc, "... but no peer, using template caps");
     /* we need to copy because get_allowed_caps returns a ref, and
      * get_pad_template_caps doesn't */
-    allowed_caps =
-        gst_caps_copy (gst_pad_get_pad_template_caps (ffmpegenc->srcpad));
+    allowed_caps = gst_pad_get_pad_template_caps (ffmpegenc->srcpad);
   }
   GST_DEBUG_OBJECT (ffmpegenc, "chose caps %" GST_PTR_FORMAT, allowed_caps);
   gst_ffmpeg_caps_with_codecid (oclass->in_plugin->id,
@@ -697,6 +720,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
       ffmpegenc->context, TRUE);
 
   if (!other_caps) {
+    gst_caps_unref (allowed_caps);
     gst_ffmpeg_avcodec_close (ffmpegenc->context);
     GST_DEBUG ("Unsupported codec - no caps found");
     return FALSE;
@@ -753,13 +777,17 @@ ffmpegenc_setup_working_buf (GstFFMpegEnc * ffmpegenc)
 }
 
 static GstFlowReturn
-gst_ffmpegenc_chain_video (GstPad * pad, GstBuffer * inbuf)
+gst_ffmpegenc_chain_video (GstPad * pad, GstObject * parent, GstBuffer * inbuf)
 {
-  GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) (GST_PAD_PARENT (pad));
+  GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) parent;
   GstBuffer *outbuf;
+  GstMapInfo map;
   gint ret_size = 0, frame_size;
   gboolean force_keyframe;
 
+  if (G_UNLIKELY (!ffmpegenc->opened))
+    goto not_negotiated;
+
   GST_DEBUG_OBJECT (ffmpegenc,
       "Received buffer of time %" GST_TIME_FORMAT,
       GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (inbuf)));
@@ -772,12 +800,12 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstBuffer * inbuf)
   if (force_keyframe)
     ffmpegenc->picture->pict_type = FF_I_TYPE;
 
+  gst_buffer_map (inbuf, &map, GST_MAP_READ);
   frame_size = gst_ffmpeg_avpicture_fill ((AVPicture *) ffmpegenc->picture,
-      GST_BUFFER_DATA (inbuf),
+      map.data,
       ffmpegenc->context->pix_fmt,
       ffmpegenc->context->width, ffmpegenc->context->height);
-  g_return_val_if_fail (frame_size == GST_BUFFER_SIZE (inbuf), GST_FLOW_ERROR);
-
+  g_return_val_if_fail (frame_size == map.size, GST_FLOW_ERROR);
   ffmpegenc->picture->pts =
       gst_ffmpeg_time_gst_to_ff (GST_BUFFER_TIMESTAMP (inbuf) /
       ffmpegenc->context->ticks_per_frame, ffmpegenc->context->time_base);
@@ -787,12 +815,14 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstBuffer * inbuf)
   ret_size = avcodec_encode_video (ffmpegenc->context,
       ffmpegenc->working_buf, ffmpegenc->working_buf_size, ffmpegenc->picture);
 
+  gst_buffer_unmap (inbuf, &map);
+
   if (ret_size < 0) {
 #ifndef GST_DISABLE_GST_DEBUG
     GstFFMpegEncClass *oclass =
         (GstFFMpegEncClass *) (G_OBJECT_GET_CLASS (ffmpegenc));
     GST_ERROR_OBJECT (ffmpegenc,
-        "ffenc_%s: failed to encode buffer", oclass->in_plugin->name);
+        "avenc_%s: failed to encode buffer", oclass->in_plugin->name);
 #endif /* GST_DISABLE_GST_DEBUG */
     gst_buffer_unref (inbuf);
     return GST_FLOW_OK;
@@ -815,7 +845,7 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstBuffer * inbuf)
           GST_ERROR_SYSTEM);
 
   outbuf = gst_buffer_new_and_alloc (ret_size);
-  memcpy (GST_BUFFER_DATA (outbuf), ffmpegenc->working_buf, ret_size);
+  gst_buffer_fill (outbuf, 0, ffmpegenc->working_buf, ret_size);
   GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (inbuf);
   GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (inbuf);
   /* buggy codec may not set coded_frame */
@@ -824,7 +854,6 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstBuffer * inbuf)
       GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
   } else
     GST_WARNING_OBJECT (ffmpegenc, "codec did not provide keyframe info");
-  gst_buffer_set_caps (outbuf, GST_PAD_CAPS (ffmpegenc->srcpad));
 
   gst_buffer_unref (inbuf);
 
@@ -841,6 +870,15 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstBuffer * inbuf)
   }
 
   return gst_pad_push (ffmpegenc->srcpad, outbuf);
+
+  /* ERRORS */
+not_negotiated:
+  {
+    GST_ELEMENT_ERROR (ffmpegenc, CORE, NEGOTIATION, (NULL),
+        ("not configured to input format before data start"));
+    gst_buffer_unref (inbuf);
+    return GST_FLOW_NOT_NEGOTIATED;
+  }
 }
 
 static GstFlowReturn
@@ -850,7 +888,7 @@ gst_ffmpegenc_encode_audio (GstFFMpegEnc * ffmpegenc, guint8 * audio_in,
 {
   GstBuffer *outbuf;
   AVCodecContext *ctx;
-  guint8 *audio_out;
+  GstMapInfo map;
   gint res;
   GstFlowReturn ret;
 
@@ -858,27 +896,28 @@ gst_ffmpegenc_encode_audio (GstFFMpegEnc * ffmpegenc, guint8 * audio_in,
 
   /* We need to provide at least ffmpegs minimal buffer size */
   outbuf = gst_buffer_new_and_alloc (max_size + FF_MIN_BUFFER_SIZE);
-  audio_out = GST_BUFFER_DATA (outbuf);
+  gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
 
   GST_LOG_OBJECT (ffmpegenc, "encoding buffer of max size %d", max_size);
   if (ffmpegenc->buffer_size != max_size)
     ffmpegenc->buffer_size = max_size;
 
-  res = avcodec_encode_audio (ctx, audio_out, max_size, (short *) audio_in);
+  res = avcodec_encode_audio (ctx, map.data, max_size, (short *) audio_in);
 
   if (res < 0) {
+    gst_buffer_unmap (outbuf, &map);
     GST_ERROR_OBJECT (ffmpegenc, "Failed to encode buffer: %d", res);
     gst_buffer_unref (outbuf);
     return GST_FLOW_OK;
   }
   GST_LOG_OBJECT (ffmpegenc, "got output size %d", res);
+  gst_buffer_unmap (outbuf, &map);
+  gst_buffer_resize (outbuf, 0, res);
 
-  GST_BUFFER_SIZE (outbuf) = res;
   GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
   GST_BUFFER_DURATION (outbuf) = duration;
   if (discont)
     GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
-  gst_buffer_set_caps (outbuf, GST_PAD_CAPS (ffmpegenc->srcpad));
 
   GST_LOG_OBJECT (ffmpegenc, "pushing size %d, timestamp %" GST_TIME_FORMAT,
       res, GST_TIME_ARGS (timestamp));
@@ -889,32 +928,36 @@ gst_ffmpegenc_encode_audio (GstFFMpegEnc * ffmpegenc, guint8 * audio_in,
 }
 
 static GstFlowReturn
-gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
+gst_ffmpegenc_chain_audio (GstPad * pad, GstObject * parent, GstBuffer * inbuf)
 {
   GstFFMpegEnc *ffmpegenc;
   GstFFMpegEncClass *oclass;
   AVCodecContext *ctx;
   GstClockTime timestamp, duration;
-  guint size, frame_size;
+  gsize size, frame_size;
   gint osize;
   GstFlowReturn ret;
   gint out_size;
   gboolean discont;
   guint8 *in_data;
 
-  ffmpegenc = (GstFFMpegEnc *) (GST_OBJECT_PARENT (pad));
+  ffmpegenc = (GstFFMpegEnc *) parent;
   oclass = (GstFFMpegEncClass *) G_OBJECT_GET_CLASS (ffmpegenc);
 
+  if (G_UNLIKELY (!ffmpegenc->opened))
+    goto not_negotiated;
+
   ctx = ffmpegenc->context;
 
-  size = GST_BUFFER_SIZE (inbuf);
+  size = gst_buffer_get_size (inbuf);
   timestamp = GST_BUFFER_TIMESTAMP (inbuf);
   duration = GST_BUFFER_DURATION (inbuf);
   discont = GST_BUFFER_IS_DISCONT (inbuf);
 
   GST_DEBUG_OBJECT (ffmpegenc,
       "Received time %" GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT
-      ", size %d", GST_TIME_ARGS (timestamp), GST_TIME_ARGS (duration), size);
+      ", size %" G_GSIZE_FORMAT, GST_TIME_ARGS (timestamp),
+      GST_TIME_ARGS (duration), size);
 
   frame_size = ctx->frame_size;
   osize = av_get_bits_per_sample_format (ctx->sample_fmt) / 8;
@@ -996,7 +1039,7 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
        * or samplesize to divide by the samplerate */
 
       /* take an audio buffer out of the adapter */
-      in_data = (guint8 *) gst_adapter_peek (ffmpegenc->adapter, frame_bytes);
+      in_data = (guint8 *) gst_adapter_map (ffmpegenc->adapter, frame_bytes);
       ffmpegenc->adapter_consumed += frame_size;
 
       /* calculate timestamp and duration relative to start of adapter and to
@@ -1013,6 +1056,7 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
           gst_ffmpegenc_encode_audio (ffmpegenc, in_data, frame_bytes, out_size,
           timestamp, duration, ffmpegenc->discont);
 
+      gst_adapter_unmap (ffmpegenc->adapter);
       gst_adapter_flush (ffmpegenc->adapter, frame_bytes);
 
       if (ret != GST_FLOW_OK)
@@ -1026,6 +1070,7 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
     }
     GST_LOG_OBJECT (ffmpegenc, "%u bytes left in the adapter", avail);
   } else {
+    GstMapInfo map;
     /* we have no frame_size, feed the encoder all the data and expect a fixed
      * output size */
     int coded_bps = av_get_bits_per_sample (oclass->in_plugin->id);
@@ -1036,9 +1081,12 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
     if (coded_bps)
       out_size = (out_size * coded_bps) / 8;
 
-    in_data = (guint8 *) GST_BUFFER_DATA (inbuf);
+    gst_buffer_map (inbuf, &map, GST_MAP_READ);
+    in_data = map.data;
+    size = map.size;
     ret = gst_ffmpegenc_encode_audio (ffmpegenc, in_data, size, out_size,
         timestamp, duration, discont);
+    gst_buffer_unmap (inbuf, &map);
     gst_buffer_unref (inbuf);
 
     if (ret != GST_FLOW_OK)
@@ -1048,6 +1096,13 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
   return GST_FLOW_OK;
 
   /* ERRORS */
+not_negotiated:
+  {
+    GST_ELEMENT_ERROR (ffmpegenc, CORE, NEGOTIATION, (NULL),
+        ("not configured to input format before data start"));
+    gst_buffer_unref (inbuf);
+    return GST_FLOW_NOT_NEGOTIATED;
+  }
 push_failed:
   {
     GST_DEBUG_OBJECT (ffmpegenc, "Failed to push buffer %d (%s)", ret,
@@ -1080,7 +1135,7 @@ gst_ffmpegenc_flush_buffers (GstFFMpegEnc * ffmpegenc, gboolean send)
       GstFFMpegEncClass *oclass =
           (GstFFMpegEncClass *) (G_OBJECT_GET_CLASS (ffmpegenc));
       GST_WARNING_OBJECT (ffmpegenc,
-          "ffenc_%s: failed to flush buffer", oclass->in_plugin->name);
+          "avenc_%s: failed to flush buffer", oclass->in_plugin->name);
 #endif /* GST_DISABLE_GST_DEBUG */
       break;
     }
@@ -1096,13 +1151,12 @@ gst_ffmpegenc_flush_buffers (GstFFMpegEnc * ffmpegenc, gboolean send)
     inbuf = g_queue_pop_head (ffmpegenc->delay);
 
     outbuf = gst_buffer_new_and_alloc (ret_size);
-    memcpy (GST_BUFFER_DATA (outbuf), ffmpegenc->working_buf, ret_size);
+    gst_buffer_fill (outbuf, 0, ffmpegenc->working_buf, ret_size);
     GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (inbuf);
     GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (inbuf);
 
     if (!ffmpegenc->context->coded_frame->key_frame)
       GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
-    gst_buffer_set_caps (outbuf, GST_PAD_CAPS (ffmpegenc->srcpad));
 
     gst_buffer_unref (inbuf);
 
@@ -1121,9 +1175,9 @@ flush:
 }
 
 static gboolean
-gst_ffmpegenc_event_video (GstPad * pad, GstEvent * event)
+gst_ffmpegenc_event_sink (GstPad * pad, GstObject * parent, GstEvent * event)
 {
-  GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) (GST_PAD_PARENT (pad));
+  GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) parent;
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_EOS:
@@ -1131,15 +1185,26 @@ gst_ffmpegenc_event_video (GstPad * pad, GstEvent * event)
       break;
       /* no flushing if flush received,
        * buffers in encoder are considered (in the) past */
-
-    case GST_EVENT_CUSTOM_DOWNSTREAM:{
+    case GST_EVENT_CUSTOM_DOWNSTREAM:
+    {
       const GstStructure *s;
+
       s = gst_event_get_structure (event);
       if (gst_structure_has_name (s, "GstForceKeyUnit")) {
         ffmpegenc->picture->pict_type = FF_I_TYPE;
       }
       break;
     }
+    case GST_EVENT_CAPS:
+    {
+      GstCaps *caps;
+      gboolean ret;
+
+      gst_event_parse_caps (event, &caps);
+      ret = gst_ffmpegenc_setcaps (ffmpegenc, caps);
+      gst_event_unref (event);
+      return ret;
+    }
     default:
       break;
   }
@@ -1148,9 +1213,9 @@ gst_ffmpegenc_event_video (GstPad * pad, GstEvent * event)
 }
 
 static gboolean
-gst_ffmpegenc_event_src (GstPad * pad, GstEvent * event)
+gst_ffmpegenc_event_src (GstPad * pad, GstObject * parent, GstEvent * event)
 {
-  GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) (GST_PAD_PARENT (pad));
+  GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) parent;
   gboolean forward = TRUE;
 
   switch (GST_EVENT_TYPE (event)) {
@@ -1177,6 +1242,31 @@ gst_ffmpegenc_event_src (GstPad * pad, GstEvent * event)
     return TRUE;
 }
 
+static gboolean
+gst_ffmpegenc_query_sink (GstPad * pad, GstObject * parent, GstQuery * query)
+{
+  gboolean res = FALSE;
+
+  switch (GST_QUERY_TYPE (query)) {
+    case GST_QUERY_CAPS:
+    {
+      GstCaps *filter, *caps;
+
+      gst_query_parse_caps (query, &filter);
+      caps = gst_ffmpegenc_getcaps (pad, filter);
+      gst_query_set_caps_result (query, caps);
+      gst_caps_unref (caps);
+      res = TRUE;
+      break;
+    }
+    default:
+      res = gst_pad_query_default (pad, parent, query);
+      break;
+  }
+
+  return res;
+}
+
 static void
 gst_ffmpegenc_set_property (GObject * object,
     guint prop_id, const GValue * value, GParamSpec * pspec)
@@ -1356,7 +1446,7 @@ gst_ffmpegenc_register (GstPlugin * plugin)
     }
 
     /* construct the type */
-    type_name = g_strdup_printf ("ffenc_%s", in_plugin->name);
+    type_name = g_strdup_printf ("avenc_%s", in_plugin->name);
 
     type = g_type_from_name (type_name);
 
index 687203a..001fdcf 100644 (file)
 #endif
 
 #include <string.h>
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avformat.h>
 #else
 #include <libavformat/avformat.h>
 #endif
 
 #include <gst/gst.h>
-#include <gst/base/gstcollectpads2.h>
+#include <gst/base/gstcollectpads.h>
 
 #include "gstffmpeg.h"
 #include "gstffmpegcodecmap.h"
@@ -40,7 +40,7 @@ typedef struct _GstFFMpegMuxPad GstFFMpegMuxPad;
 
 struct _GstFFMpegMuxPad
 {
-  GstCollectData2 collect;      /* we extend the CollectData2 */
+  GstCollectData collect;       /* we extend the CollectData */
 
   gint padnum;
 };
@@ -49,14 +49,14 @@ struct _GstFFMpegMux
 {
   GstElement element;
 
-  GstCollectPads2 *collect;
+  GstCollectPads *collect;
   /* We need to keep track of our pads, so we do so here. */
   GstPad *srcpad;
 
   AVFormatContext *context;
   gboolean opened;
 
-  gint videopads, audiopads;
+  guint videopads, audiopads;
 
   /*< private > */
   /* event_function is the collectpads default eventfunction */
@@ -113,11 +113,12 @@ static void gst_ffmpegmux_finalize (GObject * object);
 
 static gboolean gst_ffmpegmux_setcaps (GstPad * pad, GstCaps * caps);
 static GstPad *gst_ffmpegmux_request_new_pad (GstElement * element,
-    GstPadTemplate * templ, const gchar * name);
-static GstFlowReturn gst_ffmpegmux_collected (GstCollectPads2 * pads,
+    GstPadTemplate * templ, const gchar * name, const GstCaps * caps);
+static GstFlowReturn gst_ffmpegmux_collected (GstCollectPads * pads,
     gpointer user_data);
 
-static gboolean gst_ffmpegmux_sink_event (GstPad * pad, GstEvent * event);
+static gboolean gst_ffmpegmux_sink_event (GstPad * pad, GstObject * parent,
+    GstEvent * event);
 
 static GstStateChangeReturn gst_ffmpegmux_change_state (GstElement * element,
     GstStateChange transition);
@@ -131,7 +132,7 @@ static GstCaps *gst_ffmpegmux_get_id_caps (enum CodecID *id_list);
 static void gst_ffmpeg_mux_simple_caps_set_int_list (GstCaps * caps,
     const gchar * field, guint num, const gint * values);
 
-#define GST_FFMUX_PARAMS_QDATA g_quark_from_static_string("ffmux-params")
+#define GST_FFMUX_PARAMS_QDATA g_quark_from_static_string("avmux-params")
 
 static GstElementClass *parent_class = NULL;
 
@@ -215,20 +216,20 @@ gst_ffmpegmux_base_init (gpointer g_class)
   is_formatter = gst_ffmpegmux_is_formatter (in_plugin->name);
   if (replacement != NULL) {
     longname =
-        g_strdup_printf ("FFmpeg %s %s (not recommended, use %s instead)",
+        g_strdup_printf ("libav %s %s (not recommended, use %s instead)",
         in_plugin->long_name, is_formatter ? "formatter" : "muxer",
         replacement);
     description =
-        g_strdup_printf ("FFmpeg %s %s (not recommended, use %s instead)",
+        g_strdup_printf ("libav %s %s (not recommended, use %s instead)",
         in_plugin->long_name, is_formatter ? "formatter" : "muxer",
         replacement);
   } else {
-    longname = g_strdup_printf ("FFmpeg %s %s", in_plugin->long_name,
+    longname = g_strdup_printf ("libav %s %s", in_plugin->long_name,
         is_formatter ? "formatter" : "muxer");
-    description = g_strdup_printf ("FFmpeg %s %s", in_plugin->long_name,
+    description = g_strdup_printf ("libav %s %s", in_plugin->long_name,
         is_formatter ? "formatter" : "muxer");
   }
-  gst_element_class_set_details_simple (element_class, longname,
+  gst_element_class_set_metadata (element_class, longname,
       is_formatter ? "Formatter/Metadata" : "Codec/Muxer", description,
       "Wim Taymans <wim.taymans@chello.be>, "
       "Ronald Bultje <rbultje@ronald.bitfreak.net>");
@@ -265,27 +266,23 @@ gst_ffmpegmux_base_init (gpointer g_class)
     if (videosinkcaps)
       gst_caps_unref (videosinkcaps);
 
-    videosinkcaps =
-        gst_caps_from_string ("video/x-raw-rgb, bpp=(int)24, depth=(int)24");
+    videosinkcaps = gst_caps_from_string ("video/x-raw, format=(string)RGB");
   }
 
   /* pad templates */
   srctempl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, srccaps);
   gst_element_class_add_pad_template (element_class, srctempl);
-  gst_object_unref (srctempl);
 
   if (audiosinkcaps) {
-    audiosinktempl = gst_pad_template_new ("audio_%d",
+    audiosinktempl = gst_pad_template_new ("audio_%u",
         GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps);
     gst_element_class_add_pad_template (element_class, audiosinktempl);
-    gst_object_unref (audiosinktempl);
   }
 
   if (videosinkcaps) {
-    videosinktempl = gst_pad_template_new ("video_%d",
+    videosinktempl = gst_pad_template_new ("video_%u",
         GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps);
     gst_element_class_add_pad_template (element_class, videosinktempl);
-    gst_object_unref (videosinktempl);
   }
 
 beach:
@@ -332,9 +329,9 @@ gst_ffmpegmux_init (GstFFMpegMux * ffmpegmux, GstFFMpegMuxClass * g_class)
   gst_pad_set_caps (ffmpegmux->srcpad, gst_pad_template_get_caps (templ));
   gst_element_add_pad (GST_ELEMENT (ffmpegmux), ffmpegmux->srcpad);
 
-  ffmpegmux->collect = gst_collect_pads2_new ();
-  gst_collect_pads2_set_function (ffmpegmux->collect,
-      (GstCollectPads2Function) gst_ffmpegmux_collected, ffmpegmux);
+  ffmpegmux->collect = gst_collect_pads_new ();
+  gst_collect_pads_set_function (ffmpegmux->collect,
+      (GstCollectPadsFunction) gst_ffmpegmux_collected, ffmpegmux);
 
   ffmpegmux->context = g_new0 (AVFormatContext, 1);
   ffmpegmux->context->oformat = oclass->in_plugin;
@@ -407,7 +404,7 @@ gst_ffmpegmux_finalize (GObject * object)
 
 static GstPad *
 gst_ffmpegmux_request_new_pad (GstElement * element,
-    GstPadTemplate * templ, const gchar * name)
+    GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
 {
   GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) element;
   GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
@@ -423,24 +420,24 @@ gst_ffmpegmux_request_new_pad (GstElement * element,
   g_return_val_if_fail (ffmpegmux->opened == FALSE, NULL);
 
   /* figure out a name that *we* like */
-  if (templ == gst_element_class_get_pad_template (klass, "video_%d")) {
-    padname = g_strdup_printf ("video_%d", ffmpegmux->videopads++);
+  if (templ == gst_element_class_get_pad_template (klass, "video_%u")) {
+    padname = g_strdup_printf ("video_%u", ffmpegmux->videopads++);
     type = AVMEDIA_TYPE_VIDEO;
     bitrate = 64 * 1024;
     framesize = 1152;
-  } else if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) {
-    padname = g_strdup_printf ("audio_%d", ffmpegmux->audiopads++);
+  } else if (templ == gst_element_class_get_pad_template (klass, "audio_%u")) {
+    padname = g_strdup_printf ("audio_%u", ffmpegmux->audiopads++);
     type = AVMEDIA_TYPE_AUDIO;
     bitrate = 285 * 1024;
   } else {
-    g_warning ("ffmux: unknown pad template!");
+    g_warning ("avmux: unknown pad template!");
     return NULL;
   }
 
   /* create pad */
   pad = gst_pad_new_from_template (templ, padname);
   collect_pad = (GstFFMpegMuxPad *)
-      gst_collect_pads2_add_pad (ffmpegmux->collect, pad,
+      gst_collect_pads_add_pad (ffmpegmux->collect, pad,
       sizeof (GstFFMpegMuxPad));
   collect_pad->padnum = ffmpegmux->context->nb_streams;
 
@@ -449,7 +446,6 @@ gst_ffmpegmux_request_new_pad (GstElement * element,
   gst_pad_set_event_function (pad,
       GST_DEBUG_FUNCPTR (gst_ffmpegmux_sink_event));
 
-  gst_pad_set_setcaps_function (pad, GST_DEBUG_FUNCPTR (gst_ffmpegmux_setcaps));
   gst_element_add_pad (element, pad);
 
   /* AVStream needs to be created */
@@ -462,7 +458,7 @@ gst_ffmpegmux_request_new_pad (GstElement * element,
   /* we fill in codec during capsnego */
 
   /* we love debug output (c) (tm) (r) */
-  GST_DEBUG ("Created %s pad for ffmux_%s element",
+  GST_DEBUG ("Created %s pad for avmux_%s element",
       padname, ((GstFFMpegMuxClass *) klass)->in_plugin->name);
   g_free (padname);
 
@@ -513,9 +509,9 @@ not_accepted:
 
 
 static gboolean
-gst_ffmpegmux_sink_event (GstPad * pad, GstEvent * event)
+gst_ffmpegmux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
 {
-  GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) gst_pad_get_parent (pad);
+  GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) parent;
   gboolean res = TRUE;
 
   switch (GST_EVENT_TYPE (event)) {
@@ -528,19 +524,26 @@ gst_ffmpegmux_sink_event (GstPad * pad, GstEvent * event)
       gst_tag_setter_merge_tags (setter, taglist, mode);
       break;
     }
+    case GST_EVENT_CAPS:{
+      GstCaps *caps;
+      gst_event_parse_caps (event, &caps);
+      if (!(res = gst_ffmpegmux_setcaps (pad, caps)))
+        goto beach;
+      break;
+    }
     default:
       break;
   }
 
   /* chaining up to collectpads default event function */
-  res = ffmpegmux->event_function (pad, event);
+  res = ffmpegmux->event_function (pad, parent, event);
 
-  gst_object_unref (ffmpegmux);
+beach:
   return res;
 }
 
 static GstFlowReturn
-gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
+gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
 {
   GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) user_data;
   GSList *collected;
@@ -589,8 +592,8 @@ gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
 
             /* FIXME : This doesn't work for RAW AUDIO...
              * in fact I'm wondering if it even works for any kind of audio... */
-            buffer = gst_collect_pads2_peek (ffmpegmux->collect,
-                (GstCollectData2 *) collect_pad);
+            buffer = gst_collect_pads_peek (ffmpegmux->collect,
+                (GstCollectData *) collect_pad);
             if (buffer) {
               st->codec->frame_size =
                   st->codec->sample_rate *
@@ -652,7 +655,7 @@ gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
     if (url_fopen (&ffmpegmux->context->pb,
             ffmpegmux->context->filename, open_flags) < 0) {
       GST_ELEMENT_ERROR (ffmpegmux, LIBRARY, TOO_LAZY, (NULL),
-          ("Failed to open stream context in ffmux"));
+          ("Failed to open stream context in avmux"));
       return GST_FLOW_ERROR;
     }
 
@@ -683,8 +686,8 @@ gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
   for (collected = ffmpegmux->collect->data; collected;
       collected = g_slist_next (collected)) {
     GstFFMpegMuxPad *collect_pad = (GstFFMpegMuxPad *) collected->data;
-    GstBuffer *buffer = gst_collect_pads2_peek (ffmpegmux->collect,
-        (GstCollectData2 *) collect_pad);
+    GstBuffer *buffer = gst_collect_pads_peek (ffmpegmux->collect,
+        (GstCollectData *) collect_pad);
 
     /* if there's no buffer, just continue */
     if (buffer == NULL) {
@@ -718,10 +721,11 @@ gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
     GstBuffer *buf;
     AVPacket pkt;
     gboolean need_free = FALSE;
+    GstMapInfo map;
 
     /* push out current buffer */
-    buf = gst_collect_pads2_pop (ffmpegmux->collect,
-        (GstCollectData2 *) best_pad);
+    buf =
+        gst_collect_pads_pop (ffmpegmux->collect, (GstCollectData *) best_pad);
 
     ffmpegmux->context->streams[best_pad->padnum]->codec->frame_number++;
 
@@ -743,14 +747,17 @@ gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
       dst.data[2] = NULL;
       dst.linesize[0] = st->codec->width * 3;
 
-      gst_ffmpeg_avpicture_fill (&src, GST_BUFFER_DATA (buf),
+      gst_buffer_map (buf, &map, GST_MAP_READ);
+      gst_ffmpeg_avpicture_fill (&src, map.data,
           PIX_FMT_RGB24, st->codec->width, st->codec->height);
 
       av_picture_copy (&dst, &src, PIX_FMT_RGB24,
           st->codec->width, st->codec->height);
+      gst_buffer_unmap (buf, &map);
     } else {
-      pkt.data = GST_BUFFER_DATA (buf);
-      pkt.size = GST_BUFFER_SIZE (buf);
+      gst_buffer_map (buf, &map, GST_MAP_READ);
+      pkt.data = map.data;
+      pkt.size = map.size;
     }
 
     pkt.stream_index = best_pad->padnum;
@@ -766,9 +773,12 @@ gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
     else
       pkt.duration = 0;
     av_write_frame (ffmpegmux->context, &pkt);
-    gst_buffer_unref (buf);
-    if (need_free)
+    if (need_free) {
       g_free (pkt.data);
+    } else {
+      gst_buffer_unmap (buf, &map);
+    }
+    gst_buffer_unref (buf);
   } else {
     /* close down */
     av_write_trailer (ffmpegmux->context);
@@ -776,7 +786,7 @@ gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
     put_flush_packet (ffmpegmux->context->pb);
     url_fclose (ffmpegmux->context->pb);
     gst_pad_push_event (ffmpegmux->srcpad, gst_event_new_eos ());
-    return GST_FLOW_UNEXPECTED;
+    return GST_FLOW_EOS;
   }
 
   return GST_FLOW_OK;
@@ -792,12 +802,12 @@ gst_ffmpegmux_change_state (GstElement * element, GstStateChange transition)
     case GST_STATE_CHANGE_NULL_TO_READY:
       break;
     case GST_STATE_CHANGE_READY_TO_PAUSED:
-      gst_collect_pads2_start (ffmpegmux->collect);
+      gst_collect_pads_start (ffmpegmux->collect);
       break;
     case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
       break;
     case GST_STATE_CHANGE_PAUSED_TO_READY:
-      gst_collect_pads2_stop (ffmpegmux->collect);
+      gst_collect_pads_stop (ffmpegmux->collect);
       break;
     default:
       break;
@@ -937,7 +947,7 @@ gst_ffmpegmux_register (GstPlugin * plugin)
      * muxer type. */
 
     /* construct the type */
-    type_name = g_strdup_printf ("ffmux_%s", in_plugin->name);
+    type_name = g_strdup_printf ("avmux_%s", in_plugin->name);
 
     p = type_name;
 
index 0ab3d8a..fc2aa97 100644 (file)
@@ -23,7 +23,7 @@
 #endif
 #include <string.h>
 #include <errno.h>
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avformat.h>
 #else
 #include <libavformat/avformat.h>
@@ -111,14 +111,14 @@ gst_ffmpegdata_peek (URLContext * h, unsigned char *buf, int size)
 
   switch (ret) {
     case GST_FLOW_OK:
-      total = (gint) GST_BUFFER_SIZE (inbuf);
-      memcpy (buf, GST_BUFFER_DATA (inbuf), total);
+      total = (gint) gst_buffer_get_size (inbuf);
+      gst_buffer_extract (inbuf, 0, buf, total);
       gst_buffer_unref (inbuf);
       break;
-    case GST_FLOW_UNEXPECTED:
+    case GST_FLOW_EOS:
       total = 0;
       break;
-    case GST_FLOW_WRONG_STATE:
+    case GST_FLOW_FLUSHING:
       total = -1;
       break;
     default:
@@ -165,11 +165,9 @@ gst_ffmpegdata_write (URLContext * h, const unsigned char *buf, int size)
   g_return_val_if_fail (h->flags != URL_RDONLY, -EIO);
 
   /* create buffer and push data further */
-  if (gst_pad_alloc_buffer_and_set_caps (info->pad,
-          info->offset, size, GST_PAD_CAPS (info->pad), &outbuf) != GST_FLOW_OK)
-    return 0;
+  outbuf = gst_buffer_new_and_alloc (size);
 
-  memcpy (GST_BUFFER_DATA (outbuf), buf, size);
+  gst_buffer_fill (outbuf, 0, buf, size);
 
   if (gst_pad_push (info->pad, outbuf) != GST_FLOW_OK)
     return 0;
@@ -182,7 +180,7 @@ static int64_t
 gst_ffmpegdata_seek (URLContext * h, int64_t pos, int whence)
 {
   GstProtocolInfo *info;
-  guint64 newpos = 0;
+  guint64 newpos = 0, oldpos;
 
   GST_DEBUG ("Seeking to %" G_GINT64_FORMAT ", whence=%d",
       (gint64) pos, whence);
@@ -206,14 +204,13 @@ gst_ffmpegdata_seek (URLContext * h, int64_t pos, int whence)
         case AVSEEK_SIZE:
           /* ffmpeg wants to know the current end position in bytes ! */
         {
-          GstFormat format = GST_FORMAT_BYTES;
           gint64 duration;
 
           GST_DEBUG ("Seek end");
 
           if (gst_pad_is_linked (info->pad))
-            if (gst_pad_query_duration (GST_PAD_PEER (info->pad), &format,
-                    &duration))
+            if (gst_pad_query_duration (GST_PAD_PEER (info->pad),
+                    GST_FORMAT_BYTES, &duration))
               newpos = ((guint64) duration) + pos;
         }
           break;
@@ -228,26 +225,33 @@ gst_ffmpegdata_seek (URLContext * h, int64_t pos, int whence)
       break;
     case URL_WRONLY:
     {
+      GstSegment segment;
+
+      oldpos = info->offset;
+
       /* srcpad */
       switch (whence) {
         case SEEK_SET:
+        {
           info->offset = (guint64) pos;
-          gst_pad_push_event (info->pad, gst_event_new_new_segment
-              (TRUE, 1.0, GST_FORMAT_BYTES, info->offset,
-                  GST_CLOCK_TIME_NONE, info->offset));
           break;
+        }
         case SEEK_CUR:
           info->offset += pos;
-          gst_pad_push_event (info->pad, gst_event_new_new_segment
-              (TRUE, 1.0, GST_FORMAT_BYTES, info->offset,
-                  GST_CLOCK_TIME_NONE, info->offset));
           break;
         default:
           break;
       }
       newpos = info->offset;
-    }
+
+      if (newpos != oldpos) {
+        gst_segment_init (&segment, GST_FORMAT_BYTES);
+        segment.start = newpos;
+        segment.time = newpos;
+        gst_pad_push_event (info->pad, gst_event_new_segment (&segment));
+      }
       break;
+    }
     default:
       g_assert (0);
       break;
@@ -333,7 +337,6 @@ static int
 gst_ffmpeg_pipe_read (URLContext * h, unsigned char *buf, int size)
 {
   GstFFMpegPipe *ffpipe;
-  const guint8 *data;
   guint available;
 
   ffpipe = (GstFFMpegPipe *) h->priv_data;
@@ -355,10 +358,9 @@ gst_ffmpeg_pipe_read (URLContext * h, unsigned char *buf, int size)
   size = MIN (available, size);
   if (size) {
     GST_LOG ("Getting %d bytes", size);
-    data = gst_adapter_peek (ffpipe->adapter, size);
-    memcpy (buf, data, size);
+    gst_adapter_copy (ffpipe->adapter, buf, 0, size);
     gst_adapter_flush (ffpipe->adapter, size);
-    GST_LOG ("%d bytes left in adapter",
+    GST_LOG ("%" G_GSIZE_FORMAT " bytes left in adapter",
         gst_adapter_available (ffpipe->adapter));
     ffpipe->needed = 0;
   }
index ac5c7e1..385a379 100644 (file)
@@ -24,7 +24,7 @@
 #include "config.h"
 #endif
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #else
 #include <ffmpeg/avcodec.h>
@@ -105,7 +105,7 @@ gst_ffmpegscale_base_init (gpointer g_class)
 
   gst_element_class_add_static_pad_template (element_class, &src_factory);
   gst_element_class_add_static_pad_template (element_class, &sink_factory);
-  gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
+  gst_element_class_set_static_metadata (element_class, "libav Scale element",
       "Filter/Converter/Video/Scaler",
       "Converts video from one resolution to another",
       "Luca Ognibene <luogni@tin.it>");
@@ -398,6 +398,6 @@ gst_ffmpegscale_handle_src_event (GstPad * pad, GstEvent * event)
 gboolean
 gst_ffmpegscale_register (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "ffvideoscale",
+  return gst_element_register (plugin, "avvideoscale",
       GST_RANK_NONE, GST_TYPE_FFMPEGSCALE);
 }
index 4c5bd1e..23e17ad 100644 (file)
@@ -434,16 +434,16 @@ gst_ffmpeg_avpicture_fill (AVPicture * picture,
  * for any processing. */
 
 GstBuffer *
-new_aligned_buffer (gint size, GstCaps * caps)
+new_aligned_buffer (gint size)
 {
   GstBuffer *buf;
+  guint8 *data;
+
+  data = av_malloc (size);
 
   buf = gst_buffer_new ();
-  GST_BUFFER_DATA (buf) = GST_BUFFER_MALLOCDATA (buf) = av_malloc (size);
-  GST_BUFFER_SIZE (buf) = size;
-  GST_BUFFER_FREE_FUNC (buf) = av_free;
-  if (caps)
-    gst_buffer_set_caps (buf, caps);
+  gst_buffer_append_memory (buf,
+      gst_memory_new_wrapped (0, data, size, 0, size, data, av_free));
 
   return buf;
 }
index dbc3fae..b517ca3 100644 (file)
@@ -24,7 +24,7 @@
 #include "config.h"
 #endif
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <mathematics.h>
 #include <avcodec.h>
 #else
@@ -96,6 +96,6 @@ gint
 av_smp_format_depth(enum SampleFormat smp_fmt);
 
 GstBuffer *
-new_aligned_buffer (gint size, GstCaps * caps);
+new_aligned_buffer (gint size);
 
 #endif /* __GST_FFMPEG_UTILS_H__ */
index e77dd00..0385e44 100644 (file)
@@ -3,7 +3,7 @@ plugin_LTLIBRARIES = libgstpostproc.la
 libgstpostproc_la_SOURCES = gstpostproc.c
 
 libgstpostproc_la_CFLAGS = $(POSTPROC_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(ORC_CFLAGS)
-libgstpostproc_la_LIBADD = -lgstvideo-@GST_MAJORMINOR@ \
+libgstpostproc_la_LIBADD = -lgstvideo-@GST_API_VERSION@ \
        $(POSTPROC_LIBS) \
        $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(ORC_LIBS)
 
index 41ff8b7..8f9bb91 100644 (file)
@@ -29,7 +29,7 @@
 #include <orc/orc.h>
 #endif
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <avcodec.h>
 #include <postprocess.h>
 #else
@@ -78,9 +78,6 @@ struct _GstPostProc
   guint quality;
   gint width, height;
 
-  gint ystride, ustride, vstride;
-  gint ysize, usize, vsize;
-
   pp_mode *mode;
   pp_context *context;
 
@@ -178,14 +175,14 @@ static GstStaticPadTemplate gst_post_proc_src_template =
 GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ IYUV, I420, YV12, Y42B, Y41B }"))
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ IYUV, I420, YV12, Y42B, Y41B }"))
     );
 
 static GstStaticPadTemplate gst_post_proc_sink_template =
 GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ IYUV, I420, YV12, Y42B, Y41B }"))
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ IYUV, I420, YV12, Y42B, Y41B }"))
     );
 
 GST_DEBUG_CATEGORY (postproc_debug);
@@ -196,10 +193,11 @@ static void gst_post_proc_base_init (GstPostProcClass * klass);
 static void gst_post_proc_init (GstPostProc * pproc);
 static void gst_post_proc_dispose (GObject * object);
 
-static gboolean gst_post_proc_setcaps (GstBaseTransform * btrans,
-    GstCaps * incaps, GstCaps * outcaps);
-static GstFlowReturn gst_post_proc_transform_ip (GstBaseTransform * btrans,
-    GstBuffer * in);
+static gboolean gst_post_proc_set_info (GstVideoFilter * vfilter,
+    GstCaps * incaps, GstVideoInfo * in_info, GstCaps * outcaps,
+    GstVideoInfo * out_info);
+static GstFlowReturn gst_post_proc_transform_frame_ip (GstVideoFilter * vfilter,
+    GstVideoFrame * frame);
 
 /* static GstStateChangeReturn gst_post_proc_change_state (GstElement * element, */
 /*     GstStateChange transition); */
@@ -310,14 +308,6 @@ change_context (GstPostProc * postproc, gint width, gint height)
     postproc->context = pp_get_context (width, height, PP_FORMAT_420 | ppflags);
     postproc->width = width;
     postproc->height = height;
-    postproc->ystride = ROUND_UP_4 (width);
-    postproc->ustride = ROUND_UP_8 (width) / 2;
-    postproc->vstride = ROUND_UP_8 (postproc->ystride) / 2;
-    postproc->ysize = postproc->ystride * ROUND_UP_2 (height);
-    postproc->usize = postproc->ustride * ROUND_UP_2 (height) / 2;
-    postproc->vsize = postproc->vstride * ROUND_UP_2 (height) / 2;
-    GST_DEBUG_OBJECT (postproc, "new strides are (YUV) : %d %d %d",
-        postproc->ystride, postproc->ustride, postproc->vstride);
   }
 }
 
@@ -375,16 +365,16 @@ gst_post_proc_base_init (GstPostProcClass * klass)
       filterdetails[ppidx].longname);
   description = g_strdup_printf ("LibPostProc %s",
       filterdetails[ppidx].description);
-  gst_element_class_set_details_simple (element_class, longname, "Filter/Video",
-      description,
+  gst_element_class_set_static_metadata (element_class, longname,
+      "Filter/Video", description,
       "Edward Hervey <edward@fluendo.com>, Mark Nauwelaerts (manauw@skynet.be)");
   g_free (longname);
   g_free (description);
 
-  gst_element_class_add_static_pad_template (element_class,
-      &gst_post_proc_src_template);
-  gst_element_class_add_static_pad_template (element_class,
-      &gst_post_proc_sink_template);
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&gst_post_proc_src_template));
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&gst_post_proc_sink_template));
 
   klass->filterid = ppidx;
 }
@@ -393,9 +383,8 @@ static void
 gst_post_proc_class_init (GstPostProcClass * klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
 /*   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); */
-  GstBaseTransformClass *btrans_class = GST_BASE_TRANSFORM_CLASS (klass);
+  GstVideoFilterClass *vfilter_class = GST_VIDEO_FILTER_CLASS (klass);
   gint ppidx;
 
   parent_class = g_type_class_peek_parent (klass);
@@ -493,8 +482,10 @@ gst_post_proc_class_init (GstPostProcClass * klass)
   }
 
   gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_post_proc_dispose);
-  btrans_class->set_caps = GST_DEBUG_FUNCPTR (gst_post_proc_setcaps);
-  btrans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_post_proc_transform_ip);
+
+  vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_post_proc_set_info);
+  vfilter_class->transform_frame_ip =
+      GST_DEBUG_FUNCPTR (gst_post_proc_transform_frame_ip);
 }
 
 static void
@@ -519,12 +510,6 @@ gst_post_proc_init (GstPostProc * postproc)
   postproc->context = NULL;
   postproc->width = 0;
   postproc->height = 0;
-  postproc->ystride = 0;
-  postproc->ustride = 0;
-  postproc->vstride = 0;
-  postproc->ysize = 0;
-  postproc->usize = 0;
-  postproc->vsize = 0;
 }
 
 static void
@@ -546,49 +531,44 @@ gst_post_proc_dispose (GObject * object)
 }
 
 static gboolean
-gst_post_proc_setcaps (GstBaseTransform * btrans, GstCaps * incaps,
-    GstCaps * outcaps)
+gst_post_proc_set_info (GstVideoFilter * vfilter, GstCaps * incaps,
+    GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
 {
-  GstPostProc *postproc = (GstPostProc *) (btrans);
-  GstStructure *structure;
-  gboolean ret = FALSE;
-  gint width, height;
-
-  structure = gst_caps_get_structure (incaps, 0);
+  GstPostProc *postproc = (GstPostProc *) (vfilter);
 
-  if (gst_structure_get_int (structure, "width", &width) &&
-      gst_structure_get_int (structure, "height", &height)) {
-    change_context (postproc, width, height);
-    ret = TRUE;
-  }
+  change_context (postproc, in_info->width, in_info->height);
 
-  return ret;
+  return TRUE;
 }
 
 static GstFlowReturn
-gst_post_proc_transform_ip (GstBaseTransform * btrans, GstBuffer * in)
+gst_post_proc_transform_frame_ip (GstVideoFilter * vfilter,
+    GstVideoFrame * frame)
 {
   GstPostProc *postproc;
   gint stride[3];
   guint8 *outplane[3];
   guint8 *inplane[3];
+  gint width, height;
 
   /* postprocess the buffer ! */
-  postproc = (GstPostProc *) btrans;
+  postproc = (GstPostProc *) vfilter;
 
-  stride[0] = postproc->ystride;
-  stride[1] = postproc->ustride;
-  stride[2] = postproc->vstride;
-  outplane[0] = inplane[0] = GST_BUFFER_DATA (in);
-  outplane[1] = inplane[1] = outplane[0] + postproc->ysize;
-  outplane[2] = inplane[2] = outplane[1] + postproc->usize;
+  stride[0] = GST_VIDEO_FRAME_COMP_STRIDE (frame, 0);
+  stride[1] = GST_VIDEO_FRAME_COMP_STRIDE (frame, 1);
+  stride[2] = GST_VIDEO_FRAME_COMP_STRIDE (frame, 2);
+  outplane[0] = inplane[0] = GST_VIDEO_FRAME_COMP_DATA (frame, 0);
+  outplane[1] = inplane[1] = GST_VIDEO_FRAME_COMP_DATA (frame, 1);
+  outplane[2] = inplane[2] = GST_VIDEO_FRAME_COMP_DATA (frame, 2);
+
+  width = GST_VIDEO_FRAME_WIDTH (frame);
+  height = GST_VIDEO_FRAME_HEIGHT (frame);
 
   GST_DEBUG_OBJECT (postproc, "calling pp_postprocess, width:%d, height:%d",
-      postproc->width, postproc->height);
+      width, height);
 
   pp_postprocess ((const guint8 **) inplane, stride, outplane, stride,
-      postproc->width, postproc->height, (int8_t *) "", 0,
-      postproc->mode, postproc->context, 0);
+      width, height, (int8_t *) "", 0, postproc->mode, postproc->context, 0);
 
   return GST_FLOW_OK;
 }
@@ -921,7 +901,6 @@ plugin_init (GstPlugin * plugin)
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
-    "postproc",
-    "postprocessing elements (" FFMPEG_SOURCE ")",
-    plugin_init,
-    PACKAGE_VERSION, "GPL", "FFMpeg", "http://ffmpeg.sourceforge.net/")
+    postproc,
+    "postprocessing elements (" LIBAV_SOURCE ")",
+    plugin_init, PACKAGE_VERSION, "GPL", "libav", "http://www.libav.org")
index 8bc2e35..32ad6c6 100644 (file)
@@ -1,15 +1,15 @@
-plugin_LTLIBRARIES = libgstffmpegscale.la
+plugin_LTLIBRARIES = libgstavscale.la
 
-libgstffmpegscale_la_SOURCES = gstffmpegscale.c
+libgstavscale_la_SOURCES = gstffmpegscale.c
 
-libgstffmpegscale_la_CFLAGS = $(SWSCALE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \
+libgstavscale_la_CFLAGS = $(SWSCALE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \
        $(ORC_CFLAGS)
-libgstffmpegscale_la_LIBADD = $(SWSCALE_LIBS) \
-       $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
+libgstavscale_la_LIBADD = $(SWSCALE_LIBS) \
+       $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) \
        $(GST_BASE_LIBS) $(ORC_LIBS) $(LIBM) -lz
-libgstffmpegscale_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
-libgstffmpegscale_la_LIBTOOLFLAGS = --tag=disable-static
+libgstavscale_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
+libgstavscale_la_LIBTOOLFLAGS = --tag=disable-static
 
-if HAVE_FFMPEG_UNINSTALLED
-libgstffmpegscale_la_DEPENDENCIES = $(SWSCALE_LIBS)
+if HAVE_LIBAV_UNINSTALLED
+libgstavscale_la_DEPENDENCIES = $(SWSCALE_LIBS)
 endif
index c7a7087..63ffe14 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#ifdef HAVE_FFMPEG_UNINSTALLED
+#ifdef HAVE_LIBAV_UNINSTALLED
 #include <swscale.h>
 #else
 #include <libswscale/swscale.h>
@@ -47,16 +47,11 @@ typedef struct _GstFFMpegScale
   GstPad *sinkpad, *srcpad;
 
   /* state */
-  gint in_width, in_height;
-  gint out_width, out_height;
+  GstVideoInfo in_info, out_info;
 
   enum PixelFormat in_pixfmt, out_pixfmt;
   struct SwsContext *ctx;
 
-  /* cached auxiliary data */
-  gint in_stride[3], in_offset[3];
-  gint out_stride[3], out_offset[3];
-
   /* property */
   gint method;
 } GstFFMpegScale;
@@ -85,16 +80,10 @@ GST_DEBUG_CATEGORY (ffmpegscale_debug);
 /* libswscale supported formats depend on endianness */
 #if G_BYTE_ORDER == G_BIG_ENDIAN
 #define VIDEO_CAPS \
-        GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_BGR "; " \
-        GST_VIDEO_CAPS_xRGB "; " GST_VIDEO_CAPS_xBGR "; " \
-        GST_VIDEO_CAPS_ARGB "; " GST_VIDEO_CAPS_ABGR "; " \
-        GST_VIDEO_CAPS_YUV ("{ I420, YUY2, UYVY, Y41B, Y42B }")
+        GST_VIDEO_CAPS_MAKE ("{ RGB, BGR, xRGB, xBGR, ARGB, ABGR, I420, YUY2, UYVY, Y41B, Y42B }")
 #else
 #define VIDEO_CAPS \
-        GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_BGR "; " \
-        GST_VIDEO_CAPS_RGBx "; " GST_VIDEO_CAPS_BGRx "; " \
-        GST_VIDEO_CAPS_RGBA "; " GST_VIDEO_CAPS_BGRA "; " \
-        GST_VIDEO_CAPS_YUV ("{ I420, YUY2, UYVY, Y41B, Y42B }")
+        GST_VIDEO_CAPS_MAKE ("{ RGB, BGR, RGBx, BGRx, RGBA, BGRA, I420, YUY2, UYVY, Y41B, Y42B }")
 #endif
 
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
@@ -146,7 +135,7 @@ gst_ffmpegscale_method_get_type (void)
 
   if (!ffmpegscale_method_type) {
     ffmpegscale_method_type =
-        g_enum_register_static ("GstFFMpegVideoScaleMethod",
+        g_enum_register_static ("GstLibAVVideoScaleMethod",
         ffmpegscale_methods);
   }
   return ffmpegscale_method_type;
@@ -161,8 +150,8 @@ enum
       /* FILL ME */
 };
 
-GST_BOILERPLATE (GstFFMpegScale, gst_ffmpegscale, GstBaseTransform,
-    GST_TYPE_BASE_TRANSFORM);
+#define gst_ffmpegscale_parent_class parent_class
+G_DEFINE_TYPE (GstFFMpegScale, gst_ffmpegscale, GST_TYPE_BASE_TRANSFORM);
 
 static void gst_ffmpegscale_finalize (GObject * object);
 static void gst_ffmpegscale_set_property (GObject * object, guint prop_id,
@@ -172,36 +161,24 @@ static void gst_ffmpegscale_get_property (GObject * object, guint prop_id,
 
 static gboolean gst_ffmpegscale_stop (GstBaseTransform * trans);
 static GstCaps *gst_ffmpegscale_transform_caps (GstBaseTransform * trans,
-    GstPadDirection direction, GstCaps * caps);
-static void gst_ffmpegscale_fixate_caps (GstBaseTransform * trans,
+    GstPadDirection direction, GstCaps * caps, GstCaps * filter);
+static GstCaps *gst_ffmpegscale_fixate_caps (GstBaseTransform * trans,
     GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
 static gboolean gst_ffmpegscale_get_unit_size (GstBaseTransform * trans,
-    GstCaps * caps, guint * size);
+    GstCaps * caps, gsize * size);
 static gboolean gst_ffmpegscale_set_caps (GstBaseTransform * trans,
     GstCaps * incaps, GstCaps * outcaps);
 static GstFlowReturn gst_ffmpegscale_transform (GstBaseTransform * trans,
     GstBuffer * inbuf, GstBuffer * outbuf);
 
-static gboolean gst_ffmpegscale_handle_src_event (GstPad * pad,
+static gboolean gst_ffmpegscale_src_event (GstBaseTransform * trans,
     GstEvent * event);
 
 static void
-gst_ffmpegscale_base_init (gpointer g_class)
-{
-  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
-
-  gst_element_class_add_static_pad_template (element_class, &src_factory);
-  gst_element_class_add_static_pad_template (element_class, &sink_factory);
-  gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
-      "Filter/Converter/Video",
-      "Converts video from one resolution to another",
-      "Luca Ognibene <luogni@tin.it>, Mark Nauwelaerts <mnauw@users.sf.net>");
-}
-
-static void
 gst_ffmpegscale_class_init (GstFFMpegScaleClass * klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
   GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (klass);
 
   gobject_class->finalize = gst_ffmpegscale_finalize;
@@ -213,6 +190,16 @@ gst_ffmpegscale_class_init (GstFFMpegScaleClass * klass)
           GST_TYPE_FFMPEGSCALE_METHOD, DEFAULT_PROP_METHOD,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&src_factory));
+  gst_element_class_add_pad_template (gstelement_class,
+      gst_static_pad_template_get (&sink_factory));
+
+  gst_element_class_set_static_metadata (gstelement_class,
+      "libav Scale element", "Filter/Converter/Video",
+      "Converts video from one resolution to another",
+      "Luca Ognibene <luogni@tin.it>, Mark Nauwelaerts <mnauw@users.sf.net>");
+
   trans_class->stop = GST_DEBUG_FUNCPTR (gst_ffmpegscale_stop);
   trans_class->transform_caps =
       GST_DEBUG_FUNCPTR (gst_ffmpegscale_transform_caps);
@@ -221,17 +208,14 @@ gst_ffmpegscale_class_init (GstFFMpegScaleClass * klass)
       GST_DEBUG_FUNCPTR (gst_ffmpegscale_get_unit_size);
   trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_ffmpegscale_set_caps);
   trans_class->transform = GST_DEBUG_FUNCPTR (gst_ffmpegscale_transform);
+  trans_class->src_event = GST_DEBUG_FUNCPTR (gst_ffmpegscale_src_event);
 
   trans_class->passthrough_on_same_caps = TRUE;
 }
 
 static void
-gst_ffmpegscale_init (GstFFMpegScale * scale, GstFFMpegScaleClass * klass)
+gst_ffmpegscale_init (GstFFMpegScale * scale)
 {
-  GstBaseTransform *trans = GST_BASE_TRANSFORM (scale);
-
-  gst_pad_set_event_function (trans->srcpad, gst_ffmpegscale_handle_src_event);
-
   scale->method = DEFAULT_PROP_METHOD;
   scale->ctx = NULL;
   scale->in_pixfmt = PIX_FMT_NONE;
@@ -309,7 +293,7 @@ gst_ffmpegscale_caps_remove_format_info (GstCaps * caps)
 
 static GstCaps *
 gst_ffmpegscale_transform_caps (GstBaseTransform * trans,
-    GstPadDirection direction, GstCaps * caps)
+    GstPadDirection direction, GstCaps * caps, GstCaps * filter)
 {
   GstCaps *ret;
   GstStructure *structure;
@@ -327,14 +311,14 @@ gst_ffmpegscale_transform_caps (GstBaseTransform * trans,
       "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
       "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
 
-  gst_caps_merge_structure (ret, gst_structure_copy (structure));
+  ret = gst_caps_merge_structure (ret, gst_structure_copy (structure));
 
   /* if pixel aspect ratio, make a range of it */
   if ((par = gst_structure_get_value (structure, "pixel-aspect-ratio"))) {
     gst_structure_set (structure,
         "pixel-aspect-ratio", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
 
-    gst_caps_merge_structure (ret, structure);
+    ret = gst_caps_merge_structure (ret, structure);
   } else {
     gst_structure_free (structure);
   }
@@ -347,14 +331,14 @@ gst_ffmpegscale_transform_caps (GstBaseTransform * trans,
   return ret;
 }
 
-static void
+static GstCaps *
 gst_ffmpegscale_fixate_caps (GstBaseTransform * trans,
     GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
 {
   GstStructure *ins, *outs;
   const GValue *from_par, *to_par;
 
-  g_return_if_fail (gst_caps_is_fixed (caps));
+  othercaps = gst_caps_make_writable (othercaps);
 
   GST_DEBUG_OBJECT (trans, "trying to fixate othercaps %" GST_PTR_FORMAT
       " based on caps %" GST_PTR_FORMAT, othercaps, caps);
@@ -372,7 +356,7 @@ gst_ffmpegscale_fixate_caps (GstBaseTransform * trans,
     guint num, den;
 
     /* from_par should be fixed */
-    g_return_if_fail (gst_value_is_fixed (from_par));
+    g_return_val_if_fail (gst_value_is_fixed (from_par), othercaps);
 
     from_par_n = gst_value_get_fraction_numerator (from_par);
     from_par_d = gst_value_get_fraction_denominator (from_par);
@@ -397,7 +381,7 @@ gst_ffmpegscale_fixate_caps (GstBaseTransform * trans,
     if (count == 2) {
       GST_DEBUG_OBJECT (trans, "dimensions already set to %dx%d, not fixating",
           w, h);
-      return;
+      return othercaps;
     }
 
     gst_structure_get_int (ins, "width", &from_w);
@@ -407,7 +391,7 @@ gst_ffmpegscale_fixate_caps (GstBaseTransform * trans,
             from_par_n, from_par_d, to_par_n, to_par_d)) {
       GST_ELEMENT_ERROR (trans, CORE, NEGOTIATION, (NULL),
           ("Error calculating the output scaled size - integer overflow"));
-      return;
+      return othercaps;
     }
 
     GST_DEBUG_OBJECT (trans,
@@ -466,22 +450,25 @@ gst_ffmpegscale_fixate_caps (GstBaseTransform * trans,
   }
 
   GST_DEBUG_OBJECT (trans, "fixated othercaps to %" GST_PTR_FORMAT, othercaps);
+
+  return othercaps;
 }
 
 static gboolean
 gst_ffmpegscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
-    guint * size)
+    gsize * size)
 {
-  gint width, height;
-  GstVideoFormat format;
+  GstVideoInfo info;
 
-  if (!gst_video_format_parse_caps (caps, &format, &width, &height))
+  if (!gst_video_info_from_caps (&info, caps))
     return FALSE;
 
-  *size = gst_video_format_get_size (format, width, height);
+  *size = info.size;
 
-  GST_DEBUG_OBJECT (trans, "unit size = %d for format %d w %d height %d",
-      *size, format, width, height);
+  GST_DEBUG_OBJECT (trans,
+      "unit size = %" G_GSIZE_FORMAT " for format %d w %d height %d", *size,
+      GST_VIDEO_INFO_FORMAT (&info), GST_VIDEO_INFO_WIDTH (&info),
+      GST_VIDEO_INFO_HEIGHT (&info));
 
   return TRUE;
 }
@@ -491,101 +478,70 @@ gst_ffmpegscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
 static enum PixelFormat
 gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps)
 {
-  GstStructure *structure;
-  enum PixelFormat pix_fmt = PIX_FMT_NONE;
+  GstVideoInfo info;
+  enum PixelFormat pix_fmt;
 
   GST_DEBUG ("converting caps %" GST_PTR_FORMAT, caps);
-  g_return_val_if_fail (gst_caps_get_size (caps) == 1, PIX_FMT_NONE);
-  structure = gst_caps_get_structure (caps, 0);
 
-  if (strcmp (gst_structure_get_name (structure), "video/x-raw-yuv") == 0) {
-    guint32 fourcc;
-
-    if (gst_structure_get_fourcc (structure, "format", &fourcc)) {
-      switch (fourcc) {
-        case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
-          pix_fmt = PIX_FMT_YUYV422;
-          break;
-        case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
-          pix_fmt = PIX_FMT_UYVY422;
-          break;
-        case GST_MAKE_FOURCC ('I', '4', '2', '0'):
-          pix_fmt = PIX_FMT_YUV420P;
-          break;
-        case GST_MAKE_FOURCC ('Y', '4', '1', 'B'):
-          pix_fmt = PIX_FMT_YUV411P;
-          break;
-        case GST_MAKE_FOURCC ('Y', '4', '2', 'B'):
-          pix_fmt = PIX_FMT_YUV422P;
-          break;
-        case GST_MAKE_FOURCC ('Y', 'U', 'V', '9'):
-          pix_fmt = PIX_FMT_YUV410P;
-          break;
-      }
-    }
-  } else if (strcmp (gst_structure_get_name (structure),
-          "video/x-raw-rgb") == 0) {
-    gint bpp = 0, rmask = 0, endianness = 0;
-
-    if (gst_structure_get_int (structure, "bpp", &bpp) &&
-        gst_structure_get_int (structure, "endianness", &endianness) &&
-        endianness == G_BIG_ENDIAN) {
-      if (gst_structure_get_int (structure, "red_mask", &rmask)) {
-        switch (bpp) {
-          case 32:
-            if (rmask == 0x00ff0000)
-              pix_fmt = PIX_FMT_ARGB;
-            else if (rmask == 0xff000000)
-              pix_fmt = PIX_FMT_RGBA;
-            else if (rmask == 0xff00)
-              pix_fmt = PIX_FMT_BGRA;
-            else if (rmask == 0xff)
-              pix_fmt = PIX_FMT_ABGR;
-            break;
-          case 24:
-            if (rmask == 0x0000FF)
-              pix_fmt = PIX_FMT_BGR24;
-            else
-              pix_fmt = PIX_FMT_RGB24;
-            break;
-          case 16:
-            if (endianness == G_BYTE_ORDER)
-              pix_fmt = PIX_FMT_RGB565;
-            break;
-          case 15:
-            if (endianness == G_BYTE_ORDER)
-              pix_fmt = PIX_FMT_RGB555;
-            break;
-          default:
-            /* nothing */
-            break;
-        }
-      } else {
-        if (bpp == 8) {
-          pix_fmt = PIX_FMT_PAL8;
-        }
-      }
-    }
-  }
+  if (gst_video_info_from_caps (&info, caps))
+    goto invalid_caps;
 
+  switch (GST_VIDEO_INFO_FORMAT (&info)) {
+    case GST_VIDEO_FORMAT_YUY2:
+      pix_fmt = PIX_FMT_YUYV422;
+      break;
+    case GST_VIDEO_FORMAT_UYVY:
+      pix_fmt = PIX_FMT_UYVY422;
+      break;
+    case GST_VIDEO_FORMAT_I420:
+      pix_fmt = PIX_FMT_YUV420P;
+      break;
+    case GST_VIDEO_FORMAT_Y41B:
+      pix_fmt = PIX_FMT_YUV411P;
+      break;
+    case GST_VIDEO_FORMAT_Y42B:
+      pix_fmt = PIX_FMT_YUV422P;
+      break;
+    case GST_VIDEO_FORMAT_YUV9:
+      pix_fmt = PIX_FMT_YUV410P;
+      break;
+    case GST_VIDEO_FORMAT_ARGB:
+      pix_fmt = PIX_FMT_ARGB;
+      break;
+    case GST_VIDEO_FORMAT_RGBA:
+      pix_fmt = PIX_FMT_RGBA;
+      break;
+    case GST_VIDEO_FORMAT_BGRA:
+      pix_fmt = PIX_FMT_BGRA;
+      break;
+    case GST_VIDEO_FORMAT_ABGR:
+      pix_fmt = PIX_FMT_ABGR;
+      break;
+    case GST_VIDEO_FORMAT_BGR:
+      pix_fmt = PIX_FMT_BGR24;
+      break;
+    case GST_VIDEO_FORMAT_RGB:
+      pix_fmt = PIX_FMT_RGB24;
+      break;
+    case GST_VIDEO_FORMAT_RGB16:
+      pix_fmt = PIX_FMT_RGB565;
+      break;
+    case GST_VIDEO_FORMAT_RGB15:
+      pix_fmt = PIX_FMT_RGB555;
+      break;
+    case GST_VIDEO_FORMAT_RGB8_PALETTED:
+      pix_fmt = PIX_FMT_PAL8;
+      break;
+    default:
+      pix_fmt = PIX_FMT_NONE;
+      break;
+  }
   return pix_fmt;
-}
 
-static void
-gst_ffmpegscale_fill_info (GstFFMpegScale * scale, GstVideoFormat format,
-    guint width, guint height, gint stride[], gint offset[])
-{
-  gint i;
-
-  for (i = 0; i < 3; i++) {
-    stride[i] = gst_video_format_get_row_stride (format, i, width);
-    offset[i] = gst_video_format_get_component_offset (format, i, width,
-        height);
-    /* stay close to the ffmpeg offset way */
-    if (offset[i] < 3)
-      offset[i] = 0;
-    GST_DEBUG_OBJECT (scale, "format %d, component %d; stride %d, offset %d",
-        format, i, stride[i], offset[i]);
+  /* ERROR */
+invalid_caps:
+  {
+    return PIX_FMT_NONE;
   }
 }
 
@@ -598,7 +554,6 @@ gst_ffmpegscale_set_caps (GstBaseTransform * trans, GstCaps * incaps,
   guint mmx_flags, altivec_flags;
 #endif
   gint swsflags;
-  GstVideoFormat in_format, out_format;
   gboolean ok;
 
   g_return_val_if_fail (scale->method <
@@ -609,27 +564,25 @@ gst_ffmpegscale_set_caps (GstBaseTransform * trans, GstCaps * incaps,
     scale->ctx = NULL;
   }
 
-  ok = gst_video_format_parse_caps (incaps, &in_format, &scale->in_width,
-      &scale->in_height);
-  ok &= gst_video_format_parse_caps (outcaps, &out_format, &scale->out_width,
-      &scale->out_height);
+  ok = gst_video_info_from_caps (&scale->in_info, incaps);
+  ok &= gst_video_info_from_caps (&scale->out_info, outcaps);
+
   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 ||
-      in_format == GST_VIDEO_FORMAT_UNKNOWN ||
-      out_format == GST_VIDEO_FORMAT_UNKNOWN)
+      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;
 
-  GST_DEBUG_OBJECT (scale, "format %d => %d, from=%dx%d -> to=%dx%d", in_format,
-      out_format, scale->in_width, scale->in_height, scale->out_width,
-      scale->out_height);
-
-  gst_ffmpegscale_fill_info (scale, in_format, scale->in_width,
-      scale->in_height, scale->in_stride, scale->in_offset);
-  gst_ffmpegscale_fill_info (scale, out_format, scale->out_width,
-      scale->out_height, scale->out_stride, scale->out_offset);
+  GST_DEBUG_OBJECT (scale, "format %d => %d, from=%dx%d -> to=%dx%d",
+      GST_VIDEO_INFO_FORMAT (&scale->in_info),
+      GST_VIDEO_INFO_FORMAT (&scale->out_info),
+      GST_VIDEO_INFO_WIDTH (&scale->in_info),
+      GST_VIDEO_INFO_HEIGHT (&scale->in_info),
+      GST_VIDEO_INFO_WIDTH (&scale->out_info),
+      GST_VIDEO_INFO_HEIGHT (&scale->out_info));
 
 #ifdef HAVE_ORC
   mmx_flags = orc_target_get_default_flags (orc_target_get_by_name ("mmx"));
@@ -643,9 +596,10 @@ gst_ffmpegscale_set_caps (GstBaseTransform * trans, GstCaps * incaps,
   swsflags = 0;
 #endif
 
-  scale->ctx = sws_getContext (scale->in_width, scale->in_height,
-      scale->in_pixfmt, scale->out_width, scale->out_height, scale->out_pixfmt,
-      swsflags | gst_ffmpegscale_method_flags[scale->method], NULL, NULL, NULL);
+  scale->ctx = sws_getContext (scale->in_info.width, scale->in_info.height,
+      scale->in_pixfmt, scale->out_info.width, scale->out_info.height,
+      scale->out_pixfmt, swsflags | gst_ffmpegscale_method_flags[scale->method],
+      NULL, NULL, NULL);
   if (!scale->ctx)
     goto setup_failed;
 
@@ -669,58 +623,62 @@ gst_ffmpegscale_transform (GstBaseTransform * trans, GstBuffer * inbuf,
     GstBuffer * outbuf)
 {
   GstFFMpegScale *scale = GST_FFMPEGSCALE (trans);
-  guint8 *in_data[3] = { NULL, NULL, NULL };
-  guint8 *out_data[3] = { NULL, NULL, NULL };
-  gint i;
-
-  for (i = 0; i < 3; i++) {
-    /* again; stay close to the ffmpeg offset way */
-    if (!i || scale->in_offset[i])
-      in_data[i] = GST_BUFFER_DATA (inbuf) + scale->in_offset[i];
-    if (!i || scale->out_offset[i])
-      out_data[i] = GST_BUFFER_DATA (outbuf) + scale->out_offset[i];
-  }
+  GstVideoFrame in_frame, out_frame;
+
+  if (!gst_video_frame_map (&in_frame, &scale->in_info, inbuf, GST_MAP_READ))
+    goto invalid_buffer;
 
-  sws_scale (scale->ctx, (const guint8 **) in_data, scale->in_stride, 0,
-      scale->in_height, out_data, scale->out_stride);
+  if (!gst_video_frame_map (&out_frame, &scale->out_info, outbuf,
+          GST_MAP_WRITE))
+    goto invalid_buffer;
+
+  sws_scale (scale->ctx, (const guint8 **) in_frame.data, in_frame.info.stride,
+      0, scale->in_info.height, (guint8 **) out_frame.data,
+      out_frame.info.stride);
+
+  gst_video_frame_unmap (&in_frame);
+  gst_video_frame_unmap (&out_frame);
 
   return GST_FLOW_OK;
+
+  /* ERRORS */
+invalid_buffer:
+  {
+    return GST_FLOW_OK;
+  }
 }
 
 static gboolean
-gst_ffmpegscale_handle_src_event (GstPad * pad, GstEvent * event)
+gst_ffmpegscale_src_event (GstBaseTransform * trans, GstEvent * event)
 {
   GstFFMpegScale *scale;
   GstStructure *structure;
   gdouble pointer;
   gboolean res;
 
-  scale = GST_FFMPEGSCALE (gst_pad_get_parent (pad));
+  scale = GST_FFMPEGSCALE (trans);
 
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_NAVIGATION:
-      event =
-          GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
+      event = gst_event_make_writable (event);
 
-      structure = (GstStructure *) gst_event_get_structure (event);
+      structure = gst_event_writable_structure (event);
       if (gst_structure_get_double (structure, "pointer_x", &pointer)) {
         gst_structure_set (structure,
             "pointer_x", G_TYPE_DOUBLE,
-            pointer * scale->in_width / scale->out_width, NULL);
+            pointer * scale->in_info.width / scale->out_info.width, NULL);
       }
       if (gst_structure_get_double (structure, "pointer_y", &pointer)) {
         gst_structure_set (structure,
             "pointer_y", G_TYPE_DOUBLE,
-            pointer * scale->in_height / scale->out_height, NULL);
+            pointer * scale->in_info.height / scale->out_info.height, NULL);
       }
       break;
     default:
       break;
   }
 
-  res = gst_pad_event_default (pad, event);
-
-  gst_object_unref (scale);
+  res = GST_BASE_TRANSFORM_CLASS (parent_class)->src_event (trans, event);
 
   return res;
 }
@@ -798,7 +756,7 @@ gst_ffmpeg_log_callback (void *ptr, int level, const char *fmt, va_list vl)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (ffmpegscale_debug, "ffvideoscale", 0,
+  GST_DEBUG_CATEGORY_INIT (ffmpegscale_debug, "avvideoscale", 0,
       "video scaling element");
 
 #ifdef HAVE_ORC
@@ -809,17 +767,18 @@ plugin_init (GstPlugin * plugin)
   av_log_set_callback (gst_ffmpeg_log_callback);
 #endif
 
-  return gst_element_register (plugin, "ffvideoscale",
+  return gst_element_register (plugin, "avvideoscale",
       GST_RANK_NONE, GST_TYPE_FFMPEGSCALE);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
-    "ffvideoscale",
-    "videoscaling element (" FFMPEG_SOURCE ")", plugin_init, PACKAGE_VERSION,
-#ifdef GST_FFMPEG_ENABLE_LGPL
+    avvideoscale,
+    "libav videoscaling element (" LIBAV_SOURCE ")", plugin_init,
+    PACKAGE_VERSION,
+#ifdef GST_LIBAV_ENABLE_LGPL
     "LGPL",
 #else
     "GPL",
 #endif
-    "FFMpeg", "http://ffmpeg.sourceforge.net/")
+    "libav", "http://www.libav.org/")
similarity index 87%
rename from gst-ffmpeg.doap
rename to gst-libav.doap
index af58555..a7e7a8e 100644 (file)
@@ -5,20 +5,20 @@
   xmlns:foaf="http://xmlns.com/foaf/0.1/"
   xmlns:admin="http://webns.net/mvcb/">
 
- <name>GStreamer FFmpeg Plug-ins</name>
- <shortname>gst-ffmpeg</shortname>
- <homepage rdf:resource="http://gstreamer.freedesktop.org/modules/gst-ffmpeg.html" />
+ <name>GStreamer libav Plug-ins</name>
+ <shortname>gst-libav</shortname>
+ <homepage rdf:resource="http://gstreamer.freedesktop.org/modules/gst-libav.html" />
  <created>2004-02-26</created>
  <shortdesc xml:lang="en">
-a plug-in using the FFmpeg library
+a plug-in using the libav library
 </shortdesc>
  <description xml:lang="en">
-GStreamer FFmpeg plug-in contains  elements using the FFmpeg library code. It
+GStreamer libav plug-in contains  elements using the libav library code. It
 contains most popular decoders as well as very fast
 colorspace conversion elements.
  </description>
  <category></category>
- <bug-database rdf:resource="http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer&amp;component=gst-ffmpeg" />
+ <bug-database rdf:resource="http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer&amp;component=gst-libav" />
  <screenshots></screenshots>
  <mailing-list rdf:resource="http://lists.sourceforge.net/lists/listinfo/gstreamer-devel/" />
  <programming-language>C</programming-language>
@@ -34,6 +34,39 @@ colorspace conversion elements.
 
  <release>
   <Version>
+   <revision>0.11.90</revision>
+   <branch>0.11</branch>
+   <name>Nameless here for evermore</name>
+   <created>2012-04-13</created>
+   <file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-0.11.90.tar.bz2" />
+   <file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-0.11.90.tar.gz" />
+  </Version>
+ </release>
+
+ <release>
+  <Version>
+   <revision>0.11.2</revision>
+   <branch>0.11</branch>
+   <name>Sadistic Symphony</name>
+   <created>2012-03-22</created>
+   <file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.11.2.tar.bz2" />
+   <file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.11.2.tar.gz" />
+  </Version>
+ </release>
+
+ <release>
+  <Version>
+   <revision>0.11.1</revision>
+   <branch>0.11</branch>
+   <name>Serpentine Sibilance</name>
+   <created>2012-02-16</created>
+   <file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.11.1.tar.bz2" />
+   <file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.11.1.tar.gz" />
+  </Version>
+ </release>
+
+ <release>
+  <Version>
    <revision>0.10.13</revision>
    <branch>0.10</branch>
    <name>A year in hell</name>
similarity index 98%
rename from gst-ffmpeg.spec.in
rename to gst-libav.spec.in
index 0e512d3..9dca0f7 100644 (file)
@@ -1,4 +1,4 @@
-%define majorminor  @GST_MAJORMINOR@
+%define majorminor  @GST_API_VERSION@
 %define gstreamer   gstreamer
 %define gst_minver  0.10.0
 %define gst_majorminor  0.10
index cbd1274..b1054e1 100644 (file)
@@ -36,7 +36,7 @@ maintainer-clean: distclean
 maintainerclean: maintainer-clean
 
 dist-local:
-       GIT_DIR=libav/.git git checkout-index --prefix=$(TMP_DIST_DIR)/libav/ -a
+       GIT_DIR=libav/.git git checkout-index --prefix=../$(TMP_DIST_DIR)/libav/ -a
        touch $(TMP_DIST_DIR)/libav/config.mak
        echo "Patching libav ./configure"
        sed -e '/Unknown option/ {N;N;s/exit 1//; }' $(TMP_DIST_DIR)/libav/configure > $(TMP_DIST_DIR)/libav/configure.tmp
index a904a44..1e83e53 100644 (file)
@@ -19,14 +19,14 @@ clean-local: clean-local-check
 check_PROGRAMS = \
        generic/plugin-test \
        generic/libavcodec-locking \
-       elements/ffdec_adpcm \
-       elements/ffdemux_ape \
+       elements/avdec_adpcm \
+       elements/avdemux_ape \
        elements/postproc
 
 VALGRIND_TO_FIX = \
        generic/plugin-test \
        generic/libavcodec-locking \
-       elements/ffdemux_ape
+       elements/avdemux_ape
 
 TESTS = $(check_PROGRAMS)
 
@@ -34,13 +34,14 @@ TESTS = $(check_PROGRAMS)
 noinst_PROGRAMS =
 
 AM_CFLAGS = $(GST_OBJ_CFLAGS) $(GST_CHECK_CFLAGS) $(CHECK_CFLAGS) \
-       $(GST_OPTION_CFLAGS) -DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\""
+       $(GST_OPTION_CFLAGS) -DGST_TEST_FILES_PATH="\"$(TEST_FILES_DIRECTORY)\"" \
+       -DGST_USE_UNSTABLE_API
 
 LDADD = $(GST_OBJ_LIBS) $(GST_CHECK_LIBS) $(CHECK_LIBS)
 
 # valgrind testing
 VALGRIND_TESTS_DISABLE = $(VALGRIND_TO_FIX)
 
-SUPPRESSIONS = $(top_srcdir)/common/gst.supp $(srcdir)/gst-ffmpeg.supp
+SUPPRESSIONS = $(top_srcdir)/common/gst.supp $(srcdir)/gst-libav.supp
 
-EXTRA_DIST = gst-ffmpeg.supp
+EXTRA_DIST = gst-libav.supp
similarity index 82%
rename from tests/check/elements/ffdec_adpcm.c
rename to tests/check/elements/avdec_adpcm.c
index ce08410..daad580 100644 (file)
@@ -1,4 +1,4 @@
-/* GStreamer unit tests for ffdec_adpcm
+/* GStreamer unit tests for avdec_adpcm
  *
  * Copyright (C) 2009 Tim-Philipp Müller  <tim centricular net>
  *
@@ -52,16 +52,10 @@ error_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
 }
 
 static gboolean
-pad_check_get_range (GstPad * pad)
-{
-  return FALSE;
-}
-
-static gboolean
 decode_file (const gchar * file, gboolean push_mode)
 {
   GstStateChangeReturn state_ret;
-  GstElement *sink, *src, *dec, *pipeline;
+  GstElement *sink, *src, *dec, *queue, *pipeline;
   GstMessage *msg;
   GstBus *bus;
   gchar *path;
@@ -73,15 +67,13 @@ decode_file (const gchar * file, gboolean push_mode)
   fail_unless (src != NULL, "Failed to create filesrc!");
 
   if (push_mode) {
-    GstPad *pad = gst_element_get_static_pad (src, "src");
-
-    /* KIDS: don't do this at home! */
-    gst_pad_set_checkgetrange_function (pad, pad_check_get_range);
-    gst_object_unref (pad);
+    queue = gst_element_factory_make ("queue", "queue");
+  } else {
+    queue = gst_element_factory_make ("identity", "identity");
   }
 
-  dec = gst_element_factory_make ("decodebin2", "decodebin2");
-  fail_unless (dec != NULL, "Failed to create decodebin2!");
+  dec = gst_element_factory_make ("decodebin", "decodebin");
+  fail_unless (dec != NULL, "Failed to create decodebin!");
 
   sink = gst_element_factory_make ("fakesink", "fakesink");
   fail_unless (sink != NULL, "Failed to create fakesink!");
@@ -92,8 +84,8 @@ decode_file (const gchar * file, gboolean push_mode)
    * we just want to abort and nothing else */
   gst_bus_set_sync_handler (bus, error_cb, (gpointer) file);
 
-  gst_bin_add_many (GST_BIN (pipeline), src, dec, sink, NULL);
-  gst_element_link_many (src, dec, NULL);
+  gst_bin_add_many (GST_BIN (pipeline), src, queue, dec, sink, NULL);
+  gst_element_link_many (src, queue, dec, NULL);
 
   path = g_build_filename (GST_TEST_FILES_PATH, file, NULL);
   GST_LOG ("reading file '%s'", path);
@@ -139,17 +131,20 @@ run_check_for_file (const gchar * filename)
   ret = decode_file (filename, FALSE);
   fail_unless (ret == TRUE, "Failed to decode '%s' (pull mode)", filename);
 
-  /* first, pull-based */
+  /* second, push-based */
   ret = decode_file (filename, TRUE);
   fail_unless (ret == TRUE, "Failed to decode '%s' (push mode)", filename);
 }
 
 GST_START_TEST (test_low_sample_rate_adpcm)
 {
-  if (!gst_default_registry_check_feature_version ("wavparse", 0, 10, 0) ||
-      !gst_default_registry_check_feature_version ("decodebin2", 0, 10, 0)) {
+#define MIN_VERSION GST_VERSION_MAJOR, GST_VERSION_MINOR, 0
+  if (!gst_registry_check_feature_version (gst_registry_get (), "wavparse",
+          MIN_VERSION)
+      || !gst_registry_check_feature_version (gst_registry_get (), "decodebin",
+          MIN_VERSION)) {
     g_printerr ("skipping test_low_sample_rate_adpcm: required element "
-        "wavparse or element decodebin2 not found\n");
+        "wavparse or element decodebin not found\n");
     return;
   }
 
@@ -159,9 +154,9 @@ GST_START_TEST (test_low_sample_rate_adpcm)
 GST_END_TEST;
 
 static Suite *
-ffdec_adpcm_suite (void)
+avdec_adpcm_suite (void)
 {
-  Suite *s = suite_create ("ffdec_adpcm");
+  Suite *s = suite_create ("avdec_adpcm");
   TCase *tc_chain = tcase_create ("general");
 
   suite_add_tcase (s, tc_chain);
@@ -170,4 +165,4 @@ ffdec_adpcm_suite (void)
   return s;
 }
 
-GST_CHECK_MAIN (ffdec_adpcm)
+GST_CHECK_MAIN (avdec_adpcm)
similarity index 80%
rename from tests/check/elements/ffdemux_ape.c
rename to tests/check/elements/avdemux_ape.c
index 2e8f106..74151b7 100644 (file)
@@ -1,4 +1,4 @@
-/* GStreamer unit tests for ffdemux_ape
+/* GStreamer unit tests for avdemux_ape
  *
  * Copyright (C) 2009 Tim-Philipp Müller  <tim centricular net>
  *
@@ -51,17 +51,23 @@ error_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
   return GST_BUS_PASS;
 }
 
-static gboolean
-event_probe (GstPad * pad, GstEvent * event, GstTagList ** p_tags)
+static GstPadProbeReturn
+event_probe (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
 {
+  GstTagList **p_tags = user_data;
+  GstEvent *event = GST_PAD_PROBE_INFO_EVENT (info);
+
   if (GST_EVENT_TYPE (event) == GST_EVENT_TAG) {
-    GST_INFO ("tag event: %" GST_PTR_FORMAT, event->structure);
+    GST_INFO ("tag event: %" GST_PTR_FORMAT, event);
     if (*p_tags == NULL) {
+      GstTagList *event_tags;
+
       GST_INFO ("first tag, saving");
-      *p_tags = gst_tag_list_copy ((GstTagList *) event->structure);
+      gst_event_parse_tag (event, &event_tags);
+      *p_tags = gst_tag_list_copy (event_tags);
     }
   }
-  return TRUE;                  /* keep the data */
+  return GST_PAD_PROBE_OK;      /* keep the data */
 }
 
 /* FIXME: push_mode not used currently */
@@ -81,8 +87,8 @@ read_tags_from_file (const gchar * file, gboolean push_mode)
   src = gst_element_factory_make ("filesrc", "filesrc");
   fail_unless (src != NULL, "Failed to create filesrc!");
 
-  dec = gst_element_factory_make ("decodebin2", "decodebin2");
-  fail_unless (dec != NULL, "Failed to create decodebin2!");
+  dec = gst_element_factory_make ("decodebin", "decodebin");
+  fail_unless (dec != NULL, "Failed to create decodebin!");
 
   sink = gst_element_factory_make ("fakesink", "fakesink");
   fail_unless (sink != NULL, "Failed to create fakesink!");
@@ -103,10 +109,11 @@ read_tags_from_file (const gchar * file, gboolean push_mode)
   /* can't link uridecodebin and sink yet, do that later */
   g_signal_connect (dec, "pad-added", G_CALLBACK (pad_added_cb), pipeline);
 
-  /* we want to make sure there's a tag event coming out of ffdemux_ape
+  /* we want to make sure there's a tag event coming out of avdemux_ape
    * (ie. the one apedemux generated) */
   pad = gst_element_get_static_pad (sink, "sink");
-  gst_pad_add_event_probe (pad, G_CALLBACK (event_probe), &tags);
+  gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, event_probe,
+      &tags, NULL);
   gst_object_unref (pad);
 
   state_ret = gst_element_set_state (pipeline, GST_STATE_PAUSED);
@@ -149,7 +156,7 @@ run_check_for_file (const gchar * filename, CheckTagsFunc * check_func)
 #define tag_list_has_tag(taglist,tag) \
     (gst_tag_list_get_value_index((taglist),(tag),0) != NULL)
 
-/* just make sure ffdemux_ape forwarded the tags extracted by apedemux
+/* just make sure avdemux_ape forwarded the tags extracted by apedemux
  * (should be the first tag list / tag event too) */
 static void
 check_for_apedemux_tags (const GstTagList * tags, const gchar * file)
@@ -168,10 +175,14 @@ check_for_apedemux_tags (const GstTagList * tags, const gchar * file)
 
 GST_START_TEST (test_tag_caching)
 {
-  if (!gst_default_registry_check_feature_version ("apedemux", 0, 10, 0) ||
-      !gst_default_registry_check_feature_version ("decodebin2", 0, 10, 0)) {
+#define MIN_VERSION GST_VERSION_MAJOR, GST_VERSION_MINOR, 0
+
+  if (!gst_registry_check_feature_version (gst_registry_get (), "apedemux",
+          MIN_VERSION)
+      || !gst_registry_check_feature_version (gst_registry_get (), "decodebin",
+          MIN_VERSION)) {
     g_printerr ("Skipping test_tag_caching: required element apedemux or "
-        "decodebin2 element not found\n");
+        "decodebin element not found\n");
     return;
   }
 
@@ -181,9 +192,9 @@ GST_START_TEST (test_tag_caching)
 GST_END_TEST;
 
 static Suite *
-ffdemux_ape_suite (void)
+avdemux_ape_suite (void)
 {
-  Suite *s = suite_create ("ffdemux_ape");
+  Suite *s = suite_create ("avdemux_ape");
   TCase *tc_chain = tcase_create ("general");
 
   suite_add_tcase (s, tc_chain);
@@ -192,4 +203,4 @@ ffdemux_ape_suite (void)
   return s;
 }
 
-GST_CHECK_MAIN (ffdemux_ape)
+GST_CHECK_MAIN (avdemux_ape)
index 5d7cee7..453d6a0 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2005 Luca Ognibene <luogni@tin.it>
  * Based (copied) on simple_launch_lines.c
  *
- * ffmpeg-lock.c: Unit test for libavcodec's locks
+ * libavcodec-locking.c: Unit test for libavcodec's locks
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -103,7 +103,7 @@ GST_START_TEST (test_libavcodec_locks)
   for (i = 0; i < NUM_SINKS; i++)
     sink[i] =
         g_strdup_printf
-        (" t.src%d ! queue ! ffenc_mpeg4 ! ffdec_mpeg4 ! fakesink sync=true",
+        (" t.src_%u ! queue ! avenc_mpeg4 ! avdec_mpeg4 ! fakesink sync=true",
         i);
 
   sink[NUM_SINKS] = NULL;
@@ -111,7 +111,7 @@ GST_START_TEST (test_libavcodec_locks)
   sinks = g_strjoinv (" ", sink);
 
   s = g_strdup_printf
-      ("videotestsrc ! video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,framerate=(fraction)10/1 ! tee name=t %s",
+      ("videotestsrc ! video/x-raw,format=(string)I420,width=320,height=240,framerate=(fraction)10/1 ! tee name=t %s",
       sinks);
 
   run_pipeline (setup_pipeline (s), s,
@@ -147,7 +147,7 @@ simple_launch_lines_suite (void)
 
 #ifndef GST_DISABLE_PARSE
   /* only run this if we haven't been configured with --disable-encoders */
-  if (gst_default_registry_check_feature_version ("ffenc_mpeg4",
+  if (gst_registry_check_feature_version (gst_registry_get (), "avenc_mpeg4",
           GST_VERSION_MAJOR, GST_VERSION_MINOR, 0)) {
     tcase_add_test (tc_chain, test_libavcodec_locks);
   } else {
index e784b2d..d661fce 100644 (file)
@@ -24,9 +24,9 @@
 #include <gst/check/gstcheck.h>
 #include <stdlib.h>
 
-GST_START_TEST (test_ffmpeg_plugin)
+GST_START_TEST (test_libav_plugin)
 {
-  GstPlugin *plugin = gst_plugin_load_by_name ("ffmpeg");
+  GstPlugin *plugin = gst_plugin_load_by_name ("libav");
 
   fail_if (plugin == NULL, "Could not load FFmpeg plugin");
 
@@ -36,21 +36,21 @@ GST_START_TEST (test_ffmpeg_plugin)
 
 GST_END_TEST;
 
-GST_START_TEST (test_ffmpeg_update_reg)
+GST_START_TEST (test_libav_update_reg)
 {
   GstElement *encoder, *muxer, *decoder;
 
   /* Ask for elements the first time */
-  encoder = gst_element_factory_make ("ffenc_mpeg2video", "sink");
-  GST_DEBUG ("Creating element ffenc_mpeg2video %p", encoder);
+  encoder = gst_element_factory_make ("avenc_mpeg2video", "sink");
+  GST_DEBUG ("Creating element avenc_mpeg2video %p", encoder);
   fail_unless (encoder != NULL);
 
-  decoder = gst_element_factory_make ("ffdec_mpeg2video", "sink");
-  GST_DEBUG ("Creating element ffdec_mpeg2video %p", decoder);
+  decoder = gst_element_factory_make ("avdec_mpeg2video", "sink");
+  GST_DEBUG ("Creating element avdec_mpeg2video %p", decoder);
   fail_unless (decoder != NULL);
 
-  muxer = gst_element_factory_make ("ffmux_dvd", "sink");
-  GST_DEBUG ("Creating element ffmux_dvd %p", muxer);
+  muxer = gst_element_factory_make ("avmux_dvd", "sink");
+  GST_DEBUG ("Creating element avmux_dvd %p", muxer);
   fail_unless (muxer != NULL);
 
   gst_object_unref (encoder);
@@ -62,16 +62,16 @@ GST_START_TEST (test_ffmpeg_update_reg)
 
   /* Ask for elements the second time */
 
-  encoder = gst_element_factory_make ("ffenc_mpeg2video", "sink");
-  GST_DEBUG ("Creating element ffenc_mpeg2video %p", encoder);
+  encoder = gst_element_factory_make ("avenc_mpeg2video", "sink");
+  GST_DEBUG ("Creating element avenc_mpeg2video %p", encoder);
   fail_unless (encoder != NULL);
 
-  decoder = gst_element_factory_make ("ffdec_mpeg2video", "sink");
-  GST_DEBUG ("Creating element ffdec_mpeg2video %p", decoder);
+  decoder = gst_element_factory_make ("avdec_mpeg2video", "sink");
+  GST_DEBUG ("Creating element avdec_mpeg2video %p", decoder);
   fail_unless (decoder != NULL);
 
-  muxer = gst_element_factory_make ("ffmux_dvd", "sink");
-  GST_DEBUG ("Creating element ffmux_dvd %p", muxer);
+  muxer = gst_element_factory_make ("avmux_dvd", "sink");
+  GST_DEBUG ("Creating element avmux_dvd %p", muxer);
   fail_unless (muxer != NULL);
 
   gst_object_unref (encoder);
@@ -89,8 +89,8 @@ plugin_test_suite (void)
 
   suite_add_tcase (s, tc_chain);
 
-  tcase_add_test (tc_chain, test_ffmpeg_plugin);
-  tcase_add_test (tc_chain, test_ffmpeg_update_reg);
+  tcase_add_test (tc_chain, test_libav_plugin);
+  tcase_add_test (tc_chain, test_libav_update_reg);
 
   return s;
 }