summaryrefslogtreecommitdiff
path: root/ext/gdk_pixbuf
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gdk_pixbuf')
-rw-r--r--ext/gdk_pixbuf/Makefile.am19
-rw-r--r--ext/gdk_pixbuf/Makefile.in837
-rw-r--r--ext/gdk_pixbuf/gstgdkanimation.h117
-rw-r--r--ext/gdk_pixbuf/gstgdkpixbuf.c558
-rw-r--r--ext/gdk_pixbuf/gstgdkpixbuf.h70
-rw-r--r--ext/gdk_pixbuf/gstgdkpixbufsink.c426
-rw-r--r--ext/gdk_pixbuf/gstgdkpixbufsink.h75
-rw-r--r--ext/gdk_pixbuf/pixbufscale.c483
-rw-r--r--ext/gdk_pixbuf/pixbufscale.h84
9 files changed, 2669 insertions, 0 deletions
diff --git a/ext/gdk_pixbuf/Makefile.am b/ext/gdk_pixbuf/Makefile.am
new file mode 100644
index 0000000..cf5265c
--- /dev/null
+++ b/ext/gdk_pixbuf/Makefile.am
@@ -0,0 +1,19 @@
+plugin_LTLIBRARIES = libgstgdkpixbuf.la
+
+libgstgdkpixbuf_la_SOURCES = gstgdkpixbuf.c gstgdkpixbufsink.c pixbufscale.c
+libgstgdkpixbuf_la_CFLAGS = \
+ $(GST_PLUGINS_BASE_CFLAGS) \
+ $(GST_BASE_CFLAGS) \
+ $(GST_CFLAGS) $(GDK_PIXBUF_CFLAGS)
+libgstgdkpixbuf_la_LIBADD = \
+ $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
+ $(GST_BASE_LIBS) \
+ $(GST_LIBS) $(GDK_PIXBUF_LIBS)
+libgstgdkpixbuf_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+libgstgdkpixbuf_la_LIBTOOLFLAGS = --tag=disable-static
+
+noinst_HEADERS = \
+ gstgdkpixbuf.h \
+ gstgdkpixbufsink.h \
+ pixbufscale.h \
+ gstgdkanimation.h
diff --git a/ext/gdk_pixbuf/Makefile.in b/ext/gdk_pixbuf/Makefile.in
new file mode 100644
index 0000000..72f8caa
--- /dev/null
+++ b/ext/gdk_pixbuf/Makefile.in
@@ -0,0 +1,837 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = ext/gdk_pixbuf
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \
+ $(top_srcdir)/common/m4/as-auto-alt.m4 \
+ $(top_srcdir)/common/m4/as-compiler-flag.m4 \
+ $(top_srcdir)/common/m4/as-gcc-inline-assembly.m4 \
+ $(top_srcdir)/common/m4/as-objc.m4 \
+ $(top_srcdir)/common/m4/as-python.m4 \
+ $(top_srcdir)/common/m4/as-scrub-include.m4 \
+ $(top_srcdir)/common/m4/as-version.m4 \
+ $(top_srcdir)/common/m4/ax_create_stdint_h.m4 \
+ $(top_srcdir)/common/m4/gst-arch.m4 \
+ $(top_srcdir)/common/m4/gst-args.m4 \
+ $(top_srcdir)/common/m4/gst-check.m4 \
+ $(top_srcdir)/common/m4/gst-default.m4 \
+ $(top_srcdir)/common/m4/gst-dowhile.m4 \
+ $(top_srcdir)/common/m4/gst-error.m4 \
+ $(top_srcdir)/common/m4/gst-feature.m4 \
+ $(top_srcdir)/common/m4/gst-gettext.m4 \
+ $(top_srcdir)/common/m4/gst-glib2.m4 \
+ $(top_srcdir)/common/m4/gst-package-release-datetime.m4 \
+ $(top_srcdir)/common/m4/gst-platform.m4 \
+ $(top_srcdir)/common/m4/gst-plugin-docs.m4 \
+ $(top_srcdir)/common/m4/gst-plugindir.m4 \
+ $(top_srcdir)/common/m4/gst-x11.m4 \
+ $(top_srcdir)/common/m4/gst.m4 \
+ $(top_srcdir)/common/m4/gtk-doc.m4 \
+ $(top_srcdir)/common/m4/orc.m4 $(top_srcdir)/common/m4/pkg.m4 \
+ $(top_srcdir)/m4/aalib.m4 $(top_srcdir)/m4/esd.m4 \
+ $(top_srcdir)/m4/gconf-2.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gst-fionread.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(plugindir)"
+LTLIBRARIES = $(plugin_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libgstgdkpixbuf_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_libgstgdkpixbuf_la_OBJECTS = libgstgdkpixbuf_la-gstgdkpixbuf.lo \
+ libgstgdkpixbuf_la-gstgdkpixbufsink.lo \
+ libgstgdkpixbuf_la-pixbufscale.lo
+libgstgdkpixbuf_la_OBJECTS = $(am_libgstgdkpixbuf_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+libgstgdkpixbuf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(libgstgdkpixbuf_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(CCLD) $(libgstgdkpixbuf_la_CFLAGS) $(CFLAGS) \
+ $(libgstgdkpixbuf_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libgstgdkpixbuf_la_SOURCES)
+DIST_SOURCES = $(libgstgdkpixbuf_la_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+AALIB_CFLAGS = @AALIB_CFLAGS@
+AALIB_CONFIG = @AALIB_CONFIG@
+AALIB_LIBS = @AALIB_LIBS@
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+ANNODEX_CFLAGS = @ANNODEX_CFLAGS@
+ANNODEX_LIBS = @ANNODEX_LIBS@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BZ2_LIBS = @BZ2_LIBS@
+CAIRO_CFLAGS = @CAIRO_CFLAGS@
+CAIRO_GOBJECT_CFLAGS = @CAIRO_GOBJECT_CFLAGS@
+CAIRO_GOBJECT_LIBS = @CAIRO_GOBJECT_LIBS@
+CAIRO_LIBS = @CAIRO_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_AUDIOSINK = @DEFAULT_AUDIOSINK@
+DEFAULT_AUDIOSRC = @DEFAULT_AUDIOSRC@
+DEFAULT_VIDEOSINK = @DEFAULT_VIDEOSINK@
+DEFAULT_VIDEOSRC = @DEFAULT_VIDEOSRC@
+DEFAULT_VISUALIZER = @DEFAULT_VISUALIZER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPRECATED_CFLAGS = @DEPRECATED_CFLAGS@
+DIRECTSOUND_CFLAGS = @DIRECTSOUND_CFLAGS@
+DIRECTSOUND_LDFLAGS = @DIRECTSOUND_LDFLAGS@
+DIRECTSOUND_LIBS = @DIRECTSOUND_LIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+DV1394_CFLAGS = @DV1394_CFLAGS@
+DV1394_LIBS = @DV1394_LIBS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ERROR_CFLAGS = @ERROR_CFLAGS@
+ERROR_CXXFLAGS = @ERROR_CXXFLAGS@
+ESD_CFLAGS = @ESD_CFLAGS@
+ESD_CONFIG = @ESD_CONFIG@
+ESD_LIBS = @ESD_LIBS@
+EXEEXT = @EXEEXT@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLAC_CFLAGS = @FLAC_CFLAGS@
+FLAC_LIBS = @FLAC_LIBS@
+GCONFTOOL = @GCONFTOOL@
+GCONF_CFLAGS = @GCONF_CFLAGS@
+GCONF_LIBS = @GCONF_LIBS@
+GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@
+GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
+GCOV = @GCOV@
+GCOV_CFLAGS = @GCOV_CFLAGS@
+GCOV_LIBS = @GCOV_LIBS@
+GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@
+GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GIO_CFLAGS = @GIO_CFLAGS@
+GIO_LIBS = @GIO_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_EXTRA_CFLAGS = @GLIB_EXTRA_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_PREFIX = @GLIB_PREFIX@
+GLIB_REQ = @GLIB_REQ@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+GSTPB_PLUGINS_DIR = @GSTPB_PLUGINS_DIR@
+GSTPB_PREFIX = @GSTPB_PREFIX@
+GST_ALL_LDFLAGS = @GST_ALL_LDFLAGS@
+GST_BASE_CFLAGS = @GST_BASE_CFLAGS@
+GST_BASE_LIBS = @GST_BASE_LIBS@
+GST_CFLAGS = @GST_CFLAGS@
+GST_CHECK_CFLAGS = @GST_CHECK_CFLAGS@
+GST_CHECK_LIBS = @GST_CHECK_LIBS@
+GST_CONTROLLER_CFLAGS = @GST_CONTROLLER_CFLAGS@
+GST_CONTROLLER_LIBS = @GST_CONTROLLER_LIBS@
+GST_CXXFLAGS = @GST_CXXFLAGS@
+GST_GDP_CFLAGS = @GST_GDP_CFLAGS@
+GST_GDP_LIBS = @GST_GDP_LIBS@
+GST_LEVEL_DEFAULT = @GST_LEVEL_DEFAULT@
+GST_LIBS = @GST_LIBS@
+GST_LICENSE = @GST_LICENSE@
+GST_LT_LDFLAGS = @GST_LT_LDFLAGS@
+GST_MAJORMINOR = @GST_MAJORMINOR@
+GST_OPTION_CFLAGS = @GST_OPTION_CFLAGS@
+GST_OPTION_CXXFLAGS = @GST_OPTION_CXXFLAGS@
+GST_PACKAGE_NAME = @GST_PACKAGE_NAME@
+GST_PACKAGE_ORIGIN = @GST_PACKAGE_ORIGIN@
+GST_PLUGINS_ALL = @GST_PLUGINS_ALL@
+GST_PLUGINS_BASE_CFLAGS = @GST_PLUGINS_BASE_CFLAGS@
+GST_PLUGINS_BASE_DIR = @GST_PLUGINS_BASE_DIR@
+GST_PLUGINS_BASE_LIBS = @GST_PLUGINS_BASE_LIBS@
+GST_PLUGINS_DIR = @GST_PLUGINS_DIR@
+GST_PLUGINS_SELECTED = @GST_PLUGINS_SELECTED@
+GST_PLUGIN_LDFLAGS = @GST_PLUGIN_LDFLAGS@
+GST_PREFIX = @GST_PREFIX@
+GST_TOOLS_DIR = @GST_TOOLS_DIR@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+GTK_X11_CFLAGS = @GTK_X11_CFLAGS@
+GTK_X11_LIBS = @GTK_X11_LIBS@
+GUDEV_CFLAGS = @GUDEV_CFLAGS@
+GUDEV_LIBS = @GUDEV_LIBS@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+HAVE_AVC1394 = @HAVE_AVC1394@
+HAVE_BZ2 = @HAVE_BZ2@
+HAVE_CXX = @HAVE_CXX@
+HAVE_DIRECTSOUND = @HAVE_DIRECTSOUND@
+HAVE_GCONFTOOL = @HAVE_GCONFTOOL@
+HAVE_ROM1394 = @HAVE_ROM1394@
+HAVE_SPEEX = @HAVE_SPEEX@
+HAVE_X = @HAVE_X@
+HAVE_XSHM = @HAVE_XSHM@
+HAVE_ZLIB = @HAVE_ZLIB@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+JACK_0_120_1_CFLAGS = @JACK_0_120_1_CFLAGS@
+JACK_0_120_1_LIBS = @JACK_0_120_1_LIBS@
+JACK_1_9_7_CFLAGS = @JACK_1_9_7_CFLAGS@
+JACK_1_9_7_LIBS = @JACK_1_9_7_LIBS@
+JACK_CFLAGS = @JACK_CFLAGS@
+JACK_LIBS = @JACK_LIBS@
+JPEG_LIBS = @JPEG_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCACA_CFLAGS = @LIBCACA_CFLAGS@
+LIBCACA_LIBS = @LIBCACA_LIBS@
+LIBDV_CFLAGS = @LIBDV_CFLAGS@
+LIBDV_LIBS = @LIBDV_LIBS@
+LIBICONV = @LIBICONV@
+LIBIEC61883_CFLAGS = @LIBIEC61883_CFLAGS@
+LIBIEC61883_LIBS = @LIBIEC61883_LIBS@
+LIBINTL = @LIBINTL@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALEDIR = @LOCALEDIR@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJC_LDFLAGS = @OBJC_LDFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+ORCC = @ORCC@
+ORCC_FLAGS = @ORCC_FLAGS@
+ORC_CFLAGS = @ORC_CFLAGS@
+ORC_LIBS = @ORC_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@
+PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@
+PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@
+PACKAGE_VERSION_NANO = @PACKAGE_VERSION_NANO@
+PACKAGE_VERSION_RELEASE = @PACKAGE_VERSION_RELEASE@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PLUGINDIR = @PLUGINDIR@
+POSUB = @POSUB@
+PROFILE_CFLAGS = @PROFILE_CFLAGS@
+PULSE_0_9_20_CFLAGS = @PULSE_0_9_20_CFLAGS@
+PULSE_0_9_20_LIBS = @PULSE_0_9_20_LIBS@
+PULSE_1_0_CFLAGS = @PULSE_1_0_CFLAGS@
+PULSE_1_0_LIBS = @PULSE_1_0_LIBS@
+PULSE_CFLAGS = @PULSE_CFLAGS@
+PULSE_LIBS = @PULSE_LIBS@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+RAW1394_CFLAGS = @RAW1394_CFLAGS@
+RAW1394_LIBS = @RAW1394_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHOUT2_CFLAGS = @SHOUT2_CFLAGS@
+SHOUT2_LIBS = @SHOUT2_LIBS@
+SOUP_CFLAGS = @SOUP_CFLAGS@
+SOUP_LIBS = @SOUP_LIBS@
+SPEEX_CFLAGS = @SPEEX_CFLAGS@
+SPEEX_LIBS = @SPEEX_LIBS@
+STRIP = @STRIP@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_CXXFLAGS = @TAGLIB_CXXFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
+USE_NLS = @USE_NLS@
+VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+VALGRIND_LIBS = @VALGRIND_LIBS@
+VALGRIND_PATH = @VALGRIND_PATH@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+WARNING_CXXFLAGS = @WARNING_CXXFLAGS@
+WAVPACK_CFLAGS = @WAVPACK_CFLAGS@
+WAVPACK_LIBS = @WAVPACK_LIBS@
+WIN32_LIBS = @WIN32_LIBS@
+XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@
+XDAMAGE_LIBS = @XDAMAGE_LIBS@
+XFIXES_CFLAGS = @XFIXES_CFLAGS@
+XFIXES_LIBS = @XFIXES_LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+XMKMF = @XMKMF@
+XSHM_LIBS = @XSHM_LIBS@
+XVIDEO_LIBS = @XVIDEO_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_OBJC = @ac_ct_OBJC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+plugindir = @plugindir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+plugin_LTLIBRARIES = libgstgdkpixbuf.la
+libgstgdkpixbuf_la_SOURCES = gstgdkpixbuf.c gstgdkpixbufsink.c pixbufscale.c
+libgstgdkpixbuf_la_CFLAGS = \
+ $(GST_PLUGINS_BASE_CFLAGS) \
+ $(GST_BASE_CFLAGS) \
+ $(GST_CFLAGS) $(GDK_PIXBUF_CFLAGS)
+
+libgstgdkpixbuf_la_LIBADD = \
+ $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
+ $(GST_BASE_LIBS) \
+ $(GST_LIBS) $(GDK_PIXBUF_LIBS)
+
+libgstgdkpixbuf_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+libgstgdkpixbuf_la_LIBTOOLFLAGS = --tag=disable-static
+noinst_HEADERS = \
+ gstgdkpixbuf.h \
+ gstgdkpixbufsink.h \
+ pixbufscale.h \
+ gstgdkanimation.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ext/gdk_pixbuf/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu ext/gdk_pixbuf/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
+ @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \
+ }
+
+uninstall-pluginLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \
+ done
+
+clean-pluginLTLIBRARIES:
+ -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES)
+ @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libgstgdkpixbuf.la: $(libgstgdkpixbuf_la_OBJECTS) $(libgstgdkpixbuf_la_DEPENDENCIES) $(EXTRA_libgstgdkpixbuf_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libgstgdkpixbuf_la_LINK) -rpath $(plugindir) $(libgstgdkpixbuf_la_OBJECTS) $(libgstgdkpixbuf_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbuf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbufsink.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgstgdkpixbuf_la-pixbufscale.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+libgstgdkpixbuf_la-gstgdkpixbuf.lo: gstgdkpixbuf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgdkpixbuf_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgdkpixbuf_la_CFLAGS) $(CFLAGS) -MT libgstgdkpixbuf_la-gstgdkpixbuf.lo -MD -MP -MF $(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbuf.Tpo -c -o libgstgdkpixbuf_la-gstgdkpixbuf.lo `test -f 'gstgdkpixbuf.c' || echo '$(srcdir)/'`gstgdkpixbuf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbuf.Tpo $(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbuf.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgdkpixbuf.c' object='libgstgdkpixbuf_la-gstgdkpixbuf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgdkpixbuf_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgdkpixbuf_la_CFLAGS) $(CFLAGS) -c -o libgstgdkpixbuf_la-gstgdkpixbuf.lo `test -f 'gstgdkpixbuf.c' || echo '$(srcdir)/'`gstgdkpixbuf.c
+
+libgstgdkpixbuf_la-gstgdkpixbufsink.lo: gstgdkpixbufsink.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgdkpixbuf_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgdkpixbuf_la_CFLAGS) $(CFLAGS) -MT libgstgdkpixbuf_la-gstgdkpixbufsink.lo -MD -MP -MF $(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbufsink.Tpo -c -o libgstgdkpixbuf_la-gstgdkpixbufsink.lo `test -f 'gstgdkpixbufsink.c' || echo '$(srcdir)/'`gstgdkpixbufsink.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbufsink.Tpo $(DEPDIR)/libgstgdkpixbuf_la-gstgdkpixbufsink.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstgdkpixbufsink.c' object='libgstgdkpixbuf_la-gstgdkpixbufsink.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgdkpixbuf_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgdkpixbuf_la_CFLAGS) $(CFLAGS) -c -o libgstgdkpixbuf_la-gstgdkpixbufsink.lo `test -f 'gstgdkpixbufsink.c' || echo '$(srcdir)/'`gstgdkpixbufsink.c
+
+libgstgdkpixbuf_la-pixbufscale.lo: pixbufscale.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgdkpixbuf_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgdkpixbuf_la_CFLAGS) $(CFLAGS) -MT libgstgdkpixbuf_la-pixbufscale.lo -MD -MP -MF $(DEPDIR)/libgstgdkpixbuf_la-pixbufscale.Tpo -c -o libgstgdkpixbuf_la-pixbufscale.lo `test -f 'pixbufscale.c' || echo '$(srcdir)/'`pixbufscale.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgstgdkpixbuf_la-pixbufscale.Tpo $(DEPDIR)/libgstgdkpixbuf_la-pixbufscale.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pixbufscale.c' object='libgstgdkpixbuf_la-pixbufscale.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstgdkpixbuf_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstgdkpixbuf_la_CFLAGS) $(CFLAGS) -c -o libgstgdkpixbuf_la-pixbufscale.lo `test -f 'pixbufscale.c' || echo '$(srcdir)/'`pixbufscale.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(plugindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pluginLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pluginLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pluginLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-pluginLTLIBRARIES \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-pluginLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ext/gdk_pixbuf/gstgdkanimation.h b/ext/gdk_pixbuf/gstgdkanimation.h
new file mode 100644
index 0000000..b6b2529
--- /dev/null
+++ b/ext/gdk_pixbuf/gstgdkanimation.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GST_LOADER_H__
+#define __GST_LOADER_H__
+
+#include <gst/gst.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk-pixbuf/gdk-pixbuf-animation.h>
+#include <gdk-pixbuf/gdk-pixbuf-io.h>
+#include <stdio.h>
+
+G_BEGIN_DECLS
+
+/* how many bytes we need to have available before we dare to start a new iteration */
+#define GST_GDK_BUFFER_SIZE (102400)
+/* how far behind we need to be before we attempt to seek */
+#define GST_GDK_MAX_DELAY_TO_SEEK (GST_SECOND / 4)
+
+
+#define GST_TYPE_GDK_ANIMATION (gst_gdk_animation_get_type())
+#define GST_GDK_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GDK_ANIMATION,GstGdkAnimation))
+#define GST_GDK_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GDK_ANIMATION,GstGdkAnimationClass))
+#define GST_IS_GDK_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GDK_ANIMATION))
+#define GST_IS_GDK_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GDK_ANIMATION))
+
+typedef struct _GstGdkAnimation GstGdkAnimation;
+typedef struct _GstGdkAnimationClass GstGdkAnimationClass;
+
+typedef struct _GstGdkAnimationIter GstGdkAnimationIter;
+typedef struct _GstGdkAnimationIterClass GstGdkAnimationIterClass;
+
+struct _GstGdkAnimation
+{
+ GdkPixbufAnimation parent;
+
+ /* name of temporary buffer file */
+ gchar * temp_location;
+ /* file descriptor to temporary file or 0 if we're done writing */
+ int temp_fd;
+
+ /* size of image */
+ gint width;
+ gint height;
+ gint bpp;
+ /* static image we use */
+ GdkPixbuf * pixbuf;
+};
+
+struct _GstGdkAnimationClass
+{
+ GdkPixbufAnimationClass parent_class;
+};
+
+GType gst_gdk_animation_get_type (void);
+
+GstGdkAnimation * gst_gdk_animation_new (GError **error);
+
+gboolean gst_gdk_animation_add_data (GstGdkAnimation * ani,
+ const guint8 * data,
+ guint size);
+void gst_gdk_animation_done_adding (GstGdkAnimation * ani);
+
+
+#define GST_TYPE_GDK_ANIMATION_ITER (gst_gdk_animation_iter_get_type ())
+#define GST_GDK_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIter))
+#define GST_IS_GDK_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GST_TYPE_GDK_ANIMATION_ITER))
+
+#define GST_GDK_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIterClass))
+#define GST_IS_GDK_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GDK_ANIMATION_ITER))
+#define GST_GDK_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIterClass))
+
+struct _GstGdkAnimationIter {
+ GdkPixbufAnimationIter parent;
+
+ /* our animation */
+ GstGdkAnimation * ani;
+ /* start timeval */
+ GTimeVal start;
+ /* timestamp of last buffer */
+ GstClockTime last_timestamp;
+
+ /* pipeline we're using */
+ GstElement * pipeline;
+ gboolean eos;
+ gboolean just_seeked;
+
+ /* current image and the buffers containing the data */
+ GdkPixbuf * pixbuf;
+ GQueue * buffers;
+};
+
+struct _GstGdkAnimationIterClass {
+ GdkPixbufAnimationIterClass parent_class;
+};
+
+GType gst_gdk_animation_iter_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GST_GDK_ANIMATION_H__ */
diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c
new file mode 100644
index 0000000..0a09400
--- /dev/null
+++ b/ext/gdk_pixbuf/gstgdkpixbuf.c
@@ -0,0 +1,558 @@
+/* GStreamer GdkPixbuf-based image decoder
+ * Copyright (C) 1999-2001 Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) 2003 David A. Schleef <ds@schleef.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <gst/gst.h>
+#include <gst/video/video.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <string.h>
+
+#include "gstgdkpixbuf.h"
+#include "gstgdkpixbufsink.h"
+#include "pixbufscale.h"
+
+GST_DEBUG_CATEGORY_STATIC (gst_gdk_pixbuf_debug);
+#define GST_CAT_DEFAULT gst_gdk_pixbuf_debug
+
+enum
+{
+ ARG_0,
+ ARG_SILENT /* FIXME 0.11: remove */
+};
+
+static GstStaticPadTemplate gst_gdk_pixbuf_sink_template =
+ GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("image/png; "
+ /* "image/jpeg; " disabled because we can't handle MJPEG */
+ "image/gif; "
+ "image/x-icon; "
+ "application/x-navi-animation; "
+ "image/x-cmu-raster; "
+ "image/x-sun-raster; "
+ "image/x-pixmap; "
+ "image/tiff; "
+ "image/x-portable-anymap; "
+ "image/x-portable-bitmap; "
+ "image/x-portable-graymap; "
+ "image/x-portable-pixmap; "
+ "image/bmp; "
+ "image/x-bmp; "
+ "image/x-MS-bmp; "
+ "image/vnd.wap.wbmp; " "image/x-bitmap; " "image/x-tga; "
+ "image/x-pcx; image/svg; image/svg+xml")
+ );
+
+static GstStaticPadTemplate gst_gdk_pixbuf_src_template =
+ GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_RGBA)
+ );
+
+static void gst_gdk_pixbuf_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
+static void gst_gdk_pixbuf_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec);
+
+static GstStateChangeReturn
+gst_gdk_pixbuf_change_state (GstElement * element, GstStateChange transition);
+static GstFlowReturn gst_gdk_pixbuf_chain (GstPad * pad, GstBuffer * buffer);
+static gboolean gst_gdk_pixbuf_sink_event (GstPad * pad, GstEvent * event);
+
+#ifdef enable_typefind
+static void gst_gdk_pixbuf_type_find (GstTypeFind * tf, gpointer ignore);
+#endif
+
+GST_BOILERPLATE (GstGdkPixbuf, gst_gdk_pixbuf, GstElement, GST_TYPE_ELEMENT);
+
+static gboolean
+gst_gdk_pixbuf_sink_setcaps (GstPad * pad, GstCaps * caps)
+{
+ GstGdkPixbuf *filter;
+ const GValue *framerate;
+ GstStructure *s;
+
+ filter = GST_GDK_PIXBUF (GST_PAD_PARENT (pad));
+ s = gst_caps_get_structure (caps, 0);
+
+ if ((framerate = gst_structure_get_value (s, "framerate")) != NULL) {
+ filter->framerate_numerator = gst_value_get_fraction_numerator (framerate);
+ filter->framerate_denominator =
+ gst_value_get_fraction_denominator (framerate);
+ GST_DEBUG_OBJECT (filter, "got framerate of %d/%d fps => packetized mode",
+ filter->framerate_numerator, filter->framerate_denominator);
+ } else {
+ filter->framerate_numerator = 0;
+ filter->framerate_denominator = 1;
+ GST_DEBUG_OBJECT (filter, "no framerate, assuming single image");
+ }
+
+ return TRUE;
+}
+
+static GstCaps *
+gst_gdk_pixbuf_get_capslist (void)
+{
+ GSList *slist;
+ GSList *slist0;
+ GstCaps *capslist = NULL;
+ GstCaps *return_caps = NULL;
+ GstCaps *tmpl_caps;
+
+ capslist = gst_caps_new_empty ();
+ slist0 = gdk_pixbuf_get_formats ();
+
+ for (slist = slist0; slist; slist = g_slist_next (slist)) {
+ GdkPixbufFormat *pixbuf_format;
+ char **mimetypes;
+ char **mimetype;
+
+ pixbuf_format = slist->data;
+ mimetypes = gdk_pixbuf_format_get_mime_types (pixbuf_format);
+
+ for (mimetype = mimetypes; *mimetype; mimetype++) {
+ gst_caps_append_structure (capslist, gst_structure_new (*mimetype, NULL));
+ }
+ g_strfreev (mimetypes);
+ }
+ g_slist_free (slist0);
+
+ tmpl_caps = gst_static_caps_get (&gst_gdk_pixbuf_sink_template.static_caps);
+ return_caps = gst_caps_intersect (capslist, tmpl_caps);
+
+ gst_caps_unref (tmpl_caps);
+ gst_caps_unref (capslist);
+ return return_caps;
+}
+
+static GstCaps *
+gst_gdk_pixbuf_sink_getcaps (GstPad * pad)
+{
+ return gst_gdk_pixbuf_get_capslist ();
+}
+
+static void
+gst_gdk_pixbuf_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_add_static_pad_template (element_class,
+ &gst_gdk_pixbuf_src_template);
+ gst_element_class_add_static_pad_template (element_class,
+ &gst_gdk_pixbuf_sink_template);
+ gst_element_class_set_details_simple (element_class,
+ "GdkPixbuf image decoder", "Codec/Decoder/Image",
+ "Decodes images in a video stream using GdkPixbuf",
+ "David A. Schleef <ds@schleef.org>, Renato Filho <renato.filho@indt.org.br>");
+}
+
+/* initialize the plugin's class */
+static void
+gst_gdk_pixbuf_class_init (GstGdkPixbufClass * klass)
+{
+ GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
+
+ gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
+
+ gobject_class->set_property = gst_gdk_pixbuf_set_property;
+ gobject_class->get_property = gst_gdk_pixbuf_get_property;
+
+ g_object_class_install_property (gobject_class, ARG_SILENT,
+ g_param_spec_boolean ("silent", "Silent",
+ "Produce verbose output ? (deprecated)", FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ gstelement_class->change_state =
+ GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_change_state);
+}
+
+static void
+gst_gdk_pixbuf_init (GstGdkPixbuf * filter, GstGdkPixbufClass * klass)
+{
+ filter->sinkpad =
+ gst_pad_new_from_static_template (&gst_gdk_pixbuf_sink_template, "sink");
+ gst_pad_set_setcaps_function (filter->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_setcaps));
+ gst_pad_set_getcaps_function (filter->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_getcaps));
+ gst_pad_set_chain_function (filter->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_chain));
+ gst_pad_set_event_function (filter->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_event));
+ gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
+
+ filter->srcpad =
+ gst_pad_new_from_static_template (&gst_gdk_pixbuf_src_template, "src");
+ gst_pad_use_fixed_caps (filter->srcpad);
+ gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
+
+ filter->last_timestamp = GST_CLOCK_TIME_NONE;
+ filter->pixbuf_loader = NULL;
+}
+
+static GstFlowReturn
+gst_gdk_pixbuf_flush (GstGdkPixbuf * filter)
+{
+ GstBuffer *outbuf;
+ GdkPixbuf *pixbuf;
+ int y;
+ guint8 *out_pix;
+ guint8 *in_pix;
+ int in_rowstride;
+ GstFlowReturn ret;
+ GstCaps *caps = NULL;
+ gint n_channels;
+
+ pixbuf = gdk_pixbuf_loader_get_pixbuf (filter->pixbuf_loader);
+ if (pixbuf == NULL)
+ goto no_pixbuf;
+
+ if (filter->image_size == 0) {
+ filter->width = gdk_pixbuf_get_width (pixbuf);
+ filter->height = gdk_pixbuf_get_height (pixbuf);
+ filter->rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ filter->image_size = filter->rowstride * filter->height;
+
+ n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+ switch (n_channels) {
+ case 3:
+ caps = gst_caps_from_string (GST_VIDEO_CAPS_RGB);
+ break;
+ case 4:
+ caps = gst_caps_from_string (GST_VIDEO_CAPS_RGBA);
+ break;
+ default:
+ goto channels_not_supported;
+ }
+
+ gst_caps_set_simple (caps,
+ "width", G_TYPE_INT, filter->width,
+ "height", G_TYPE_INT, filter->height,
+ "framerate", GST_TYPE_FRACTION, filter->framerate_numerator,
+ filter->framerate_denominator, NULL);
+
+ GST_DEBUG ("Set size to %dx%d", filter->width, filter->height);
+ gst_pad_set_caps (filter->srcpad, caps);
+ gst_caps_unref (caps);
+ }
+
+ ret = gst_pad_alloc_buffer_and_set_caps (filter->srcpad,
+ GST_BUFFER_OFFSET_NONE,
+ filter->image_size, GST_PAD_CAPS (filter->srcpad), &outbuf);
+
+ if (ret != GST_FLOW_OK)
+ goto no_buffer;
+
+ GST_BUFFER_TIMESTAMP (outbuf) = filter->last_timestamp;
+ GST_BUFFER_DURATION (outbuf) = GST_CLOCK_TIME_NONE;
+
+ in_pix = gdk_pixbuf_get_pixels (pixbuf);
+ in_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ out_pix = GST_BUFFER_DATA (outbuf);
+
+ /* FIXME, last line might not have rowstride pixels */
+ for (y = 0; y < filter->height; y++) {
+ memcpy (out_pix, in_pix, filter->rowstride);
+ in_pix += in_rowstride;
+ out_pix += filter->rowstride;
+ }
+
+ GST_DEBUG ("pushing... %d bytes", GST_BUFFER_SIZE (outbuf));
+ ret = gst_pad_push (filter->srcpad, outbuf);
+
+ if (ret != GST_FLOW_OK)
+ GST_DEBUG_OBJECT (filter, "flow: %s", gst_flow_get_name (ret));
+
+ return ret;
+
+ /* ERRORS */
+no_pixbuf:
+ {
+ GST_ELEMENT_ERROR (filter, STREAM, DECODE, (NULL), ("error geting pixbuf"));
+ return GST_FLOW_ERROR;
+ }
+channels_not_supported:
+ {
+ GST_ELEMENT_ERROR (filter, STREAM, DECODE, (NULL),
+ ("%d channels not supported", n_channels));
+ return GST_FLOW_ERROR;
+ }
+no_buffer:
+ {
+ GST_DEBUG ("Failed to create outbuffer - %s", gst_flow_get_name (ret));
+ return ret;
+ }
+}
+
+static gboolean
+gst_gdk_pixbuf_sink_event (GstPad * pad, GstEvent * event)
+{
+ GstFlowReturn res = GST_FLOW_OK;
+ gboolean ret = TRUE;
+ GstGdkPixbuf *pixbuf;
+
+ pixbuf = GST_GDK_PIXBUF (gst_pad_get_parent (pad));
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_EOS:
+ if (pixbuf->pixbuf_loader != NULL) {
+ gdk_pixbuf_loader_close (pixbuf->pixbuf_loader, NULL);
+ res = gst_gdk_pixbuf_flush (pixbuf);
+ g_object_unref (G_OBJECT (pixbuf->pixbuf_loader));
+ pixbuf->pixbuf_loader = NULL;
+ /* as long as we don't have flow returns for event functions we need
+ * to post an error here, or the application might never know that
+ * things failed */
+ if (res != GST_FLOW_OK && res != GST_FLOW_WRONG_STATE) {
+ GST_ELEMENT_ERROR (pixbuf, STREAM, FAILED, (NULL),
+ ("Flow: %s", gst_flow_get_name (res)));
+ }
+ }
+ break;
+ case GST_EVENT_NEWSEGMENT:
+ case GST_EVENT_FLUSH_STOP:
+ if (pixbuf->pixbuf_loader != NULL) {
+ gdk_pixbuf_loader_close (pixbuf->pixbuf_loader, NULL);
+ g_object_unref (G_OBJECT (pixbuf->pixbuf_loader));
+ pixbuf->pixbuf_loader = NULL;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (res == GST_FLOW_OK) {
+ ret = gst_pad_event_default (pad, event);
+ } else {
+ ret = FALSE;
+ }
+
+ gst_object_unref (pixbuf);
+
+ return ret;
+}
+
+static GstFlowReturn
+gst_gdk_pixbuf_chain (GstPad * pad, GstBuffer * buf)
+{
+ GstGdkPixbuf *filter;
+ GstFlowReturn ret = GST_FLOW_OK;
+ GError *error = NULL;
+ GstClockTime timestamp;
+ guint8 *data;
+ guint size;
+
+ filter = GST_GDK_PIXBUF (gst_pad_get_parent (pad));
+
+ timestamp = GST_BUFFER_TIMESTAMP (buf);
+
+ if (GST_CLOCK_TIME_IS_VALID (timestamp))
+ filter->last_timestamp = timestamp;
+
+ GST_LOG_OBJECT (filter, "buffer with ts: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (timestamp));
+
+ if (filter->pixbuf_loader == NULL)
+ filter->pixbuf_loader = gdk_pixbuf_loader_new ();
+
+ data = GST_BUFFER_DATA (buf);
+ size = GST_BUFFER_SIZE (buf);
+
+ GST_LOG_OBJECT (filter, "Writing buffer size %d", size);
+ if (!gdk_pixbuf_loader_write (filter->pixbuf_loader, data, size, &error))
+ goto error;
+
+ /* packetised mode? */
+ if (filter->framerate_numerator != 0) {
+ gdk_pixbuf_loader_close (filter->pixbuf_loader, NULL);
+ ret = gst_gdk_pixbuf_flush (filter);
+ g_object_unref (filter->pixbuf_loader);
+ filter->pixbuf_loader = NULL;
+ }
+
+ gst_buffer_unref (buf);
+ gst_object_unref (filter);
+
+ return ret;
+
+ /* ERRORS */
+error:
+ {
+ GST_ELEMENT_ERROR (filter, STREAM, DECODE, (NULL),
+ ("gdk_pixbuf_loader_write error: %s", error->message));
+ g_error_free (error);
+ gst_buffer_unref (buf);
+ gst_object_unref (filter);
+ return GST_FLOW_ERROR;
+ }
+}
+
+static void
+gst_gdk_pixbuf_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
+{
+ switch (prop_id) {
+ case ARG_SILENT:
+ /* filter->silent = g_value_get_boolean (value); */
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_gdk_pixbuf_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec)
+{
+ switch (prop_id) {
+ case ARG_SILENT:
+ /* g_value_set_boolean (value, filter->silent); */
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static GstStateChangeReturn
+gst_gdk_pixbuf_change_state (GstElement * element, GstStateChange transition)
+{
+ GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+ GstGdkPixbuf *dec = GST_GDK_PIXBUF (element);
+
+ switch (transition) {
+ case GST_STATE_CHANGE_READY_TO_PAUSED:
+ /* default to single image mode, setcaps function might not be called */
+ dec->framerate_numerator = 0;
+ dec->framerate_denominator = 1;
+ break;
+ default:
+ break;
+ }
+
+ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+ if (ret == GST_STATE_CHANGE_FAILURE)
+ return ret;
+
+ switch (transition) {
+ case GST_STATE_CHANGE_PAUSED_TO_READY:
+ dec->framerate_numerator = 0;
+ dec->framerate_denominator = 0;
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+#define GST_GDK_PIXBUF_TYPE_FIND_SIZE 1024
+
+#ifdef enable_typefind
+static void
+gst_gdk_pixbuf_type_find (GstTypeFind * tf, gpointer ignore)
+{
+ guint8 *data;
+ GdkPixbufLoader *pixbuf_loader;
+ GdkPixbufFormat *format;
+
+ data = gst_type_find_peek (tf, 0, GST_GDK_PIXBUF_TYPE_FIND_SIZE);
+ if (data == NULL)
+ return;
+
+ GST_DEBUG ("creating new loader");
+
+ pixbuf_loader = gdk_pixbuf_loader_new ();
+
+ gdk_pixbuf_loader_write (pixbuf_loader, data, GST_GDK_PIXBUF_TYPE_FIND_SIZE,
+ NULL);
+
+ format = gdk_pixbuf_loader_get_format (pixbuf_loader);
+
+ if (format != NULL) {
+ GstCaps *caps;
+ gchar **p;
+ gchar **mlist = gdk_pixbuf_format_get_mime_types (format);
+
+ for (p = mlist; *p; ++p) {
+ GST_DEBUG ("suggesting mime type %s", *p);
+ caps = gst_caps_new_simple (*p, NULL);
+ gst_type_find_suggest (tf, GST_TYPE_FIND_MINIMUM, caps);
+ gst_caps_free (caps);
+ }
+ g_strfreev (mlist);
+ }
+
+ GST_DEBUG ("closing pixbuf loader, hope it doesn't hang ...");
+ /* librsvg 2.4.x has a bug where it triggers an endless loop in trying
+ to close a gzip that's not an svg; fixed upstream but no good way
+ to work around it */
+ gdk_pixbuf_loader_close (pixbuf_loader, NULL);
+ GST_DEBUG ("closed pixbuf loader");
+ g_object_unref (G_OBJECT (pixbuf_loader));
+}
+#endif
+
+/* entry point to initialize the plug-in
+ * initialize the plug-in itself
+ * register the element factories and pad templates
+ * register the features
+ */
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ GST_DEBUG_CATEGORY_INIT (gst_gdk_pixbuf_debug, "gdkpixbuf", 0,
+ "gdk pixbuf loader");
+
+ if (!gst_element_register (plugin, "gdkpixbufdec", GST_RANK_SECONDARY,
+ GST_TYPE_GDK_PIXBUF))
+ return FALSE;
+
+#ifdef enable_typefind
+ gst_type_find_register (plugin, "image/*", GST_RANK_MARGINAL,
+ gst_gdk_pixbuf_type_find, NULL, GST_CAPS_ANY, NULL);
+#endif
+
+ if (!gst_element_register (plugin, "gdkpixbufsink", GST_RANK_NONE,
+ GST_TYPE_GDK_PIXBUF_SINK))
+ return FALSE;
+
+ if (!pixbufscale_init (plugin))
+ return FALSE;
+
+ /* plugin initialisation succeeded */
+ return TRUE;
+}
+
+
+/* this is the structure that gst-register looks for
+ * so keep the name plugin_desc, or you cannot get your plug-in registered */
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "gdkpixbuf",
+ "GdkPixbuf-based image decoder, scaler and sink",
+ plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.h b/ext/gdk_pixbuf/gstgdkpixbuf.h
new file mode 100644
index 0000000..a4c6ee5
--- /dev/null
+++ b/ext/gdk_pixbuf/gstgdkpixbuf.h
@@ -0,0 +1,70 @@
+/* GStreamer GdkPixbuf-based image decoder
+ * Copyright (C) 1999-2001 Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) 2003 David A. Schleef <ds@schleef.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GST_GDK_PIXBUF_H__
+#define __GST_GDK_PIXBUF_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+/* #define's don't like whitespacey bits */
+#define GST_TYPE_GDK_PIXBUF \
+ (gst_gdk_pixbuf_get_type())
+#define GST_GDK_PIXBUF(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GDK_PIXBUF,GstGdkPixbuf))
+#define GST_GDK_PIXBUF_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GDK_PIXBUF,GstGdkPixbufClass))
+#define GST_IS_GDK_PIXBUF(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GDK_PIXBUF))
+#define GST_IS_GDK_PIXBUF_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GDK_PIXBUF))
+
+typedef struct _GstGdkPixbuf GstGdkPixbuf;
+typedef struct _GstGdkPixbufClass GstGdkPixbufClass;
+
+struct _GstGdkPixbuf
+{
+ GstElement element;
+
+ GstPad *sinkpad, *srcpad;
+
+ GstClockTime last_timestamp;
+ GdkPixbufLoader *pixbuf_loader;
+
+ int width;
+ int height;
+ int rowstride;
+ unsigned int image_size;
+
+ gint framerate_numerator;
+ gint framerate_denominator;
+};
+
+struct _GstGdkPixbufClass
+{
+ GstElementClass parent_class;
+};
+
+static GType gst_gdk_pixbuf_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_GDK_PIXBUF_H__ */
diff --git a/ext/gdk_pixbuf/gstgdkpixbufsink.c b/ext/gdk_pixbuf/gstgdkpixbufsink.c
new file mode 100644
index 0000000..2c2714e
--- /dev/null
+++ b/ext/gdk_pixbuf/gstgdkpixbufsink.c
@@ -0,0 +1,426 @@
+/* GStreamer GdkPixbuf sink
+ * Copyright (C) 2006-2008 Tim-Philipp Müller <tim centricular net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is free software; you can redistribute it and/or
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * SECTION:element-gdkpixbufsink
+ * @Since: 0.10.8
+ *
+ * This sink element takes RGB or RGBA images as input and wraps them into
+ * #GdkPixbuf objects, for easy saving to file via the
+ * GdkPixbuf library API or displaying in Gtk+ applications (e.g. using
+ * the #GtkImage widget).
+ *
+ * There are two ways to use this element and obtain the #GdkPixbuf objects
+ * created:
+ * <itemizedlist>
+ * <listitem>
+ * Watching for element messages named <classname>&quot;preroll-pixbuf&quot;
+ * </classname> or <classname>&quot;pixbuf&quot;</classname> on the bus, which
+ * will be posted whenever an image would usually be rendered. See below for
+ * more details on these messages and how to extract the pixbuf object
+ * contained in them.
+ * </listitem>
+ * <listitem>
+ * Retrieving the current pixbuf via the #GstGdkPixbufSink:last-pixbuf property
+ * when needed.
+ * </listitem>
+ * </itemizedlist>
+ *
+ * The primary purpose of this element is to abstract away the #GstBuffer to
+ * #GdkPixbuf conversion. Other than that it's very similar to the fakesink
+ * element.
+ *
+ * This element is meant for easy no-hassle video snapshotting. It is not
+ * suitable for video playback or video display at high framerates. Use
+ * ximagesink, xvimagesink or some other suitable video sink in connection
+ * with the #GstXOverlay interface instead if you want to do video playback.
+ *
+ * <refsect2>
+ * <title>Message details</title>
+ * As mentioned above, this element will by default post element messages
+ * containing structures named <classname>&quot;preroll-pixbuf&quot;
+ * </classname> or <classname>&quot;pixbuf&quot;</classname> on the bus (this
+ * can be disabled by setting the #GstGdkPixbufSink:post-messages property
+ * to #FALSE though). The element message structure has the following fields:
+ * <itemizedlist>
+ * <listitem>
+ * <classname>&quot;pixbuf&quot;</classname>: the #GdkPixbuf object
+ * </listitem>
+ * <listitem>
+ * <classname>&quot;pixel-aspect-ratio&quot;</classname>: the pixel aspect
+ * ratio (PAR) of the input image (this field contains a #GstFraction); the
+ * PAR is usually 1:1 for images, but is often something non-1:1 in the case
+ * of video input. In this case the image may be distorted and you may need
+ * to rescale it accordingly before saving it to file or displaying it. This
+ * can easily be done using gdk_pixbuf_scale() (the reason this is not done
+ * automatically is that the application will often scale the image anyway
+ * according to the size of the output window, in which case it is much more
+ * efficient to only scale once rather than twice). You can put a videoscale
+ * element and a capsfilter element with
+ * <literal>video/x-raw-rgb,pixel-aspect-ratio=(fraction)1/1</literal> caps
+ * in front of this element to make sure the pixbufs always have a 1:1 PAR.
+ * </listitem>
+ * </itemizedlist>
+ * </refsect2>
+ *
+ * <refsect2>
+ * <title>Example pipeline</title>
+ * |[
+ * gst-launch -m -v videotestsrc num-buffers=1 ! gdkpixbufsink
+ * ]| Process one single test image as pixbuf (note that the output you see will
+ * be slightly misleading. The message structure does contain a valid pixbuf
+ * object even if the structure string says &apos;(NULL)&apos;).
+ * </refsect2>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstgdkpixbufsink.h"
+
+#include <gst/video/video.h>
+
+#define DEFAULT_SEND_MESSAGES TRUE
+#define DEFAULT_POST_MESSAGES TRUE
+
+enum
+{
+ PROP_0,
+ PROP_SEND_MESSAGES,
+ PROP_POST_MESSAGES,
+ PROP_LAST_PIXBUF,
+ PROP_LAST
+};
+
+
+GST_BOILERPLATE (GstGdkPixbufSink, gst_gdk_pixbuf_sink, GstVideoSink,
+ GST_TYPE_VIDEO_SINK);
+
+static void gst_gdk_pixbuf_sink_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
+static void gst_gdk_pixbuf_sink_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec);
+
+static gboolean gst_gdk_pixbuf_sink_start (GstBaseSink * basesink);
+static gboolean gst_gdk_pixbuf_sink_stop (GstBaseSink * basesink);
+static gboolean gst_gdk_pixbuf_sink_set_caps (GstBaseSink * basesink,
+ GstCaps * caps);
+static GstFlowReturn gst_gdk_pixbuf_sink_render (GstBaseSink * bsink,
+ GstBuffer * buf);
+static GstFlowReturn gst_gdk_pixbuf_sink_preroll (GstBaseSink * bsink,
+ GstBuffer * buf);
+static GdkPixbuf *gst_gdk_pixbuf_sink_get_pixbuf_from_buffer (GstGdkPixbufSink *
+ sink, GstBuffer * buf);
+
+#define WxH ", width = (int) [ 16, 4096 ], height = (int) [ 16, 4096 ]"
+
+static GstStaticPadTemplate pixbufsink_sink_factory =
+ GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB WxH ";" GST_VIDEO_CAPS_RGBA WxH));
+
+static void
+gst_gdk_pixbuf_sink_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details_simple (element_class, "GdkPixbuf sink",
+ "Sink/Video", "Output images as GdkPixbuf objects in bus messages",
+ "Tim-Philipp Müller <tim centricular net>");
+
+ gst_element_class_add_static_pad_template (element_class,
+ &pixbufsink_sink_factory);
+}
+
+static void
+gst_gdk_pixbuf_sink_class_init (GstGdkPixbufSinkClass * klass)
+{
+ GstBaseSinkClass *basesink_class = GST_BASE_SINK_CLASS (klass);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->set_property = gst_gdk_pixbuf_sink_set_property;
+ gobject_class->get_property = gst_gdk_pixbuf_sink_get_property;
+
+ /* FIXME 0.11, remove in favour of post-messages */
+ g_object_class_install_property (gobject_class, PROP_SEND_MESSAGES,
+ g_param_spec_boolean ("send-messages", "Send Messages",
+ "Whether to post messages containing pixbufs on the bus "
+ " (deprecated, use post-messages)",
+ DEFAULT_SEND_MESSAGES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstGdkPixbuf:post-messages:
+ *
+ * Post messages on the bus containing pixbufs.
+ *
+ * Since: 0.10.17
+ */
+ g_object_class_install_property (gobject_class, PROP_POST_MESSAGES,
+ g_param_spec_boolean ("post-messages", "Post Messages",
+ "Whether to post messages containing pixbufs on the bus",
+ DEFAULT_POST_MESSAGES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, PROP_LAST_PIXBUF,
+ g_param_spec_object ("last-pixbuf", "Last Pixbuf",
+ "Last GdkPixbuf object rendered", GDK_TYPE_PIXBUF,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
+ basesink_class->start = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_start);
+ basesink_class->stop = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_stop);
+ basesink_class->render = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_render);
+ basesink_class->preroll = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_preroll);
+ basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_gdk_pixbuf_sink_set_caps);
+}
+
+static void
+gst_gdk_pixbuf_sink_init (GstGdkPixbufSink * sink,
+ GstGdkPixbufSinkClass * klass)
+{
+ sink->par_n = 0;
+ sink->par_d = 0;
+ sink->has_alpha = FALSE;
+ sink->last_pixbuf = NULL;
+ sink->post_messages = DEFAULT_POST_MESSAGES;
+
+ /* we're not a real video sink, we just derive from GstVideoSink in case
+ * anything interesting is added to it in future */
+ gst_base_sink_set_max_lateness (GST_BASE_SINK (sink), -1);
+ gst_base_sink_set_qos_enabled (GST_BASE_SINK (sink), FALSE);
+}
+
+
+static gboolean
+gst_gdk_pixbuf_sink_start (GstBaseSink * basesink)
+{
+ GST_LOG_OBJECT (basesink, "start");
+
+ return TRUE;
+}
+
+static gboolean
+gst_gdk_pixbuf_sink_stop (GstBaseSink * basesink)
+{
+ GstGdkPixbufSink *sink = GST_GDK_PIXBUF_SINK (basesink);
+
+ GST_VIDEO_SINK_WIDTH (sink) = 0;
+ GST_VIDEO_SINK_HEIGHT (sink) = 0;
+
+ sink->par_n = 0;
+ sink->par_d = 0;
+ sink->has_alpha = FALSE;
+
+ if (sink->last_pixbuf) {
+ g_object_unref (sink->last_pixbuf);
+ sink->last_pixbuf = NULL;
+ }
+
+ GST_LOG_OBJECT (sink, "stop");
+
+ return TRUE;
+}
+
+static gboolean
+gst_gdk_pixbuf_sink_set_caps (GstBaseSink * basesink, GstCaps * caps)
+{
+ GstGdkPixbufSink *sink = GST_GDK_PIXBUF_SINK (basesink);
+ GstVideoFormat fmt;
+ gint w, h, par_n, par_d;
+
+ GST_LOG_OBJECT (sink, "caps: %" GST_PTR_FORMAT, caps);
+
+ if (!gst_video_format_parse_caps (caps, &fmt, &w, &h)) {
+ GST_WARNING_OBJECT (sink, "parse_caps failed");
+ return FALSE;
+ }
+
+ if (!gst_video_parse_caps_pixel_aspect_ratio (caps, &par_n, &par_d)) {
+ GST_LOG_OBJECT (sink, "no pixel aspect ratio");
+ return FALSE;
+ }
+
+ g_assert ((fmt == GST_VIDEO_FORMAT_RGB &&
+ gst_video_format_get_pixel_stride (fmt, 0) == 3) ||
+ (fmt == GST_VIDEO_FORMAT_RGBA &&
+ gst_video_format_get_pixel_stride (fmt, 0) == 4));
+
+ GST_VIDEO_SINK_WIDTH (sink) = w;
+ GST_VIDEO_SINK_HEIGHT (sink) = h;
+
+ sink->rowstride = gst_video_format_get_row_stride (fmt, 0, w);
+ sink->has_alpha = (fmt == GST_VIDEO_FORMAT_RGBA);
+
+ sink->par_n = par_n;
+ sink->par_d = par_d;
+
+ GST_INFO_OBJECT (sink, "format : %d", fmt);
+ GST_INFO_OBJECT (sink, "width x height : %d x %d", w, h);
+ GST_INFO_OBJECT (sink, "pixel-aspect-ratio : %d/%d", par_n, par_d);
+
+ return TRUE;
+}
+
+static void
+gst_gdk_pixbuf_sink_pixbuf_destroy_notify (guchar * pixels, GstBuffer * buf)
+{
+ gst_buffer_unref (buf);
+}
+
+static GdkPixbuf *
+gst_gdk_pixbuf_sink_get_pixbuf_from_buffer (GstGdkPixbufSink * sink,
+ GstBuffer * buf)
+{
+ GdkPixbuf *pix = NULL;
+ gint minsize, bytes_per_pixel;
+
+ g_return_val_if_fail (GST_VIDEO_SINK_WIDTH (sink) > 0, NULL);
+ g_return_val_if_fail (GST_VIDEO_SINK_HEIGHT (sink) > 0, NULL);
+
+ bytes_per_pixel = (sink->has_alpha) ? 4 : 3;
+
+ /* last row needn't have row padding */
+ minsize = (sink->rowstride * (GST_VIDEO_SINK_HEIGHT (sink) - 1)) +
+ (bytes_per_pixel * GST_VIDEO_SINK_WIDTH (sink));
+
+ g_return_val_if_fail (GST_BUFFER_SIZE (buf) >= minsize, NULL);
+
+ pix = gdk_pixbuf_new_from_data (GST_BUFFER_DATA (buf),
+ GDK_COLORSPACE_RGB, sink->has_alpha, 8, GST_VIDEO_SINK_WIDTH (sink),
+ GST_VIDEO_SINK_HEIGHT (sink), sink->rowstride,
+ (GdkPixbufDestroyNotify) gst_gdk_pixbuf_sink_pixbuf_destroy_notify,
+ gst_buffer_ref (buf));
+
+ return pix;
+}
+
+static GstFlowReturn
+gst_gdk_pixbuf_sink_handle_buffer (GstBaseSink * basesink, GstBuffer * buf,
+ const gchar * msg_name)
+{
+ GstGdkPixbufSink *sink;
+ GdkPixbuf *pixbuf;
+ gboolean do_post;
+
+ sink = GST_GDK_PIXBUF_SINK (basesink);
+
+ pixbuf = gst_gdk_pixbuf_sink_get_pixbuf_from_buffer (sink, buf);
+
+ GST_OBJECT_LOCK (sink);
+
+ do_post = sink->post_messages;
+
+ if (sink->last_pixbuf)
+ g_object_unref (sink->last_pixbuf);
+
+ sink->last_pixbuf = pixbuf; /* take ownership */
+
+ GST_OBJECT_UNLOCK (sink);
+
+ if (G_UNLIKELY (pixbuf == NULL))
+ goto error;
+
+ if (do_post) {
+ GstStructure *s;
+ GstMessage *msg;
+
+ /* it's okay to keep using pixbuf here, we can be sure no one is going to
+ * unref or change sink->last_pixbuf before we return from this function.
+ * The structure will take its own ref to the pixbuf. */
+ s = gst_structure_new (msg_name,
+ "pixbuf", GDK_TYPE_PIXBUF, pixbuf,
+ "pixel-aspect-ratio", GST_TYPE_FRACTION, sink->par_n, sink->par_d,
+ NULL);
+
+ msg = gst_message_new_element (GST_OBJECT_CAST (sink), s);
+ gst_element_post_message (GST_ELEMENT_CAST (sink), msg);
+ }
+
+ g_object_notify (G_OBJECT (sink), "last-pixbuf");
+
+ return GST_FLOW_OK;
+
+/* ERRORS */
+error:
+ {
+ /* This shouldn't really happen */
+ GST_ELEMENT_ERROR (sink, LIBRARY, FAILED,
+ ("Couldn't create pixbuf from RGB image."),
+ ("Probably not enough free memory"));
+ return GST_FLOW_ERROR;
+ }
+}
+
+static GstFlowReturn
+gst_gdk_pixbuf_sink_preroll (GstBaseSink * basesink, GstBuffer * buf)
+{
+ return gst_gdk_pixbuf_sink_handle_buffer (basesink, buf, "preroll-pixbuf");
+}
+
+static GstFlowReturn
+gst_gdk_pixbuf_sink_render (GstBaseSink * basesink, GstBuffer * buf)
+{
+ return gst_gdk_pixbuf_sink_handle_buffer (basesink, buf, "pixbuf");
+}
+
+static void
+gst_gdk_pixbuf_sink_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
+{
+ GstGdkPixbufSink *sink;
+
+ sink = GST_GDK_PIXBUF_SINK (object);
+
+ switch (prop_id) {
+ case PROP_SEND_MESSAGES:
+ case PROP_POST_MESSAGES:
+ GST_OBJECT_LOCK (sink);
+ sink->post_messages = g_value_get_boolean (value);
+ GST_OBJECT_UNLOCK (sink);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_gdk_pixbuf_sink_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec)
+{
+ GstGdkPixbufSink *sink;
+
+ sink = GST_GDK_PIXBUF_SINK (object);
+
+ switch (prop_id) {
+ case PROP_SEND_MESSAGES:
+ case PROP_POST_MESSAGES:
+ GST_OBJECT_LOCK (sink);
+ g_value_set_boolean (value, sink->post_messages);
+ GST_OBJECT_UNLOCK (sink);
+ break;
+ case PROP_LAST_PIXBUF:
+ GST_OBJECT_LOCK (sink);
+ g_value_set_object (value, sink->last_pixbuf);
+ GST_OBJECT_UNLOCK (sink);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
diff --git a/ext/gdk_pixbuf/gstgdkpixbufsink.h b/ext/gdk_pixbuf/gstgdkpixbufsink.h
new file mode 100644
index 0000000..b0eff5e
--- /dev/null
+++ b/ext/gdk_pixbuf/gstgdkpixbufsink.h
@@ -0,0 +1,75 @@
+/* GStreamer GdkPixbuf sink
+ * Copyright (C) 2006-2008 Tim-Philipp Müller <tim centricular net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef GST_GDK_PIXBUF_SINK_H
+#define GST_GDK_PIXBUF_SINK_H
+
+#include <gst/gst.h>
+
+#include <gst/video/gstvideosink.h>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+#define GST_TYPE_GDK_PIXBUF_SINK (gst_gdk_pixbuf_sink_get_type())
+#define GST_GDK_PIXBUF_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GDK_PIXBUF_SINK,GstGdkPixbufSink))
+#define GST_GDK_PIXBUF_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GDK_PIXBUF_SINK,GstGdkPixbufSinkClass))
+#define GST_IS_GDK_PIXBUF_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GDK_PIXBUF_SINK))
+#define GST_IS_GDK_PIXBUF_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GDK_PIXBUF_SINK))
+
+typedef struct _GstGdkPixbufSink GstGdkPixbufSink;
+typedef struct _GstGdkPixbufSinkClass GstGdkPixbufSinkClass;
+
+/**
+ * GstGdkPixbufSink:
+ *
+ * Opaque element structure.
+ */
+struct _GstGdkPixbufSink
+{
+ GstVideoSink basesink;
+
+ /*< private >*/
+
+ /* current caps */
+ gint width;
+ gint height;
+ gint rowstride;
+ gint par_n;
+ gint par_d;
+ gboolean has_alpha;
+
+ /* properties */
+ gboolean post_messages;
+ GdkPixbuf * last_pixbuf;
+};
+
+/**
+ * GstGdkPixbufSinkClass:
+ *
+ * Opaque element class structure.
+ */
+struct _GstGdkPixbufSinkClass
+{
+ GstVideoSinkClass basesinkclass;
+};
+
+GType gst_gdk_pixbuf_sink_get_type (void);
+
+#endif /* GST_GDK_PIXBUF_SINK_H */
+
diff --git a/ext/gdk_pixbuf/pixbufscale.c b/ext/gdk_pixbuf/pixbufscale.c
new file mode 100644
index 0000000..ba98f62
--- /dev/null
+++ b/ext/gdk_pixbuf/pixbufscale.c
@@ -0,0 +1,483 @@
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) <2004> Jan Schmidt <thaytan@mad.scientist.com>
+ * Copyright (C) <2004> Tim-Philipp Mueller <t.i.m@orange.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <pixbufscale.h>
+#include <gst/video/video.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+#define ROUND_UP_2(x) (((x)+1)&~1)
+#define ROUND_UP_4(x) (((x)+3)&~3)
+#define ROUND_UP_8(x) (((x)+7)&~7)
+
+/* These match the ones gstffmpegcolorspace uses (Tim) */
+#define GST_RGB24_ROWSTRIDE(width) (ROUND_UP_4 ((width)*3))
+#define GST_RGB24_SIZE(width,height) ((height)*GST_RGB24_ROWSTRIDE(width))
+
+
+GST_DEBUG_CATEGORY_STATIC (pixbufscale_debug);
+#define GST_CAT_DEFAULT pixbufscale_debug
+
+/* GstPixbufScale signals and args */
+enum
+{
+ /* FILL ME */
+ LAST_SIGNAL
+};
+
+enum
+{
+ ARG_0,
+ ARG_METHOD
+ /* FILL ME */
+};
+
+static GstStaticPadTemplate gst_pixbufscale_src_template =
+GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB)
+ );
+
+static GstStaticPadTemplate gst_pixbufscale_sink_template =
+GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB)
+ );
+
+#define GST_TYPE_PIXBUFSCALE_METHOD (gst_pixbufscale_method_get_type())
+static GType
+gst_pixbufscale_method_get_type (void)
+{
+ static GType pixbufscale_method_type = 0;
+ static const GEnumValue pixbufscale_methods[] = {
+ {GST_PIXBUFSCALE_NEAREST, "0", "Nearest Neighbour"},
+ {GST_PIXBUFSCALE_TILES, "1", "Tiles"},
+ {GST_PIXBUFSCALE_BILINEAR, "2", "Bilinear"},
+ {GST_PIXBUFSCALE_HYPER, "3", "Hyper"},
+ {0, NULL, NULL},
+ };
+
+ if (!pixbufscale_method_type) {
+ pixbufscale_method_type =
+ g_enum_register_static ("GstPixbufScaleMethod", pixbufscale_methods);
+ }
+ return pixbufscale_method_type;
+}
+
+static void gst_pixbufscale_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
+static void gst_pixbufscale_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec);
+
+static GstCaps *gst_pixbufscale_transform_caps (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps);
+static gboolean gst_pixbufscale_set_caps (GstBaseTransform * trans,
+ GstCaps * in, GstCaps * out);
+static gboolean gst_pixbufscale_get_unit_size (GstBaseTransform * trans,
+ GstCaps * caps, guint * size);
+static void gst_pixbufscale_fixate_caps (GstBaseTransform * base,
+ GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
+static GstFlowReturn gst_pixbufscale_transform (GstBaseTransform * trans,
+ GstBuffer * in, GstBuffer * out);
+static gboolean gst_pixbufscale_handle_src_event (GstPad * pad,
+ GstEvent * event);
+
+
+static gboolean parse_caps (GstCaps * caps, gint * width, gint * height);
+
+GST_BOILERPLATE (GstPixbufScale, gst_pixbufscale, GstBaseTransform,
+ GST_TYPE_BASE_TRANSFORM);
+
+static void
+gst_pixbufscale_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details_simple (element_class, "GdkPixbuf image scaler",
+ "Filter/Effect/Video", "Resizes video",
+ "Jan Schmidt <thaytan@mad.scientist.com>, "
+ "Wim Taymans <wim.taymans@chello.be>, "
+ "Renato Filho <renato.filho@indt.org.br>");
+
+ gst_element_class_add_static_pad_template (element_class,
+ &gst_pixbufscale_src_template);
+ gst_element_class_add_static_pad_template (element_class,
+ &gst_pixbufscale_sink_template);
+}
+
+static void
+gst_pixbufscale_class_init (GstPixbufScaleClass * klass)
+{
+ GObjectClass *gobject_class;
+ GstBaseTransformClass *trans_class;
+
+ gobject_class = (GObjectClass *) klass;
+ trans_class = (GstBaseTransformClass *) klass;
+
+ gobject_class->set_property = gst_pixbufscale_set_property;
+ gobject_class->get_property = gst_pixbufscale_get_property;
+
+ g_object_class_install_property (gobject_class,
+ ARG_METHOD,
+ g_param_spec_enum ("method", "method", "method",
+ GST_TYPE_PIXBUFSCALE_METHOD, GST_PIXBUFSCALE_BILINEAR,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ trans_class->transform_caps =
+ GST_DEBUG_FUNCPTR (gst_pixbufscale_transform_caps);
+ trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_pixbufscale_set_caps);
+ trans_class->get_unit_size =
+ GST_DEBUG_FUNCPTR (gst_pixbufscale_get_unit_size);
+ trans_class->transform = GST_DEBUG_FUNCPTR (gst_pixbufscale_transform);
+ trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_pixbufscale_fixate_caps);
+ trans_class->passthrough_on_same_caps = TRUE;
+
+ parent_class = g_type_class_peek_parent (klass);
+}
+
+static void
+gst_pixbufscale_init (GstPixbufScale * pixbufscale,
+ GstPixbufScaleClass * kclass)
+{
+ GstBaseTransform *trans;
+
+ GST_DEBUG_OBJECT (pixbufscale, "_init");
+ trans = GST_BASE_TRANSFORM (pixbufscale);
+
+ gst_pad_set_event_function (trans->srcpad, gst_pixbufscale_handle_src_event);
+
+ pixbufscale->method = GST_PIXBUFSCALE_TILES;
+ pixbufscale->gdk_method = GDK_INTERP_TILES;
+}
+
+static void
+gst_pixbufscale_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
+{
+ GstPixbufScale *src;
+
+ g_return_if_fail (GST_IS_PIXBUFSCALE (object));
+ src = GST_PIXBUFSCALE (object);
+
+ switch (prop_id) {
+ case ARG_METHOD:
+ src->method = g_value_get_enum (value);
+ switch (src->method) {
+ case GST_PIXBUFSCALE_NEAREST:
+ src->gdk_method = GDK_INTERP_NEAREST;
+ break;
+ case GST_PIXBUFSCALE_TILES:
+ src->gdk_method = GDK_INTERP_TILES;
+ break;
+ case GST_PIXBUFSCALE_BILINEAR:
+ src->gdk_method = GDK_INTERP_BILINEAR;
+ break;
+ case GST_PIXBUFSCALE_HYPER:
+ src->gdk_method = GDK_INTERP_HYPER;
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static void
+gst_pixbufscale_get_property (GObject * object, guint prop_id, GValue * value,
+ GParamSpec * pspec)
+{
+ GstPixbufScale *src;
+
+ g_return_if_fail (GST_IS_PIXBUFSCALE (object));
+ src = GST_PIXBUFSCALE (object);
+
+ switch (prop_id) {
+ case ARG_METHOD:
+ g_value_set_enum (value, src->method);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static GstCaps *
+gst_pixbufscale_transform_caps (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps)
+{
+ GstCaps *ret;
+ int i;
+
+ ret = gst_caps_copy (caps);
+
+ for (i = 0; i < gst_caps_get_size (ret); i++) {
+ GstStructure *structure = gst_caps_get_structure (ret, i);
+
+ gst_structure_set (structure,
+ "width", GST_TYPE_INT_RANGE, 16, 4096,
+ "height", GST_TYPE_INT_RANGE, 16, 4096, NULL);
+ gst_structure_remove_field (structure, "pixel-aspect-ratio");
+ }
+
+ GST_DEBUG_OBJECT (trans, "returning caps: %" GST_PTR_FORMAT, ret);
+ return ret;
+}
+
+static gboolean
+parse_caps (GstCaps * caps, gint * width, gint * height)
+{
+ gboolean ret;
+ GstStructure *structure;
+
+ structure = gst_caps_get_structure (caps, 0);
+ ret = gst_structure_get_int (structure, "width", width);
+ ret &= gst_structure_get_int (structure, "height", height);
+
+ return ret;
+}
+
+static gboolean
+gst_pixbufscale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
+{
+ GstPixbufScale *pixbufscale;
+ gboolean ret;
+
+ pixbufscale = GST_PIXBUFSCALE (trans);
+ ret = parse_caps (in, &pixbufscale->from_width, &pixbufscale->from_height);
+ ret &= parse_caps (out, &pixbufscale->to_width, &pixbufscale->to_height);
+ if (!ret)
+ goto done;
+
+ pixbufscale->from_stride = GST_ROUND_UP_4 (pixbufscale->from_width * 3);
+ pixbufscale->from_buf_size =
+ pixbufscale->from_stride * pixbufscale->from_height;
+
+ pixbufscale->to_stride = GST_ROUND_UP_4 (pixbufscale->to_width * 3);
+ pixbufscale->to_buf_size = pixbufscale->to_stride * pixbufscale->to_height;
+
+ GST_DEBUG_OBJECT (pixbufscale, "from=%dx%d, size %d -> to=%dx%d, size %d",
+ pixbufscale->from_width, pixbufscale->from_height,
+ pixbufscale->from_buf_size, pixbufscale->to_width, pixbufscale->to_height,
+ pixbufscale->to_buf_size);
+
+done:
+ return ret;
+}
+
+
+static gboolean
+gst_pixbufscale_get_unit_size (GstBaseTransform * trans,
+ GstCaps * caps, guint * size)
+{
+ gint width, height;
+
+ g_assert (size);
+
+ if (!parse_caps (caps, &width, &height))
+ return FALSE;
+
+ *size = GST_ROUND_UP_4 (width * 3) * height;
+
+ return TRUE;
+}
+
+static void
+gst_pixbufscale_fixate_caps (GstBaseTransform * base, GstPadDirection direction,
+ GstCaps * caps, GstCaps * othercaps)
+{
+ GstStructure *ins, *outs;
+ const GValue *from_par, *to_par;
+
+ g_return_if_fail (gst_caps_is_fixed (caps));
+
+ GST_DEBUG_OBJECT (base, "trying to fixate othercaps %" GST_PTR_FORMAT
+ " based on caps %" GST_PTR_FORMAT, othercaps, caps);
+
+ ins = gst_caps_get_structure (caps, 0);
+ outs = gst_caps_get_structure (othercaps, 0);
+
+ from_par = gst_structure_get_value (ins, "pixel-aspect-ratio");
+ to_par = gst_structure_get_value (outs, "pixel-aspect-ratio");
+
+ if (from_par && to_par) {
+ GValue to_ratio = { 0, }; /* w/h of output video */
+ int from_w, from_h, from_par_n, from_par_d, to_par_n, to_par_d;
+ int count = 0, w = 0, h = 0, num, den;
+
+ /* if both width and height are already fixed, we can't do anything
+ * * about it anymore */
+ if (gst_structure_get_int (outs, "width", &w))
+ ++count;
+ if (gst_structure_get_int (outs, "height", &h))
+ ++count;
+ if (count == 2) {
+ GST_DEBUG_OBJECT (base, "dimensions already set to %dx%d, not fixating",
+ w, h);
+ return;
+ }
+
+ gst_structure_get_int (ins, "width", &from_w);
+ gst_structure_get_int (ins, "height", &from_h);
+ from_par_n = gst_value_get_fraction_numerator (from_par);
+ from_par_d = gst_value_get_fraction_denominator (from_par);
+ to_par_n = gst_value_get_fraction_numerator (to_par);
+ to_par_d = gst_value_get_fraction_denominator (to_par);
+
+ g_value_init (&to_ratio, GST_TYPE_FRACTION);
+ gst_value_set_fraction (&to_ratio, from_w * from_par_n * to_par_d,
+ from_h * from_par_d * to_par_n);
+ num = gst_value_get_fraction_numerator (&to_ratio);
+ den = gst_value_get_fraction_denominator (&to_ratio);
+ GST_DEBUG_OBJECT (base,
+ "scaling input with %dx%d and PAR %d/%d to output PAR %d/%d",
+ from_w, from_h, from_par_n, from_par_d, to_par_n, to_par_d);
+ GST_DEBUG_OBJECT (base,
+ "resulting output should respect ratio of %d/%d", num, den);
+
+ /* now find a width x height that respects this display ratio.
+ * * prefer those that have one of w/h the same as the incoming video
+ * * using wd / hd = num / den */
+
+ /* start with same height, because of interlaced video */
+ /* check hd / den is an integer scale factor, and scale wd with the PAR */
+ if (from_h % den == 0) {
+ GST_DEBUG_OBJECT (base, "keeping video height");
+ h = from_h;
+ w = h * num / den;
+ } else if (from_w % num == 0) {
+ GST_DEBUG_OBJECT (base, "keeping video width");
+ w = from_w;
+ h = w * den / num;
+ } else {
+ GST_DEBUG_OBJECT (base, "approximating but keeping video height");
+ h = from_h;
+ w = h * num / den;
+ }
+ GST_DEBUG_OBJECT (base, "scaling to %dx%d", w, h);
+ /* now fixate */
+ gst_structure_fixate_field_nearest_int (outs, "width", w);
+ gst_structure_fixate_field_nearest_int (outs, "height", h);
+ } else {
+ gint width, height;
+
+ if (gst_structure_get_int (ins, "width", &width)) {
+ if (gst_structure_has_field (outs, "width")) {
+ gst_structure_fixate_field_nearest_int (outs, "width", width);
+ }
+ }
+ if (gst_structure_get_int (ins, "height", &height)) {
+ if (gst_structure_has_field (outs, "height")) {
+ gst_structure_fixate_field_nearest_int (outs, "height", height);
+ }
+ }
+ }
+
+ GST_DEBUG_OBJECT (base, "fixated othercaps to %" GST_PTR_FORMAT, othercaps);
+}
+
+static GstFlowReturn
+gst_pixbufscale_transform (GstBaseTransform * trans,
+ GstBuffer * in, GstBuffer * out)
+{
+ GstPixbufScale *scale;
+ GdkPixbuf *src_pixbuf, *dest_pixbuf;
+
+ scale = GST_PIXBUFSCALE (trans);
+
+ src_pixbuf =
+ gdk_pixbuf_new_from_data (GST_BUFFER_DATA (in), GDK_COLORSPACE_RGB, FALSE,
+ 8, scale->from_width, scale->from_height,
+ GST_RGB24_ROWSTRIDE (scale->from_width), NULL, NULL);
+
+ dest_pixbuf =
+ gdk_pixbuf_new_from_data (GST_BUFFER_DATA (out), GDK_COLORSPACE_RGB,
+ FALSE, 8, scale->to_width, scale->to_height,
+ GST_RGB24_ROWSTRIDE (scale->to_width), NULL, NULL);
+
+ gdk_pixbuf_scale (src_pixbuf, dest_pixbuf, 0, 0,
+ scale->to_width,
+ scale->to_height, 0, 0,
+ (double) scale->to_width / scale->from_width,
+ (double) scale->to_height / scale->from_height, scale->gdk_method);
+
+ g_object_unref (src_pixbuf);
+ g_object_unref (dest_pixbuf);
+
+ return GST_FLOW_OK;
+}
+
+static gboolean
+gst_pixbufscale_handle_src_event (GstPad * pad, GstEvent * event)
+{
+ GstPixbufScale *pixbufscale;
+ gboolean ret;
+ double a;
+ GstStructure *structure;
+
+ pixbufscale = GST_PIXBUFSCALE (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT (pixbufscale, "handling %s event",
+ GST_EVENT_TYPE_NAME (event));
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_NAVIGATION:
+ event =
+ GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
+
+ structure = (GstStructure *) gst_event_get_structure (event);
+ if (gst_structure_get_double (structure, "pointer_x", &a)) {
+ gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
+ a * pixbufscale->from_width / pixbufscale->to_width, NULL);
+ }
+ if (gst_structure_get_double (structure, "pointer_y", &a)) {
+ gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
+ a * pixbufscale->from_height / pixbufscale->to_height, NULL);
+ }
+ break;
+ default:
+ break;
+ }
+
+ ret = gst_pad_event_default (pad, event);
+
+ gst_object_unref (pixbufscale);
+
+ return ret;
+}
+
+gboolean
+pixbufscale_init (GstPlugin * plugin)
+{
+ if (!gst_element_register (plugin, "gdkpixbufscale", GST_RANK_NONE,
+ GST_TYPE_PIXBUFSCALE))
+ return FALSE;
+
+ GST_DEBUG_CATEGORY_INIT (pixbufscale_debug, "gdkpixbufscale", 0,
+ "pixbufscale element");
+
+ return TRUE;
+}
diff --git a/ext/gdk_pixbuf/pixbufscale.h b/ext/gdk_pixbuf/pixbufscale.h
new file mode 100644
index 0000000..3e40477
--- /dev/null
+++ b/ext/gdk_pixbuf/pixbufscale.h
@@ -0,0 +1,84 @@
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) <2004> Jan Schmidt <thaytan@mad.scientist.com>
+ * Copyright (C) <2004> Tim-Philipp Mueller <t.i.m@orange.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#ifndef __GST_PIXBUFSCALE_H__
+#define __GST_PIXBUFSCALE_H__
+
+#include <gst/gst.h>
+#include <gst/base/gstbasetransform.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_PIXBUFSCALE \
+ (gst_pixbufscale_get_type())
+#define GST_PIXBUFSCALE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PIXBUFSCALE,GstPixbufScale))
+#define GST_PIXBUFSCALE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PIXBUFSCALE,GstPixbufScaleClass))
+#define GST_IS_PIXBUFSCALE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PIXBUFSCALE))
+#define GST_IS_PIXBUFSCALE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PIXBUFSCALE))
+
+typedef enum {
+ GST_PIXBUFSCALE_NEAREST,
+ GST_PIXBUFSCALE_TILES,
+ GST_PIXBUFSCALE_BILINEAR,
+ GST_PIXBUFSCALE_HYPER
+} GstPixbufScaleMethod;
+
+
+typedef struct _GstPixbufScale GstPixbufScale;
+typedef struct _GstPixbufScaleClass GstPixbufScaleClass;
+
+struct _GstPixbufScale {
+ GstBaseTransform element;
+
+ /* video state */
+ gint to_width;
+ gint to_height;
+ gint from_width;
+ gint from_height;
+ gboolean passthru;
+
+ GstPixbufScaleMethod method;
+ GdkInterpType gdk_method;
+
+ /* private */
+ gint from_buf_size;
+ gint from_stride;
+ gint to_buf_size;
+ gint to_stride;
+};
+
+struct _GstPixbufScaleClass {
+ GstBaseTransformClass parent_class;
+};
+
+GType gst_pixbufscale_get_type(void);
+
+gboolean pixbufscale_init (GstPlugin * plugin);
+
+G_END_DECLS
+
+#endif /* __GST_PIXBUFSCALE_H__ */