[meego-commits] 14737: Changes to devel:multimedia/gst-plugins-bad-free

Yan Yin no_reply at build.meego.com
Mon Mar 14 07:33:04 UTC 2011


Hi,
I have made the following changes to gst-plugins-bad-free in project devel:multimedia. Please review and accept ASAP.

Thank You,
Yan Yin

[This message was auto-generated]

---

Request #14737:

  submit:   home:yyin2:branches:devel:multimedia/gst-plugins-bad-free(r2)(cleanup) -> devel:multimedia/gst-plugins-bad-free


Message:
    Add shm plugins (BMC #14399)

State:   new          2011-03-14T00:32:53 yyin2
Comment: None



changes files:
--------------
--- gst-plugins-bad-free.changes
+++ gst-plugins-bad-free.changes
@@ -0,0 +1,4 @@
+* Mon Mar 14 2011 Yan Yin <yan.yin at intel.com> - 0.10.21
+- Add shm plugins (BMC #14399)
+- Change /bin/sh to /bin/bash in gst-p-bad-cleanup.sh due to pushd is not supported by Ubuntu default dash shell
+

spec files:
-----------
--- gst-plugins-bad-free.spec
+++ gst-plugins-bad-free.spec
@@ -202,6 +202,7 @@
 %{_libdir}/gstreamer-0.10/libgstrawparse.so
 %{_libdir}/gstreamer-0.10/libgstqtmux.so
 %{_libdir}/gstreamer-0.10/libgstaudioparsersbad.so
+%{_libdir}/gstreamer-0.10/libgstshm.so
 #debugging plugin
 %{_libdir}/gstreamer-0.10/libgstdebugutilsbad.so
 # << files

other changes:
--------------

++++++ gst-p-bad-cleanup.sh
--- gst-p-bad-cleanup.sh
+++ gst-p-bad-cleanup.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # This is a script to remove unwanted elements from a gst-plugins-bad tarball.
 # To keep one element not removed, just append its name to ALLOWED.
@@ -31,6 +31,7 @@
 metadata
 timidity
 audioparsers
+shm
 "
 
 error()

++++++ gst-plugins-bad-free-0.10.21.tar.bz2
--- autom4te.cache/output.0
+++ autom4te.cache/output.0
@@ -53962,7 +53962,7 @@
 
 
 
-ac_config_files="$ac_config_files Makefile common/Makefile common/m4/Makefile gst-plugins-bad.spec gst/Makefile gst/audioparsers/Makefile gst/autoconvert/Makefile gst/camerabin/Makefile gst/camerabin2/Makefile gst/debugutils/Makefile gst/dtmf/Makefile gst/h264parse/Makefile gst/jpegformat/Makefile gst/liveadder/Makefile gst/qtmux/Makefile gst/rawparse/Makefile gst/rtpmux/Makefile gst/sdp/Makefile gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/basecamerabinsrc/Makefile gst-libs/gst/interfaces/Makefile gst-libs/gst/signalprocessor/Makefile gst-libs/gst/video/Makefile sys/Makefile tests/Makefile tests/check/Makefile tests/files/Makefile tests/examples/Makefile tests/examples/camerabin/Makefile tests/examples/camerabin2/Makefile tests/examples/directfb/Makefile tests/examples/mxf/Makefile tests/examples/scaletempo/Makefile tests/icles/Makefile ext/Makefile ext/timidity/Makefile po/Makefile.in docs/Makefile docs/plugins/Makefile docs/version.entities pkgconfig/Makefile pkgc
 onfig/gstreamer-plugins-bad.pc pkgconfig/gstreamer-plugins-bad-uninstalled.pc tools/Makefile m4/Makefile win32/common/config.h"
+ac_config_files="$ac_config_files Makefile common/Makefile common/m4/Makefile gst-plugins-bad.spec gst/Makefile gst/audioparsers/Makefile gst/autoconvert/Makefile gst/camerabin/Makefile gst/camerabin2/Makefile gst/debugutils/Makefile gst/dtmf/Makefile gst/h264parse/Makefile gst/jpegformat/Makefile gst/liveadder/Makefile gst/qtmux/Makefile gst/rawparse/Makefile gst/rtpmux/Makefile gst/sdp/Makefile gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/basecamerabinsrc/Makefile gst-libs/gst/interfaces/Makefile gst-libs/gst/signalprocessor/Makefile gst-libs/gst/video/Makefile sys/Makefile sys/shm/Makefile tests/Makefile tests/check/Makefile tests/files/Makefile tests/examples/Makefile tests/examples/camerabin/Makefile tests/examples/camerabin2/Makefile tests/examples/directfb/Makefile tests/examples/mxf/Makefile tests/examples/scaletempo/Makefile tests/icles/Makefile ext/Makefile ext/timidity/Makefile po/Makefile.in docs/Makefile docs/plugins/Makefile docs/version.entities pkgcon
 fig/Makefile pkgconfig/gstreamer-plugins-bad.pc pkgconfig/gstreamer-plugins-bad-uninstalled.pc tools/Makefile m4/Makefile win32/common/config.h"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -56218,6 +56218,7 @@
     "gst-libs/gst/signalprocessor/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/signalprocessor/Makefile" ;;
     "gst-libs/gst/video/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/video/Makefile" ;;
     "sys/Makefile") CONFIG_FILES="$CONFIG_FILES sys/Makefile" ;;
+    "sys/shm/Makefile") CONFIG_FILES="$CONFIG_FILES sys/shm/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "tests/check/Makefile") CONFIG_FILES="$CONFIG_FILES tests/check/Makefile" ;;
     "tests/files/Makefile") CONFIG_FILES="$CONFIG_FILES tests/files/Makefile" ;;
--- autom4te.cache/output.1
+++ autom4te.cache/output.1
@@ -53962,7 +53962,7 @@
 
 
 
-ac_config_files="$ac_config_files Makefile common/Makefile common/m4/Makefile gst-plugins-bad.spec gst/Makefile gst/audioparsers/Makefile gst/autoconvert/Makefile gst/camerabin/Makefile gst/camerabin2/Makefile gst/debugutils/Makefile gst/dtmf/Makefile gst/h264parse/Makefile gst/jpegformat/Makefile gst/liveadder/Makefile gst/qtmux/Makefile gst/rawparse/Makefile gst/rtpmux/Makefile gst/sdp/Makefile gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/basecamerabinsrc/Makefile gst-libs/gst/interfaces/Makefile gst-libs/gst/signalprocessor/Makefile gst-libs/gst/video/Makefile sys/Makefile tests/Makefile tests/check/Makefile tests/files/Makefile tests/examples/Makefile tests/examples/camerabin/Makefile tests/examples/camerabin2/Makefile tests/examples/directfb/Makefile tests/examples/mxf/Makefile tests/examples/scaletempo/Makefile tests/icles/Makefile ext/Makefile ext/timidity/Makefile po/Makefile.in docs/Makefile docs/plugins/Makefile docs/version.entities pkgconfig/Makefile pkgc
 onfig/gstreamer-plugins-bad.pc pkgconfig/gstreamer-plugins-bad-uninstalled.pc tools/Makefile m4/Makefile win32/common/config.h"
+ac_config_files="$ac_config_files Makefile common/Makefile common/m4/Makefile gst-plugins-bad.spec gst/Makefile gst/audioparsers/Makefile gst/autoconvert/Makefile gst/camerabin/Makefile gst/camerabin2/Makefile gst/debugutils/Makefile gst/dtmf/Makefile gst/h264parse/Makefile gst/jpegformat/Makefile gst/liveadder/Makefile gst/qtmux/Makefile gst/rawparse/Makefile gst/rtpmux/Makefile gst/sdp/Makefile gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/basecamerabinsrc/Makefile gst-libs/gst/interfaces/Makefile gst-libs/gst/signalprocessor/Makefile gst-libs/gst/video/Makefile sys/Makefile sys/shm/Makefile tests/Makefile tests/check/Makefile tests/files/Makefile tests/examples/Makefile tests/examples/camerabin/Makefile tests/examples/camerabin2/Makefile tests/examples/directfb/Makefile tests/examples/mxf/Makefile tests/examples/scaletempo/Makefile tests/icles/Makefile ext/Makefile ext/timidity/Makefile po/Makefile.in docs/Makefile docs/plugins/Makefile docs/version.entities pkgcon
 fig/Makefile pkgconfig/gstreamer-plugins-bad.pc pkgconfig/gstreamer-plugins-bad-uninstalled.pc tools/Makefile m4/Makefile win32/common/config.h"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -56218,6 +56218,7 @@
     "gst-libs/gst/signalprocessor/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/signalprocessor/Makefile" ;;
     "gst-libs/gst/video/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/video/Makefile" ;;
     "sys/Makefile") CONFIG_FILES="$CONFIG_FILES sys/Makefile" ;;
+    "sys/shm/Makefile") CONFIG_FILES="$CONFIG_FILES sys/shm/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "tests/check/Makefile") CONFIG_FILES="$CONFIG_FILES tests/check/Makefile" ;;
     "tests/files/Makefile") CONFIG_FILES="$CONFIG_FILES tests/files/Makefile" ;;
--- autom4te.cache/traces.0
+++ autom4te.cache/traces.0
@@ -11901,15 +11901,15 @@
 m4trace:configure.ac:1635: -1- m4_pattern_allow([^GST_PLUGINS_BAD_CXXFLAGS$])
 m4trace:configure.ac:1640: -1- m4_pattern_allow([^GST_ALL_LDFLAGS$])
 m4trace:configure.ac:1645: -1- m4_pattern_allow([^GST_PLUGIN_LDFLAGS$])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^LIB@&t at OBJS$])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.ac:1700: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
-m4trace:configure.ac:1700: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
-m4trace:configure.ac:1700: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
-m4trace:configure.ac:1700: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
-m4trace:configure.ac:1700: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
-m4trace:configure.ac:1700: -1- _LT_PROG_LTMAIN
-m4trace:configure.ac:1702: -1- AG_GST_OUTPUT_PLUGINS
-m4trace:configure.ac:1703: -1- ORC_OUTPUT
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^LIB@&t at OBJS$])
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:1701: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
+m4trace:configure.ac:1701: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
+m4trace:configure.ac:1701: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
+m4trace:configure.ac:1701: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
+m4trace:configure.ac:1701: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS
+m4trace:configure.ac:1701: -1- _LT_PROG_LTMAIN
+m4trace:configure.ac:1703: -1- AG_GST_OUTPUT_PLUGINS
+m4trace:configure.ac:1704: -1- ORC_OUTPUT
--- autom4te.cache/traces.1
+++ autom4te.cache/traces.1
@@ -4466,6 +4466,7 @@
 gst-libs/gst/signalprocessor/Makefile
 gst-libs/gst/video/Makefile
 sys/Makefile
+sys/shm/Makefile
 tests/Makefile
 tests/check/Makefile
 tests/files/Makefile
@@ -4489,30 +4490,30 @@
 m4/Makefile
 win32/common/config.h
 ])
-m4trace:configure.ac:1700: -1- AC_SUBST([LIB@&t at OBJS], [$ac_libobjs])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([LIB@&t at OBJS])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^LIB@&t at OBJS$])
-m4trace:configure.ac:1700: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([LTLIBOBJS])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.ac:1700: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
-m4trace:configure.ac:1700: -1- AC_SUBST([am__EXEEXT_TRUE])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
-m4trace:configure.ac:1700: -1- AC_SUBST([am__EXEEXT_FALSE])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
-m4trace:configure.ac:1700: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
-m4trace:configure.ac:1700: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
-m4trace:configure.ac:1700: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([top_builddir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([top_build_prefix])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([srcdir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([abs_srcdir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([top_srcdir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([abs_top_srcdir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([builddir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([abs_builddir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([abs_top_builddir])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([INSTALL])
-m4trace:configure.ac:1700: -1- AC_SUBST_TRACE([MKDIR_P])
-m4trace:configure.ac:1700: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
+m4trace:configure.ac:1701: -1- AC_SUBST([LIB@&t at OBJS], [$ac_libobjs])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([LIB@&t at OBJS])
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^LIB@&t at OBJS$])
+m4trace:configure.ac:1701: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([LTLIBOBJS])
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^LTLIBOBJS$])
+m4trace:configure.ac:1701: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
+m4trace:configure.ac:1701: -1- AC_SUBST([am__EXEEXT_TRUE])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
+m4trace:configure.ac:1701: -1- AC_SUBST([am__EXEEXT_FALSE])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
+m4trace:configure.ac:1701: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
+m4trace:configure.ac:1701: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
+m4trace:configure.ac:1701: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([top_builddir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([top_build_prefix])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([srcdir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([abs_srcdir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([top_srcdir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([abs_top_srcdir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([builddir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([abs_builddir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([abs_top_builddir])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([INSTALL])
+m4trace:configure.ac:1701: -1- AC_SUBST_TRACE([MKDIR_P])
+m4trace:configure.ac:1701: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
--- configure
+++ configure
@@ -53962,7 +53962,7 @@
 
 
 
-ac_config_files="$ac_config_files Makefile common/Makefile common/m4/Makefile gst-plugins-bad.spec gst/Makefile gst/audioparsers/Makefile gst/autoconvert/Makefile gst/camerabin/Makefile gst/camerabin2/Makefile gst/debugutils/Makefile gst/dtmf/Makefile gst/h264parse/Makefile gst/jpegformat/Makefile gst/liveadder/Makefile gst/qtmux/Makefile gst/rawparse/Makefile gst/rtpmux/Makefile gst/sdp/Makefile gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/basecamerabinsrc/Makefile gst-libs/gst/interfaces/Makefile gst-libs/gst/signalprocessor/Makefile gst-libs/gst/video/Makefile sys/Makefile tests/Makefile tests/check/Makefile tests/files/Makefile tests/examples/Makefile tests/examples/camerabin/Makefile tests/examples/camerabin2/Makefile tests/examples/directfb/Makefile tests/examples/mxf/Makefile tests/examples/scaletempo/Makefile tests/icles/Makefile ext/Makefile ext/timidity/Makefile po/Makefile.in docs/Makefile docs/plugins/Makefile docs/version.entities pkgconfig/Makefile pkgc
 onfig/gstreamer-plugins-bad.pc pkgconfig/gstreamer-plugins-bad-uninstalled.pc tools/Makefile m4/Makefile win32/common/config.h"
+ac_config_files="$ac_config_files Makefile common/Makefile common/m4/Makefile gst-plugins-bad.spec gst/Makefile gst/audioparsers/Makefile gst/autoconvert/Makefile gst/camerabin/Makefile gst/camerabin2/Makefile gst/debugutils/Makefile gst/dtmf/Makefile gst/h264parse/Makefile gst/jpegformat/Makefile gst/liveadder/Makefile gst/qtmux/Makefile gst/rawparse/Makefile gst/rtpmux/Makefile gst/sdp/Makefile gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/basecamerabinsrc/Makefile gst-libs/gst/interfaces/Makefile gst-libs/gst/signalprocessor/Makefile gst-libs/gst/video/Makefile sys/Makefile sys/shm/Makefile tests/Makefile tests/check/Makefile tests/files/Makefile tests/examples/Makefile tests/examples/camerabin/Makefile tests/examples/camerabin2/Makefile tests/examples/directfb/Makefile tests/examples/mxf/Makefile tests/examples/scaletempo/Makefile tests/icles/Makefile ext/Makefile ext/timidity/Makefile po/Makefile.in docs/Makefile docs/plugins/Makefile docs/version.entities pkgcon
 fig/Makefile pkgconfig/gstreamer-plugins-bad.pc pkgconfig/gstreamer-plugins-bad-uninstalled.pc tools/Makefile m4/Makefile win32/common/config.h"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -56218,6 +56218,7 @@
     "gst-libs/gst/signalprocessor/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/signalprocessor/Makefile" ;;
     "gst-libs/gst/video/Makefile") CONFIG_FILES="$CONFIG_FILES gst-libs/gst/video/Makefile" ;;
     "sys/Makefile") CONFIG_FILES="$CONFIG_FILES sys/Makefile" ;;
+    "sys/shm/Makefile") CONFIG_FILES="$CONFIG_FILES sys/shm/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "tests/check/Makefile") CONFIG_FILES="$CONFIG_FILES tests/check/Makefile" ;;
     "tests/files/Makefile") CONFIG_FILES="$CONFIG_FILES tests/files/Makefile" ;;
--- configure.ac
+++ configure.ac
@@ -1674,6 +1674,7 @@
 gst-libs/gst/signalprocessor/Makefile
 gst-libs/gst/video/Makefile
 sys/Makefile
+sys/shm/Makefile
 tests/Makefile
 tests/check/Makefile
 tests/files/Makefile
--- docs/plugins/Makefile.am
+++ docs/plugins/Makefile.am
@@ -112,6 +112,8 @@
 	$(top_srcdir)/gst/rtpmux/gstrtpmux.h \
 	$(top_srcdir)/gst/rtpmux/gstrtpdtmfmux.h \
 	$(top_srcdir)/gst/sdp/gstsdpdemux.h \
+	$(top_srcdir)/sys/shm/gstshmsink.h \
+	$(top_srcdir)/sys/shm/gstshmsrc.h \
 	$(top_srcdir)/gst-libs/gst/interfaces/photography.h
 
 # Images to copy into HTML directory.
--- docs/plugins/Makefile.in
+++ docs/plugins/Makefile.in
@@ -632,6 +632,8 @@
 	$(top_srcdir)/gst/rtpmux/gstrtpmux.h \
 	$(top_srcdir)/gst/rtpmux/gstrtpdtmfmux.h \
 	$(top_srcdir)/gst/sdp/gstsdpdemux.h \
+	$(top_srcdir)/sys/shm/gstshmsink.h \
+	$(top_srcdir)/sys/shm/gstshmsrc.h \
 	$(top_srcdir)/gst-libs/gst/interfaces/photography.h
 
 
--- sys/Makefile.am
+++ sys/Makefile.am
@@ -72,6 +72,7 @@
 endif
 
 if USE_SHM
+SHM_DIR=shm
 else
 SHM_DIR=
 endif
--- sys/Makefile.in
+++ sys/Makefile.in
@@ -116,7 +116,7 @@
 	distdir
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = shm
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -535,6 +535,7 @@
 @USE_ACM_FALSE at ACM_DIR = 
 @USE_VDPAU_FALSE at VDPAU_DIR = 
 @USE_SHM_FALSE at SHM_DIR = 
+ at USE_SHM_TRUE@SHM_DIR = shm
 SUBDIRS = $(ACM_DIR) $(APPLE_MEDIA_DIR) $(DIRECTDRAW_DIR) $(DIRECTSOUND_DIR) $(DVB_DIR) $(FBDEV_DIR) $(OSX_VIDEO_DIR) $(QT_DIR) $(SHM_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR)
 all: all-recursive
 
--- sys/shm
+++ sys/shm
+(directory)
--- sys/shm/Makefile.am
+++ sys/shm/Makefile.am
+glib_enum_prefix = gst_shm
+
+include $(top_srcdir)/common/glib-gen.mak
+
+plugin_LTLIBRARIES = libgstshm.la
+
+libgstshm_la_SOURCES = shmpipe.c shmalloc.c gstshm.c gstshmsrc.c gstshmsink.c
+libgstshm_la_CFLAGS = $(GST_CFLAGS) -DSHM_PIPE_USE_GLIB
+libgstshm_la_LIBADD = -lrt
+libgstshm_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS)
+libgstshm_la_LIBTOOLFLAGS = --tag=disable-static
+
+noinst_HEADERS = gstshmsrc.h gstshmsink.h shmpipe.h  shmalloc.h
--- sys/shm/Makefile.in
+++ sys/shm/Makefile.in
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+ at SET_MAKE@
+
+# these are the variables your Makefile.am should set
+# the example is based on the colorbalance interface
+
+#glib_enum_headers=$(colorbalance_headers)
+#glib_enum_define=GST_COLOR_BALANCE
+#glib_enum_prefix=gst_color_balance
+
+
+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@
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/common/glib-gen.mak
+subdir = sys/shm
+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-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/gettext.m4 $(top_srcdir)/m4/gsettings.m4 \
+	$(top_srcdir)/m4/gst-fionread.m4 $(top_srcdir)/m4/gst-sdl.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__installdirs = "$(DESTDIR)$(plugindir)"
+LTLIBRARIES = $(plugin_LTLIBRARIES)
+libgstshm_la_DEPENDENCIES =
+am_libgstshm_la_OBJECTS = libgstshm_la-shmpipe.lo \
+	libgstshm_la-shmalloc.lo libgstshm_la-gstshm.lo \
+	libgstshm_la-gstshmsrc.lo libgstshm_la-gstshmsink.lo
+libgstshm_la_OBJECTS = $(am_libgstshm_la_OBJECTS)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+libgstshm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+	$(CCLD) $(libgstshm_la_CFLAGS) $(CFLAGS) \
+	$(libgstshm_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at 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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(libgstshm_la_SOURCES)
+DIST_SOURCES = $(libgstshm_la_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ACMENC_CFLAGS = @ACMENC_CFLAGS@
+ACMMP3DEC_CFLAGS = @ACMMP3DEC_CFLAGS@
+AMRWB_LIBS = @AMRWB_LIBS@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APEXSINK_CFLAGS = @APEXSINK_CFLAGS@
+APEXSINK_LIBS = @APEXSINK_LIBS@
+AR = @AR@
+AS = @AS@
+ASSRENDER_CFLAGS = @ASSRENDER_CFLAGS@
+ASSRENDER_LIBS = @ASSRENDER_LIBS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BZ2_LIBS = @BZ2_LIBS@
+CC = @CC@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CDAUDIO_CFLAGS = @CDAUDIO_CFLAGS@
+CDAUDIO_CONFIG = @CDAUDIO_CONFIG@
+CDAUDIO_LIBS = @CDAUDIO_LIBS@
+CELT_0_7_CFLAGS = @CELT_0_7_CFLAGS@
+CELT_0_7_LIBS = @CELT_0_7_LIBS@
+CELT_0_8_CFLAGS = @CELT_0_8_CFLAGS@
+CELT_0_8_LIBS = @CELT_0_8_LIBS@
+CELT_CFLAGS = @CELT_CFLAGS@
+CELT_LIBS = @CELT_LIBS@
+CFLAGS = @CFLAGS@
+COG_CFLAGS = @COG_CFLAGS@
+COG_LIBS = @COG_LIBS@
+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@
+DIRAC_CFLAGS = @DIRAC_CFLAGS@
+DIRAC_LIBS = @DIRAC_LIBS@
+DIRECTDRAW_LIBS = @DIRECTDRAW_LIBS@
+DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
+DIRECTFB_LIBS = @DIRECTFB_LIBS@
+DIRECTSOUND_LIBS = @DIRECTSOUND_LIBS@
+DIRECTX_CFLAGS = @DIRECTX_CFLAGS@
+DIRECTX_LDFLAGS = @DIRECTX_LDFLAGS@
+DIVXDEC_LIBS = @DIVXDEC_LIBS@
+DIVXENC_LIBS = @DIVXENC_LIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DTS_LIBS = @DTS_LIBS@
+DUMPBIN = @DUMPBIN@
+DVDNAV_CFLAGS = @DVDNAV_CFLAGS@
+DVDNAV_LIBS = @DVDNAV_LIBS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ERROR_CFLAGS = @ERROR_CFLAGS@
+ERROR_CXXFLAGS = @ERROR_CXXFLAGS@
+EXEEXT = @EXEEXT@
+EXIF_CFLAGS = @EXIF_CFLAGS@
+EXIF_LIBS = @EXIF_LIBS@
+FAAC_LIBS = @FAAC_LIBS@
+FAAD_IS_NEAAC = @FAAD_IS_NEAAC@
+FAAD_LIBS = @FAAD_LIBS@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FLITE_CFLAGS = @FLITE_CFLAGS@
+FLITE_LIBS = @FLITE_LIBS@
+GCOV = @GCOV@
+GCOV_CFLAGS = @GCOV_CFLAGS@
+GCOV_LIBS = @GCOV_LIBS@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GIO_CFLAGS = @GIO_CFLAGS@
+GIO_LIBS = @GIO_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_PREFIX = @GLIB_PREFIX@
+GLIB_REQ = @GLIB_REQ@
+GME_LIBS = @GME_LIBS@
+GMODULE_EXPORT_CFLAGS = @GMODULE_EXPORT_CFLAGS@
+GMODULE_EXPORT_LIBS = @GMODULE_EXPORT_LIBS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GMYTH_CFLAGS = @GMYTH_CFLAGS@
+GMYTH_LIBS = @GMYTH_LIBS@
+GREP = @GREP@
+GSETTINGS_CFLAGS = @GSETTINGS_CFLAGS@
+GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@
+GSETTINGS_LIBS = @GSETTINGS_LIBS@
+GSM_LIBS = @GSM_LIBS@
+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_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_BAD_CFLAGS = @GST_PLUGINS_BAD_CFLAGS@
+GST_PLUGINS_BAD_CXXFLAGS = @GST_PLUGINS_BAD_CXXFLAGS@
+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_FFMPEG_CFLAGS = @GST_PLUGINS_FFMPEG_CFLAGS@
+GST_PLUGINS_FFMPEG_DIR = @GST_PLUGINS_FFMPEG_DIR@
+GST_PLUGINS_FFMPEG_LIBS = @GST_PLUGINS_FFMPEG_LIBS@
+GST_PLUGINS_GOOD_CFLAGS = @GST_PLUGINS_GOOD_CFLAGS@
+GST_PLUGINS_GOOD_DIR = @GST_PLUGINS_GOOD_DIR@
+GST_PLUGINS_GOOD_LIBS = @GST_PLUGINS_GOOD_LIBS@
+GST_PLUGINS_SELECTED = @GST_PLUGINS_SELECTED@
+GST_PLUGINS_UGLY_CFLAGS = @GST_PLUGINS_UGLY_CFLAGS@
+GST_PLUGINS_UGLY_DIR = @GST_PLUGINS_UGLY_DIR@
+GST_PLUGINS_UGLY_LIBS = @GST_PLUGINS_UGLY_LIBS@
+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@
+HAVE_AMRWB = @HAVE_AMRWB@
+HAVE_BZ2 = @HAVE_BZ2@
+HAVE_CXX = @HAVE_CXX@
+HAVE_DIRECTDRAW = @HAVE_DIRECTDRAW@
+HAVE_DIRECTSOUND = @HAVE_DIRECTSOUND@
+HAVE_DTS = @HAVE_DTS@
+HAVE_FAAC = @HAVE_FAAC@
+HAVE_FAAD = @HAVE_FAAD@
+HAVE_FLITE = @HAVE_FLITE@
+HAVE_GSM = @HAVE_GSM@
+HAVE_JP2K = @HAVE_JP2K@
+HAVE_NAS = @HAVE_NAS@
+HAVE_VPX = @HAVE_VPX@
+HAVE_WILDMIDI = @HAVE_WILDMIDI@
+HAVE_X = @HAVE_X@
+HAVE_X11 = @HAVE_X11@
+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@
+JP2K_LIBS = @JP2K_LIBS@
+KATE_CFLAGS = @KATE_CFLAGS@
+KATE_LIBS = @KATE_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBDC1394_CFLAGS = @LIBDC1394_CFLAGS@
+LIBDC1394_LIBS = @LIBDC1394_LIBS@
+LIBDIR = @LIBDIR@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBM = @LIBM@
+LIBMMS_CFLAGS = @LIBMMS_CFLAGS@
+LIBMMS_LIBS = @LIBMMS_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALEDIR = @LOCALEDIR@
+LRDF_CFLAGS = @LRDF_CFLAGS@
+LRDF_LIBS = @LRDF_LIBS@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MIMIC_CFLAGS = @MIMIC_CFLAGS@
+MIMIC_LIBS = @MIMIC_LIBS@
+MJPEG_CFLAGS = @MJPEG_CFLAGS@
+MJPEG_LIBS = @MJPEG_LIBS@
+MKDIR_P = @MKDIR_P@
+MODPLUG_CFLAGS = @MODPLUG_CFLAGS@
+MODPLUG_LIBS = @MODPLUG_LIBS@
+MPEG2ENC_CFLAGS = @MPEG2ENC_CFLAGS@
+MPEG2ENC_LIBS = @MPEG2ENC_LIBS@
+MPLEX_CFLAGS = @MPLEX_CFLAGS@
+MPLEX_LDFLAGS = @MPLEX_LDFLAGS@
+MPLEX_LIBS = @MPLEX_LIBS@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+MUSEPACK_LIBS = @MUSEPACK_LIBS@
+MUSICBRAINZ_CFLAGS = @MUSICBRAINZ_CFLAGS@
+MUSICBRAINZ_LIBS = @MUSICBRAINZ_LIBS@
+NAS_CFLAGS = @NAS_CFLAGS@
+NAS_LIBS = @NAS_LIBS@
+NEON_CFLAGS = @NEON_CFLAGS@
+NEON_LIBS = @NEON_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJC_LDFLAGS = @OBJC_LDFLAGS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFA_CFLAGS = @OFA_CFLAGS@
+OFA_LIBS = @OFA_LIBS@
+OPENCV_CFLAGS = @OPENCV_CFLAGS@
+OPENCV_LIBS = @OPENCV_LIBS@
+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_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@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+RSVG_CFLAGS = @RSVG_CFLAGS@
+RSVG_LIBS = @RSVG_LIBS@
+RTMP_CFLAGS = @RTMP_CFLAGS@
+RTMP_LIBS = @RTMP_LIBS@
+SCHRO_CFLAGS = @SCHRO_CFLAGS@
+SCHRO_LIBS = @SCHRO_LIBS@
+SDL_CFLAGS = @SDL_CFLAGS@
+SDL_CONFIG = @SDL_CONFIG@
+SDL_LIBS = @SDL_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLV2_CFLAGS = @SLV2_CFLAGS@
+SLV2_LIBS = @SLV2_LIBS@
+SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
+SNDFILE_LIBS = @SNDFILE_LIBS@
+SOUNDTOUCH_CFLAGS = @SOUNDTOUCH_CFLAGS@
+SOUNDTOUCH_LIBS = @SOUNDTOUCH_LIBS@
+SPC_LIBS = @SPC_LIBS@
+STRIP = @STRIP@
+SWFDEC_CFLAGS = @SWFDEC_CFLAGS@
+SWFDEC_LIBS = @SWFDEC_LIBS@
+THEORADEC_CFLAGS = @THEORADEC_CFLAGS@
+THEORADEC_LIBS = @THEORADEC_LIBS@
+TIGER_CFLAGS = @TIGER_CFLAGS@
+TIGER_LIBS = @TIGER_LIBS@
+TIMIDITY_CFLAGS = @TIMIDITY_CFLAGS@
+TIMIDITY_LIBS = @TIMIDITY_LIBS@
+USE_NLS = @USE_NLS@
+VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+VALGRIND_LIBS = @VALGRIND_LIBS@
+VALGRIND_PATH = @VALGRIND_PATH@
+VDPAU_CFLAGS = @VDPAU_CFLAGS@
+VDPAU_LIBS = @VDPAU_LIBS@
+VERSION = @VERSION@
+VPX_LIBS = @VPX_LIBS@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+WARNING_CXXFLAGS = @WARNING_CXXFLAGS@
+WILDMIDI_CFLAGS = @WILDMIDI_CFLAGS@
+WILDMIDI_LIBS = @WILDMIDI_LIBS@
+WIN32_LIBS = @WIN32_LIBS@
+X11_CFLAGS = @X11_CFLAGS@
+X11_LIBS = @X11_LIBS@
+XDG_LIBS = @XDG_LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+XMKMF = @XMKMF@
+XVID_LIBS = @XVID_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ZBAR_CFLAGS = @ZBAR_CFLAGS@
+ZBAR_LIBS = @ZBAR_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+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@
+gsettingsschemadir = @gsettingsschemadir@
+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@
+lt_ECHO = @lt_ECHO@
+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@
+glib_enum_prefix = gst_shm
+enum_headers = $(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+plugin_LTLIBRARIES = libgstshm.la
+libgstshm_la_SOURCES = shmpipe.c shmalloc.c gstshm.c gstshmsrc.c gstshmsink.c
+libgstshm_la_CFLAGS = $(GST_CFLAGS) -DSHM_PIPE_USE_GLIB
+libgstshm_la_LIBADD = -lrt
+libgstshm_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS)
+libgstshm_la_LIBTOOLFLAGS = --tag=disable-static
+noinst_HEADERS = gstshmsrc.h gstshmsink.h shmpipe.h  shmalloc.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common/glib-gen.mak $(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 sys/shm/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu sys/shm/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
+libgstshm.la: $(libgstshm_la_OBJECTS) $(libgstshm_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libgstshm_la_LINK) -rpath $(plugindir) $(libgstshm_la_OBJECTS) $(libgstshm_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgstshm_la-gstshm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgstshm_la-gstshmsink.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgstshm_la-gstshmsrc.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgstshm_la-shmalloc.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libgstshm_la-shmpipe.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+libgstshm_la-shmpipe.lo: shmpipe.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -MT libgstshm_la-shmpipe.lo -MD -MP -MF $(DEPDIR)/libgstshm_la-shmpipe.Tpo -c -o libgstshm_la-shmpipe.lo `test -f 'shmpipe.c' || echo '$(srcdir)/'`shmpipe.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgstshm_la-shmpipe.Tpo $(DEPDIR)/libgstshm_la-shmpipe.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='shmpipe.c' object='libgstshm_la-shmpipe.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -c -o libgstshm_la-shmpipe.lo `test -f 'shmpipe.c' || echo '$(srcdir)/'`shmpipe.c
+
+libgstshm_la-shmalloc.lo: shmalloc.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -MT libgstshm_la-shmalloc.lo -MD -MP -MF $(DEPDIR)/libgstshm_la-shmalloc.Tpo -c -o libgstshm_la-shmalloc.lo `test -f 'shmalloc.c' || echo '$(srcdir)/'`shmalloc.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgstshm_la-shmalloc.Tpo $(DEPDIR)/libgstshm_la-shmalloc.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='shmalloc.c' object='libgstshm_la-shmalloc.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -c -o libgstshm_la-shmalloc.lo `test -f 'shmalloc.c' || echo '$(srcdir)/'`shmalloc.c
+
+libgstshm_la-gstshm.lo: gstshm.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -MT libgstshm_la-gstshm.lo -MD -MP -MF $(DEPDIR)/libgstshm_la-gstshm.Tpo -c -o libgstshm_la-gstshm.lo `test -f 'gstshm.c' || echo '$(srcdir)/'`gstshm.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgstshm_la-gstshm.Tpo $(DEPDIR)/libgstshm_la-gstshm.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gstshm.c' object='libgstshm_la-gstshm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -c -o libgstshm_la-gstshm.lo `test -f 'gstshm.c' || echo '$(srcdir)/'`gstshm.c
+
+libgstshm_la-gstshmsrc.lo: gstshmsrc.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -MT libgstshm_la-gstshmsrc.lo -MD -MP -MF $(DEPDIR)/libgstshm_la-gstshmsrc.Tpo -c -o libgstshm_la-gstshmsrc.lo `test -f 'gstshmsrc.c' || echo '$(srcdir)/'`gstshmsrc.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgstshm_la-gstshmsrc.Tpo $(DEPDIR)/libgstshm_la-gstshmsrc.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gstshmsrc.c' object='libgstshm_la-gstshmsrc.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -c -o libgstshm_la-gstshmsrc.lo `test -f 'gstshmsrc.c' || echo '$(srcdir)/'`gstshmsrc.c
+
+libgstshm_la-gstshmsink.lo: gstshmsink.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -MT libgstshm_la-gstshmsink.lo -MD -MP -MF $(DEPDIR)/libgstshm_la-gstshmsink.Tpo -c -o libgstshm_la-gstshmsink.lo `test -f 'gstshmsink.c' || echo '$(srcdir)/'`gstshmsink.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libgstshm_la-gstshmsink.Tpo $(DEPDIR)/libgstshm_la-gstshmsink.Plo
+ at am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gstshmsink.c' object='libgstshm_la-gstshmsink.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgstshm_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstshm_la_CFLAGS) $(CFLAGS) -c -o libgstshm_la-gstshmsink.lo `test -f 'gstshmsink.c' || echo '$(srcdir)/'`gstshmsink.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:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+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
+
+
+# these are all the rules generating the relevant files
+%-marshal.h: %-marshal.list
+	$(AM_V_GEN)glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp && \
+	mv $*-marshal.h.tmp $*-marshal.h
+
+%-marshal.c: %-marshal.list
+	$(AM_V_GEN)echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp && \
+	glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp && \
+	mv $*-marshal.c.tmp $*-marshal.c
+
+%-enumtypes.h: $(glib_enum_headers)
+	$(AM_V_GEN)glib-mkenums \
+	--fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+	--fprod "\n/* enumerations from \"@filename@\" */\n" \
+	--vhead "GType @enum_name at _get_type (void);\n#define GST_TYPE_ at ENUMSHORT@ (@enum_name at _get_type())\n"         \
+	--ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \
+	$^ > $@
+
+%-enumtypes.c: $(glib_enum_headers)
+	@if test "x$(glib_enum_headers)" = "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi
+	$(AM_V_GEN)glib-mkenums \
+	--fhead "#include \"$*-enumtypes.h\"\n$(enum_headers)" \
+	--fprod "\n/* enumerations from \"@filename@\" */" \
+	--vhead "GType\n at enum_name@_get_type (void)\n{\n  static volatile gsize g_define_type_id__volatile = 0;\n  if (g_once_init_enter (&g_define_type_id__volatile)) {\n    static const G at Type@Value values[] = {"     \
+	--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+	--vtail "      { 0, NULL, NULL }\n    };\n    GType g_define_type_id = g_ at type@_register_static (\"@EnumName@\", values);\n    g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n  }\n  return g_define_type_id__volatile;\n}\n" \
+	$^ > $@
+
+# a hack rule to make sure .Plo files exist because they get include'd
+# from Makefile's
+.deps/%-marshal.Plo:
+	@touch $@
+
+.deps/%-enumtypes.Plo:
+	@touch $@
+
+# 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:
--- sys/shm/gstshm.c
+++ sys/shm/gstshm.c
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * 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 "gstshmsrc.h"
+#include "gstshmsink.h"
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  return gst_element_register (plugin, "shmsrc",
+      GST_RANK_NONE, GST_TYPE_SHM_SRC) &&
+      gst_element_register (plugin, "shmsink",
+      GST_RANK_NONE, GST_TYPE_SHM_SINK);
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+    GST_VERSION_MINOR,
+    "shm",
+    "shared memory sink source",
+    plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
--- sys/shm/gstshmsink.c
+++ sys/shm/gstshmsink.c
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * 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 "gstshmsink.h"
+
+#include <gst/gst.h>
+
+#include <string.h>
+
+/* signals */
+enum
+{
+  SIGNAL_CLIENT_CONNECTED,
+  SIGNAL_CLIENT_DISCONNECTED,
+  LAST_SIGNAL
+};
+
+/* properties */
+enum
+{
+  PROP_0,
+  PROP_SOCKET_PATH,
+  PROP_PERMS,
+  PROP_SHM_SIZE,
+  PROP_WAIT_FOR_CONNECTION
+};
+
+struct GstShmClient
+{
+  ShmClient *client;
+  GstPollFD pollfd;
+};
+
+#define DEFAULT_SIZE ( 256 * 1024 )
+#define DEFAULT_WAIT_FOR_CONNECTION (TRUE)
+#define DEFAULT_PERMS (S_IRWXU | S_IRWXG)
+
+
+GST_DEBUG_CATEGORY_STATIC (shmsink_debug);
+#define GST_CAT_DEFAULT shmsink_debug
+
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+GST_BOILERPLATE (GstShmSink, gst_shm_sink, GstBaseSink, GST_TYPE_BASE_SINK);
+
+static void gst_shm_sink_finalize (GObject * object);
+static void gst_shm_sink_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec);
+static void gst_shm_sink_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec);
+
+static gboolean gst_shm_sink_start (GstBaseSink * bsink);
+static gboolean gst_shm_sink_stop (GstBaseSink * bsink);
+static GstFlowReturn gst_shm_sink_render (GstBaseSink * bsink, GstBuffer * buf);
+static GstFlowReturn gst_shm_sink_buffer_alloc (GstBaseSink * sink,
+    guint64 offset, guint size, GstCaps * caps, GstBuffer ** out_buf);
+
+static gboolean gst_shm_sink_event (GstBaseSink * bsink, GstEvent * event);
+static gboolean gst_shm_sink_unlock (GstBaseSink * bsink);
+static gboolean gst_shm_sink_unlock_stop (GstBaseSink * bsink);
+
+static gpointer pollthread_func (gpointer data);
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+static void
+gst_shm_sink_base_init (gpointer g_class)
+{
+  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&sinktemplate));
+
+  gst_element_class_set_details_simple (element_class,
+      "Shared Memory Sink",
+      "Sink",
+      "Send data over shared memory to the matching source",
+      "Olivier Crete <olivier.crete at collabora.co.uk>");
+}
+
+static void
+gst_shm_sink_init (GstShmSink * self, GstShmSinkClass * g_class)
+{
+  self->cond = g_cond_new ();
+  self->size = DEFAULT_SIZE;
+  self->wait_for_connection = DEFAULT_WAIT_FOR_CONNECTION;
+  self->perms = DEFAULT_PERMS;
+}
+
+static void
+gst_shm_sink_class_init (GstShmSinkClass * klass)
+{
+  GObjectClass *gobject_class;
+  GstElementClass *gstelement_class;
+  GstBaseSinkClass *gstbasesink_class;
+
+  gobject_class = (GObjectClass *) klass;
+  gstelement_class = (GstElementClass *) klass;
+  gstbasesink_class = (GstBaseSinkClass *) klass;
+
+  gobject_class->finalize = gst_shm_sink_finalize;
+  gobject_class->set_property = gst_shm_sink_set_property;
+  gobject_class->get_property = gst_shm_sink_get_property;
+
+  gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_shm_sink_start);
+  gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_shm_sink_stop);
+  gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_shm_sink_render);
+  gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_shm_sink_event);
+  gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_shm_sink_unlock);
+  gstbasesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_shm_sink_unlock_stop);
+  gstbasesink_class->buffer_alloc =
+      GST_DEBUG_FUNCPTR (gst_shm_sink_buffer_alloc);
+
+  g_object_class_install_property (gobject_class, PROP_SOCKET_PATH,
+      g_param_spec_string ("socket-path",
+          "Path to the control socket",
+          "The path to the control socket used to control the shared memory"
+          " transport", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_property (gobject_class, PROP_PERMS,
+      g_param_spec_uint ("perms",
+          "Permissions on the shm area",
+          "Permissions to set on the shm area",
+          0, 07777, DEFAULT_PERMS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_property (gobject_class, PROP_SHM_SIZE,
+      g_param_spec_uint ("shm-size",
+          "Size of the shm area",
+          "Size of the shared memory area",
+          0, G_MAXUINT, DEFAULT_SIZE,
+          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_property (gobject_class, PROP_WAIT_FOR_CONNECTION,
+      g_param_spec_boolean ("wait-for-connection",
+          "Wait for a connection until rendering",
+          "Block the stream until the shm pipe is connected",
+          DEFAULT_WAIT_FOR_CONNECTION,
+          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  signals[SIGNAL_CLIENT_CONNECTED] = g_signal_new ("client-connected",
+      GST_TYPE_SHM_SINK, G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
+
+  signals[SIGNAL_CLIENT_DISCONNECTED] = g_signal_new ("client-disconnected",
+      GST_TYPE_SHM_SINK, G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+      g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
+
+  GST_DEBUG_CATEGORY_INIT (shmsink_debug, "shmsink", 0, "Shared Memory Sink");
+}
+
+static void
+gst_shm_sink_finalize (GObject * object)
+{
+  GstShmSink *self = GST_SHM_SINK (object);
+
+  g_cond_free (self->cond);
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/*
+ * Set the value of a property for the server sink.
+ */
+static void
+gst_shm_sink_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec)
+{
+  GstShmSink *self = GST_SHM_SINK (object);
+  int ret = 0;
+
+  switch (prop_id) {
+    case PROP_SOCKET_PATH:
+      GST_OBJECT_LOCK (object);
+      g_free (self->socket_path);
+      self->socket_path = g_value_dup_string (value);
+      GST_OBJECT_UNLOCK (object);
+      break;
+    case PROP_PERMS:
+      GST_OBJECT_LOCK (object);
+      self->perms = g_value_get_uint (value);
+      if (self->pipe)
+        ret = sp_writer_setperms_shm (self->pipe, self->perms);
+      GST_OBJECT_UNLOCK (object);
+      if (ret < 0)
+        GST_WARNING_OBJECT (object, "Could not set permissions on pipe: %s",
+            strerror (ret));
+      break;
+    case PROP_SHM_SIZE:
+      GST_OBJECT_LOCK (object);
+      if (self->pipe) {
+        if (sp_writer_resize (self->pipe, g_value_get_uint (value)) < 0)
+          GST_DEBUG_OBJECT (self, "Resized shared memory area from %u to "
+              "%u bytes", self->size, g_value_get_uint (value));
+        else
+          GST_WARNING_OBJECT (self, "Could not resize shared memory area from"
+              "%u to %u bytes", self->size, g_value_get_uint (value));
+      }
+      self->size = g_value_get_uint (value);
+      GST_OBJECT_UNLOCK (object);
+      break;
+    case PROP_WAIT_FOR_CONNECTION:
+      GST_OBJECT_LOCK (object);
+      self->wait_for_connection = g_value_get_boolean (value);
+      GST_OBJECT_UNLOCK (object);
+      g_cond_broadcast (self->cond);
+      break;
+    default:
+      break;
+  }
+}
+
+static void
+gst_shm_sink_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec)
+{
+  GstShmSink *self = GST_SHM_SINK (object);
+
+  GST_OBJECT_LOCK (object);
+
+  switch (prop_id) {
+    case PROP_SOCKET_PATH:
+      g_value_set_string (value, self->socket_path);
+      break;
+    case PROP_PERMS:
+      self->perms = g_value_get_uint (value);
+      if (self->pipe) {
+        int ret;
+
+        ret = sp_writer_setperms_shm (self->pipe, self->perms);
+        if (ret < 0)
+          GST_WARNING_OBJECT (object, "Could not set permissions on pipe: %s",
+              strerror (ret));
+      }
+      break;
+    case PROP_SHM_SIZE:
+      g_value_set_uint (value, self->size);
+      break;
+    case PROP_WAIT_FOR_CONNECTION:
+      g_value_set_boolean (value, self->wait_for_connection);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+
+  GST_OBJECT_UNLOCK (object);
+}
+
+
+
+static gboolean
+gst_shm_sink_start (GstBaseSink * bsink)
+{
+  GstShmSink *self = GST_SHM_SINK (bsink);
+
+  self->stop = FALSE;
+
+  if (!self->socket_path) {
+    GST_ELEMENT_ERROR (self, RESOURCE, OPEN_READ_WRITE,
+        ("Could not open socket."), (NULL));
+    return FALSE;
+  }
+
+  GST_DEBUG_OBJECT (self, "Creating new socket at %s"
+      " with shared memory of %d bytes", self->socket_path, self->size);
+
+  self->pipe = sp_writer_create (self->socket_path, self->size, self->perms);
+
+  if (!self->pipe) {
+    GST_ELEMENT_ERROR (self, RESOURCE, OPEN_READ_WRITE,
+        ("Could not open socket."), (NULL));
+    return FALSE;
+  }
+
+  g_free (self->socket_path);
+  self->socket_path = g_strdup (sp_writer_get_path (self->pipe));
+
+  GST_DEBUG ("Created socket at %s", self->socket_path);
+
+  self->poll = gst_poll_new (TRUE);
+  gst_poll_fd_init (&self->serverpollfd);
+  self->serverpollfd.fd = sp_get_fd (self->pipe);
+  gst_poll_add_fd (self->poll, &self->serverpollfd);
+  gst_poll_fd_ctl_read (self->poll, &self->serverpollfd, TRUE);
+
+  self->pollthread = g_thread_create (pollthread_func, self, TRUE, NULL);
+
+  if (!self->pollthread)
+    goto thread_error;
+
+  return TRUE;
+
+thread_error:
+
+  sp_close (self->pipe);
+  self->pipe = NULL;
+  gst_poll_free (self->poll);
+
+  GST_ELEMENT_ERROR (self, CORE, THREAD, ("Could not srart thread"), (NULL));
+  return FALSE;
+}
+
+
+static gboolean
+gst_shm_sink_stop (GstBaseSink * bsink)
+{
+  GstShmSink *self = GST_SHM_SINK (bsink);
+
+  self->stop = TRUE;
+  gst_poll_set_flushing (self->poll, TRUE);
+
+  g_thread_join (self->pollthread);
+  self->pollthread = NULL;
+
+  GST_DEBUG_OBJECT (self, "Stopping");
+
+  while (self->clients) {
+    struct GstShmClient *client = self->clients->data;
+    self->clients = g_list_remove (self->clients, client);
+    sp_writer_close_client (self->pipe, client->client);
+    g_signal_emit (self, signals[SIGNAL_CLIENT_DISCONNECTED], 0,
+        client->pollfd.fd);
+    g_slice_free (struct GstShmClient, client);
+  }
+
+  gst_poll_free (self->poll);
+  self->poll = NULL;
+
+  sp_close (self->pipe);
+  self->pipe = NULL;
+
+  return TRUE;
+}
+
+static GstFlowReturn
+gst_shm_sink_render (GstBaseSink * bsink, GstBuffer * buf)
+{
+  GstShmSink *self = GST_SHM_SINK (bsink);
+  int rv;
+
+  GST_OBJECT_LOCK (self);
+  while (self->wait_for_connection && !self->clients) {
+    g_cond_wait (self->cond, GST_OBJECT_GET_LOCK (self));
+    if (self->unlock) {
+      GST_OBJECT_UNLOCK (self);
+      return GST_FLOW_WRONG_STATE;
+    }
+  }
+
+  rv = sp_writer_send_buf (self->pipe, (char *) GST_BUFFER_DATA (buf),
+      GST_BUFFER_SIZE (buf));
+
+  if (rv == -1) {
+    ShmBlock *block = NULL;
+    gchar *shmbuf = NULL;
+    while ((block = sp_writer_alloc_block (self->pipe,
+                GST_BUFFER_SIZE (buf))) == NULL) {
+      g_cond_wait (self->cond, GST_OBJECT_GET_LOCK (self));
+      if (self->unlock) {
+        GST_OBJECT_UNLOCK (self);
+        return GST_FLOW_WRONG_STATE;
+      }
+    }
+    while (self->wait_for_connection && !self->clients) {
+      g_cond_wait (self->cond, GST_OBJECT_GET_LOCK (self));
+      if (self->unlock) {
+        sp_writer_free_block (block);
+        GST_OBJECT_UNLOCK (self);
+        return GST_FLOW_WRONG_STATE;
+      }
+    }
+
+
+    shmbuf = sp_writer_block_get_buf (block);
+    memcpy (shmbuf, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
+    sp_writer_send_buf (self->pipe, shmbuf, GST_BUFFER_SIZE (buf));
+    sp_writer_free_block (block);
+  }
+
+  GST_OBJECT_UNLOCK (self);
+
+  return GST_FLOW_OK;
+}
+
+static void
+gst_shm_sink_free_buffer (gpointer data)
+{
+  ShmBlock *block = data;
+  sp_writer_free_block (block);
+}
+
+static GstFlowReturn
+gst_shm_sink_buffer_alloc (GstBaseSink * sink, guint64 offset, guint size,
+    GstCaps * caps, GstBuffer ** out_buf)
+{
+  GstShmSink *self = GST_SHM_SINK (sink);
+  GstBuffer *buffer;
+  ShmBlock *block = NULL;
+  gpointer buf = NULL;
+
+  GST_OBJECT_LOCK (self);
+  block = sp_writer_alloc_block (self->pipe, size);
+  if (block)
+    buf = sp_writer_block_get_buf (block);
+  GST_OBJECT_UNLOCK (self);
+
+  if (block) {
+    buffer = gst_buffer_new ();
+    GST_BUFFER_DATA (buffer) = buf;
+    GST_BUFFER_MALLOCDATA (buffer) = (guint8 *) block;
+    GST_BUFFER_FREE_FUNC (buffer) =
+        GST_DEBUG_FUNCPTR (gst_shm_sink_free_buffer);
+    GST_BUFFER_SIZE (buffer) = size;
+    GST_LOG_OBJECT (self,
+        "Allocated buffer of %u bytes from shared memory at %p", size, buf);
+  } else {
+    buffer = gst_buffer_new_and_alloc (size);
+    GST_LOG_OBJECT (self, "Not enough shared memory for buffer of %u bytes, "
+        "allocating using standard allocator", size);
+  }
+
+  GST_BUFFER_OFFSET (buffer) = offset;
+  gst_buffer_set_caps (buffer, caps);
+
+  *out_buf = buffer;
+
+  return GST_FLOW_OK;
+}
+
+static gpointer
+pollthread_func (gpointer data)
+{
+  GstShmSink *self = GST_SHM_SINK (data);
+  GList *item;
+
+  while (!self->stop) {
+
+    if (gst_poll_wait (self->poll, GST_CLOCK_TIME_NONE) < 0)
+      return NULL;
+
+    if (self->stop)
+      return NULL;
+
+    if (gst_poll_fd_has_closed (self->poll, &self->serverpollfd)) {
+      GST_ELEMENT_ERROR (self, RESOURCE, READ, ("Failed read from shmsink"),
+          ("Control socket has closed"));
+      return NULL;
+    }
+
+    if (gst_poll_fd_has_error (self->poll, &self->serverpollfd)) {
+      GST_ELEMENT_ERROR (self, RESOURCE, READ, ("Failed to read from shmsink"),
+          ("Control socket has error"));
+      return NULL;
+    }
+
+    if (gst_poll_fd_can_read (self->poll, &self->serverpollfd)) {
+      ShmClient *client;
+      struct GstShmClient *gclient;
+
+      GST_OBJECT_LOCK (self);
+      client = sp_writer_accept_client (self->pipe);
+      GST_OBJECT_UNLOCK (self);
+
+      if (!client) {
+        GST_ELEMENT_ERROR (self, RESOURCE, READ,
+            ("Failed to read from shmsink"),
+            ("Control socket returns wrong data"));
+        return NULL;
+      }
+
+      gclient = g_slice_new (struct GstShmClient);
+      gclient->client = client;
+      gst_poll_fd_init (&gclient->pollfd);
+      gclient->pollfd.fd = sp_writer_get_client_fd (client);
+      gst_poll_add_fd (self->poll, &gclient->pollfd);
+      gst_poll_fd_ctl_read (self->poll, &gclient->pollfd, TRUE);
+      self->clients = g_list_prepend (self->clients, gclient);
+      g_signal_emit (self, signals[SIGNAL_CLIENT_CONNECTED], 0,
+          gclient->pollfd.fd);
+    }
+
+  again:
+    for (item = self->clients; item; item = item->next) {
+      struct GstShmClient *gclient = item->data;
+
+      if (gst_poll_fd_has_closed (self->poll, &gclient->pollfd)) {
+        GST_WARNING_OBJECT (self, "One client is gone, closing");
+        goto close_client;
+      }
+
+      if (gst_poll_fd_has_error (self->poll, &gclient->pollfd)) {
+        GST_WARNING_OBJECT (self, "One client fd has error, closing");
+        goto close_client;
+      }
+
+      if (gst_poll_fd_can_read (self->poll, &gclient->pollfd)) {
+        int rv;
+
+        GST_OBJECT_LOCK (self);
+        rv = sp_writer_recv (self->pipe, gclient->client);
+        GST_OBJECT_UNLOCK (self);
+
+        if (rv < 0) {
+          GST_WARNING_OBJECT (self, "One client has read error,"
+              " closing (retval: %d errno: %d)", rv, errno);
+          goto close_client;
+        }
+      }
+      continue;
+    close_client:
+      GST_OBJECT_LOCK (self);
+      sp_writer_close_client (self->pipe, gclient->client);
+      GST_OBJECT_UNLOCK (self);
+
+      gst_poll_remove_fd (self->poll, &gclient->pollfd);
+      self->clients = g_list_remove (self->clients, gclient);
+
+      g_signal_emit (self, signals[SIGNAL_CLIENT_DISCONNECTED], 0,
+          gclient->pollfd.fd);
+      g_slice_free (struct GstShmClient, gclient);
+
+      goto again;
+    }
+
+    g_cond_broadcast (self->cond);
+  }
+
+  return NULL;
+}
+
+static gboolean
+gst_shm_sink_event (GstBaseSink * bsink, GstEvent * event)
+{
+  GstShmSink *self = GST_SHM_SINK (bsink);
+
+  switch (GST_EVENT_TYPE (event)) {
+    case GST_EVENT_EOS:
+      GST_OBJECT_LOCK (self);
+      while (self->wait_for_connection && sp_writer_pending_writes (self->pipe)
+          && !self->unlock)
+        g_cond_wait (self->cond, GST_OBJECT_GET_LOCK (self));
+      GST_OBJECT_UNLOCK (self);
+      break;
+    default:
+      break;
+  }
+
+  return TRUE;
+}
+
+
+static gboolean
+gst_shm_sink_unlock (GstBaseSink * bsink)
+{
+  GstShmSink *self = GST_SHM_SINK (bsink);
+
+  GST_OBJECT_LOCK (self);
+  self->unlock = TRUE;
+  GST_OBJECT_UNLOCK (self);
+
+  g_cond_broadcast (self->cond);
+  return TRUE;
+}
+
+static gboolean
+gst_shm_sink_unlock_stop (GstBaseSink * bsink)
+{
+  GstShmSink *self = GST_SHM_SINK (bsink);
+
+  GST_OBJECT_LOCK (self);
+  self->unlock = FALSE;
+  GST_OBJECT_UNLOCK (self);
+
+  return TRUE;
+}
--- sys/shm/gstshmsink.h
+++ sys/shm/gstshmsink.h
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * 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_SHM_SINK_H__
+#define __GST_SHM_SINK_H__
+
+#include <gst/gst.h>
+#include <gst/base/gstbasesink.h>
+
+#include "shmpipe.h"
+
+G_BEGIN_DECLS
+#define GST_TYPE_SHM_SINK \
+  (gst_shm_sink_get_type())
+#define GST_SHM_SINK(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SHM_SINK,GstShmSink))
+#define GST_SHM_SINK_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SHM_SINK,GstShmSinkClass))
+#define GST_IS_SHM_SINK(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SHM_SINK))
+#define GST_IS_SHM_SINK_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SHM_SINK))
+typedef struct _GstShmSink GstShmSink;
+typedef struct _GstShmSinkClass GstShmSinkClass;
+
+struct _GstShmSink
+{
+  GstBaseSink element;
+
+  gchar *socket_path;
+
+  ShmPipe *pipe;
+
+  guint perms;
+  guint size;
+
+  GList *clients;
+
+  GThread *pollthread;
+  GstPoll *poll;
+  GstPollFD serverpollfd;
+
+  gboolean wait_for_connection;
+  gboolean stop;
+  gboolean unlock;
+
+  GCond *cond;
+};
+
+struct _GstShmSinkClass
+{
+  GstBaseSinkClass parent_class;
+};
+
+GType gst_shm_sink_get_type (void);
+
+G_END_DECLS
+#endif /* __GST_SHM_SINK_H__ */
--- sys/shm/gstshmsrc.c
+++ sys/shm/gstshmsrc.c
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * 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 "gstshmsrc.h"
+
+#include <gst/gst.h>
+
+#include <string.h>
+
+/* signals */
+enum
+{
+  LAST_SIGNAL
+};
+
+/* properties */
+enum
+{
+  PROP_0,
+  PROP_SOCKET_PATH,
+  PROP_IS_LIVE
+};
+
+struct GstShmBuffer
+{
+  char *buf;
+  GstShmPipe *pipe;
+};
+
+
+GST_DEBUG_CATEGORY_STATIC (shmsrc_debug);
+#define GST_CAT_DEFAULT shmsrc_debug
+
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+GST_BOILERPLATE (GstShmSrc, gst_shm_src, GstPushSrc, GST_TYPE_PUSH_SRC);
+
+static void gst_shm_src_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec);
+static void gst_shm_src_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec);
+static gboolean gst_shm_src_start (GstBaseSrc * bsrc);
+static gboolean gst_shm_src_stop (GstBaseSrc * bsrc);
+static GstFlowReturn gst_shm_src_create (GstPushSrc * psrc,
+    GstBuffer ** outbuf);
+static gboolean gst_shm_src_unlock (GstBaseSrc * bsrc);
+static gboolean gst_shm_src_unlock_stop (GstBaseSrc * bsrc);
+
+static void gst_shm_pipe_inc (GstShmPipe * pipe);
+static void gst_shm_pipe_dec (GstShmPipe * pipe);
+
+// static guint gst_shm_src_signals[LAST_SIGNAL] = { 0 };
+
+
+static void
+gst_shm_src_base_init (gpointer g_class)
+{
+  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&srctemplate));
+
+  gst_element_class_set_details_simple (element_class,
+      "Shared Memory Source",
+      "Source",
+      "Receive data from the sharem memory sink",
+      "Olivier Crete <olivier.crete at collabora.co.uk");
+}
+
+static void
+gst_shm_src_class_init (GstShmSrcClass * klass)
+{
+  GObjectClass *gobject_class;
+  GstBaseSrcClass *gstbasesrc_class;
+  GstPushSrcClass *gstpush_src_class;
+
+  gobject_class = (GObjectClass *) klass;
+  gstbasesrc_class = (GstBaseSrcClass *) klass;
+  gstpush_src_class = (GstPushSrcClass *) klass;
+
+  gobject_class->set_property = gst_shm_src_set_property;
+  gobject_class->get_property = gst_shm_src_get_property;
+
+  gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_shm_src_start);
+  gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_shm_src_stop);
+  gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_shm_src_unlock);
+  gstbasesrc_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_shm_src_unlock_stop);
+
+  gstpush_src_class->create = gst_shm_src_create;
+
+  g_object_class_install_property (gobject_class, PROP_SOCKET_PATH,
+      g_param_spec_string ("socket-path",
+          "Path to the control socket",
+          "The path to the control socket used to control the shared memory"
+          " transport", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_property (gobject_class, PROP_IS_LIVE,
+      g_param_spec_boolean ("is-live", "Is this a live source",
+          "True if the element cannot produce data in PAUSED", FALSE,
+          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  GST_DEBUG_CATEGORY_INIT (shmsrc_debug, "shmsrc", 0, "Shared Memory Source");
+}
+
+static void
+gst_shm_src_init (GstShmSrc * self, GstShmSrcClass * g_class)
+{
+}
+
+
+static void
+gst_shm_src_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec)
+{
+  GstShmSrc *self = GST_SHM_SRC (object);
+
+  switch (prop_id) {
+    case PROP_SOCKET_PATH:
+      GST_OBJECT_LOCK (object);
+      if (self->pipe) {
+        GST_WARNING_OBJECT (object, "Can not modify socket path while the "
+            "element is playing");
+      } else {
+        g_free (self->socket_path);
+        self->socket_path = g_value_dup_string (value);
+      }
+      GST_OBJECT_UNLOCK (object);
+      break;
+    case PROP_IS_LIVE:
+      gst_base_src_set_live (GST_BASE_SRC (object),
+          g_value_get_boolean (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static void
+gst_shm_src_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec)
+{
+  GstShmSrc *self = GST_SHM_SRC (object);
+
+  switch (prop_id) {
+    case PROP_SOCKET_PATH:
+      GST_OBJECT_LOCK (object);
+      g_value_set_string (value, self->socket_path);
+      GST_OBJECT_UNLOCK (object);
+      break;
+    case PROP_IS_LIVE:
+      g_value_set_boolean (value, gst_base_src_is_live (GST_BASE_SRC (object)));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static gboolean
+gst_shm_src_start (GstBaseSrc * bsrc)
+{
+  GstShmSrc *self = GST_SHM_SRC (bsrc);
+  GstShmPipe *gstpipe = g_slice_new0 (GstShmPipe);
+
+  gstpipe->use_count = 1;
+  gstpipe->src = gst_object_ref (self);
+
+  if (!self->socket_path) {
+    GST_ELEMENT_ERROR (bsrc, RESOURCE, NOT_FOUND,
+        ("No path specified for socket."), (NULL));
+    return FALSE;
+  }
+
+  GST_DEBUG ("Opening socket %s", self->socket_path);
+
+  GST_OBJECT_LOCK (self);
+  gstpipe->pipe = sp_client_open (self->socket_path);
+  GST_OBJECT_UNLOCK (self);
+
+  if (!gstpipe->pipe) {
+    GST_ELEMENT_ERROR (bsrc, RESOURCE, OPEN_READ_WRITE,
+        ("Could not open socket %s: %d %s", self->socket_path, errno,
+            strerror (errno)), (NULL));
+    gst_shm_pipe_dec (gstpipe);
+    return FALSE;
+  }
+
+  self->pipe = gstpipe;
+
+  self->poll = gst_poll_new (TRUE);
+  gst_poll_fd_init (&self->pollfd);
+  self->pollfd.fd = sp_get_fd (self->pipe->pipe);
+  gst_poll_add_fd (self->poll, &self->pollfd);
+  gst_poll_fd_ctl_read (self->poll, &self->pollfd, TRUE);
+
+  return TRUE;
+}
+
+static gboolean
+gst_shm_src_stop (GstBaseSrc * bsrc)
+{
+  GstShmSrc *self = GST_SHM_SRC (bsrc);
+
+  GST_DEBUG_OBJECT (self, "Stopping %p", self);
+
+  if (self->pipe) {
+    gst_shm_pipe_dec (self->pipe);
+    self->pipe = NULL;
+  }
+
+  gst_poll_free (self->poll);
+  self->poll = NULL;
+
+  return TRUE;
+}
+
+
+static void
+free_buffer (gpointer data)
+{
+  struct GstShmBuffer *gsb = data;
+  g_return_if_fail (gsb->pipe != NULL);
+  g_return_if_fail (gsb->pipe->src != NULL);
+
+  GST_LOG ("Freeing buffer %p", gsb->buf);
+
+  GST_OBJECT_LOCK (gsb->pipe->src);
+  sp_client_recv_finish (gsb->pipe->pipe, gsb->buf);
+  GST_OBJECT_UNLOCK (gsb->pipe->src);
+
+  gst_shm_pipe_dec (gsb->pipe);
+
+  g_slice_free (struct GstShmBuffer, gsb);
+}
+
+static GstFlowReturn
+gst_shm_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
+{
+  GstShmSrc *self = GST_SHM_SRC (psrc);
+  gchar *buf = NULL;
+  int rv = 0;
+  struct GstShmBuffer *gsb;
+
+  do {
+    if (gst_poll_wait (self->poll, GST_CLOCK_TIME_NONE) < 0) {
+      if (errno == EBUSY)
+        return GST_FLOW_WRONG_STATE;
+      GST_ELEMENT_ERROR (self, RESOURCE, READ, ("Failed to read from shmsrc"),
+          ("Poll failed on fd: %s", strerror (errno)));
+      return GST_FLOW_ERROR;
+    }
+
+    if (self->unlocked)
+      return GST_FLOW_WRONG_STATE;
+
+    if (gst_poll_fd_has_closed (self->poll, &self->pollfd)) {
+      GST_ELEMENT_ERROR (self, RESOURCE, READ, ("Failed to read from shmsrc"),
+          ("Control socket has closed"));
+      return GST_FLOW_ERROR;
+    }
+
+    if (gst_poll_fd_has_error (self->poll, &self->pollfd)) {
+      GST_ELEMENT_ERROR (self, RESOURCE, READ, ("Failed to read from shmsrc"),
+          ("Control socket has error"));
+      return GST_FLOW_ERROR;
+    }
+
+    if (gst_poll_fd_can_read (self->poll, &self->pollfd)) {
+      buf = NULL;
+      GST_LOG_OBJECT (self, "Reading from pipe");
+      GST_OBJECT_LOCK (self);
+      rv = sp_client_recv (self->pipe->pipe, &buf);
+      GST_OBJECT_UNLOCK (self);
+      if (rv < 0) {
+        GST_ELEMENT_ERROR (self, RESOURCE, READ, ("Failed to read from shmsrc"),
+            ("Error reading control data: %d", rv));
+        return GST_FLOW_ERROR;
+      }
+    }
+  } while (buf == NULL);
+
+  GST_LOG_OBJECT (self, "Got buffer %p of size %d", buf, rv);
+
+  gsb = g_slice_new0 (struct GstShmBuffer);
+  gsb->buf = buf;
+  gsb->pipe = self->pipe;
+  gst_shm_pipe_inc (self->pipe);
+
+  *outbuf = gst_buffer_new ();
+  GST_BUFFER_FLAG_SET (*outbuf, GST_BUFFER_FLAG_READONLY);
+  GST_BUFFER_DATA (*outbuf) = (guint8 *) buf;
+  GST_BUFFER_SIZE (*outbuf) = rv;
+  GST_BUFFER_MALLOCDATA (*outbuf) = (guint8 *) gsb;
+  GST_BUFFER_FREE_FUNC (*outbuf) = free_buffer;
+
+  return GST_FLOW_OK;
+}
+
+static gboolean
+gst_shm_src_unlock (GstBaseSrc * bsrc)
+{
+  GstShmSrc *self = GST_SHM_SRC (bsrc);
+
+  self->unlocked = TRUE;
+
+  if (self->poll)
+    gst_poll_set_flushing (self->poll, TRUE);
+
+  return TRUE;
+}
+
+static gboolean
+gst_shm_src_unlock_stop (GstBaseSrc * bsrc)
+{
+  GstShmSrc *self = GST_SHM_SRC (bsrc);
+
+  self->unlocked = FALSE;
+
+  if (self->poll)
+    gst_poll_set_flushing (self->poll, FALSE);
+
+  return TRUE;
+}
+
+static void
+gst_shm_pipe_inc (GstShmPipe * pipe)
+{
+  g_return_if_fail (pipe);
+  g_return_if_fail (pipe->src);
+  g_return_if_fail (pipe->use_count > 0);
+
+  GST_OBJECT_LOCK (pipe->src);
+  pipe->use_count++;
+  GST_OBJECT_UNLOCK (pipe->src);
+}
+
+static void
+gst_shm_pipe_dec (GstShmPipe * pipe)
+{
+  g_return_if_fail (pipe);
+  g_return_if_fail (pipe->src);
+  g_return_if_fail (pipe->use_count > 0);
+
+  GST_OBJECT_LOCK (pipe->src);
+  pipe->use_count--;
+
+  if (pipe->use_count > 0) {
+    GST_OBJECT_UNLOCK (pipe->src);
+    return;
+  }
+
+  if (pipe->pipe)
+    sp_close (pipe->pipe);
+  GST_OBJECT_UNLOCK (pipe->src);
+
+  gst_object_unref (pipe->src);
+  g_slice_free (GstShmPipe, pipe);
+}
--- sys/shm/gstshmsrc.h
+++ sys/shm/gstshmsrc.h
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * 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_SHM_SRC_H__
+#define __GST_SHM_SRC_H__
+
+#include <gst/gst.h>
+#include <gst/base/gstpushsrc.h>
+#include <gst/base/gstbasesrc.h>
+
+#include "shmpipe.h"
+
+G_BEGIN_DECLS
+#define GST_TYPE_SHM_SRC \
+  (gst_shm_src_get_type())
+#define GST_SHM_SRC(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SHM_SRC,GstShmSrc))
+#define GST_SHM_SRC_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SHM_SRC,GstShmSrcClass))
+#define GST_IS_SHM_SRC(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SHM_SRC))
+#define GST_IS_SHM_SRC_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SHM_SRC))
+typedef struct _GstShmSrc GstShmSrc;
+typedef struct _GstShmSrcClass GstShmSrcClass;
+typedef struct _GstShmPipe GstShmPipe;
+
+struct _GstShmSrc
+{
+  GstPushSrc element;
+
+  gchar *socket_path;
+
+  GstShmPipe *pipe;
+  GstPoll *poll;
+  GstPollFD pollfd;
+
+
+  GstFlowReturn flow_return;
+  gboolean unlocked;
+};
+
+struct _GstShmSrcClass
+{
+  GstPushSrcClass parent_class;
+};
+
+GType gst_shm_src_get_type (void);
+
+struct _GstShmPipe {
+  int use_count;
+
+  GstShmSrc *src;
+  ShmPipe *pipe;
+};
+
+G_END_DECLS
+#endif /* __GST_SHM_SRC_H__ */
--- sys/shm/shmalloc.c
+++ sys/shm/shmalloc.c
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "shmalloc.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+/* This is the allocated space to hold multiple blocks */
+struct _ShmAllocSpace
+{
+  /* The total size of this space */
+  size_t size;
+
+  /* chained list of the blocks contained in this space */
+  ShmAllocBlock *blocks;
+};
+
+/* A single block of data */
+struct _ShmAllocBlock
+{
+  int use_count;
+
+  /* Pointer back to the AllocSpace where this block is */
+  ShmAllocSpace *space;
+
+  /* The offset of this block in the alloc space */
+  unsigned long offset;
+  /* The size of the block */
+  unsigned long size;
+
+  /* Pointer to the next block in the chain */
+  ShmAllocBlock *next;
+};
+
+
+ShmAllocSpace *
+shm_alloc_space_new (size_t size)
+{
+  ShmAllocSpace *self = spalloc_new (ShmAllocSpace);
+
+  memset (self, 0, sizeof (ShmAllocSpace));
+
+  self->size = size;
+
+  return self;
+}
+
+void
+shm_alloc_space_free (ShmAllocSpace * self)
+{
+  assert (self && self->blocks == NULL);
+  spalloc_free (ShmAllocSpace, self);
+}
+
+
+ShmAllocBlock *
+shm_alloc_space_alloc_block (ShmAllocSpace * self, unsigned long size)
+{
+  ShmAllocBlock *block;
+  ShmAllocBlock *item = NULL;
+  ShmAllocBlock *prev_item = NULL;
+  unsigned long prev_end_offset = 0;
+
+
+  for (item = self->blocks; item; item = item->next) {
+    unsigned long max_size = 0;
+
+    max_size = item->offset - prev_end_offset;
+
+    if (max_size >= size)
+      break;
+
+    prev_end_offset = item->offset + item->size;
+    prev_item = item;
+  }
+
+  /* Did not find space before an existing block */
+  if (self->blocks && !item) {
+    /* Return NULL if there is no big enough space, otherwise, there is space
+     * at the end */
+    if (self->size - prev_end_offset < size)
+      return NULL;
+  }
+
+  block = spalloc_new (ShmAllocBlock);
+  memset (block, 0, sizeof (ShmAllocBlock));
+  block->offset = prev_end_offset;
+  block->size = size;
+  block->use_count = 1;
+  block->space = self;
+
+  if (prev_item)
+    prev_item->next = block;
+  else
+    self->blocks = block;
+
+  block->next = item;
+
+  return block;
+}
+
+unsigned long
+shm_alloc_space_alloc_block_get_offset (ShmAllocBlock * block)
+{
+  return block->offset;
+}
+
+static void
+shm_alloc_space_free_block (ShmAllocBlock * block)
+{
+  ShmAllocBlock *item = NULL;
+  ShmAllocBlock *prev_item = NULL;
+  ShmAllocSpace *self = block->space;
+
+  for (item = self->blocks; item; item = item->next) {
+    if (item == block) {
+      if (prev_item)
+        prev_item->next = item->next;
+      else
+        self->blocks = item->next;
+      break;
+    }
+    prev_item = item;
+  }
+
+  spalloc_free (ShmAllocBlock, block);
+}
+
+ShmAllocBlock *
+shm_alloc_space_block_get (ShmAllocSpace * self, unsigned long offset)
+{
+  ShmAllocBlock *block = NULL;
+
+  for (block = self->blocks; block; block = block->next) {
+    if (block->offset <= offset && (block->offset + block->size) > offset)
+      return block;
+  }
+
+  return NULL;
+}
+
+
+void
+shm_alloc_space_block_inc (ShmAllocBlock * block)
+{
+  block->use_count++;
+}
+
+void
+shm_alloc_space_block_dec (ShmAllocBlock * block)
+{
+  block->use_count--;
+
+  if (block->use_count <= 0)
+    shm_alloc_space_free_block (block);
+}
--- sys/shm/shmalloc.h
+++ sys/shm/shmalloc.h
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+
+#ifndef __SHMALLOC_H__
+#define __SHMALLOC_H__
+
+#ifdef SHM_PIPE_USE_GLIB
+#include <glib.h>
+
+#define spalloc_new(type) g_slice_new (type)
+#define spalloc_alloc(size) g_slice_alloc (size)
+
+#define spalloc_free(type, buf) g_slice_free (type, buf)
+#define spalloc_free1(size, buf) g_slice_free1 (size, buf)
+
+#else
+
+#define spalloc_new(type) malloc (sizeof (type))
+#define spalloc_alloc(size) malloc (size)
+
+#define spalloc_free(type, buf) free (buf)
+#define spalloc_free1(size, buf) free (buf)
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _ShmAllocSpace ShmAllocSpace;
+typedef struct _ShmAllocBlock ShmAllocBlock;
+
+ShmAllocSpace *shm_alloc_space_new (size_t size);
+void shm_alloc_space_free (ShmAllocSpace * self);
+
+
+ShmAllocBlock *shm_alloc_space_alloc_block (ShmAllocSpace * self,
+    unsigned long size);
+unsigned long shm_alloc_space_alloc_block_get_offset (ShmAllocBlock *block);
+
+void shm_alloc_space_block_inc (ShmAllocBlock * block);
+void shm_alloc_space_block_dec (ShmAllocBlock * block);
+ShmAllocBlock * shm_alloc_space_block_get (ShmAllocSpace * space,
+    unsigned long offset);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SHMALLOC_H__ */
--- sys/shm/shmpipe.c
+++ sys/shm/shmpipe.c
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "shmpipe.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <sys/mman.h>
+#include <assert.h>
+
+#include "shmalloc.h"
+
+/*
+ * The protocol over the pipe is in packets
+ *
+ * The defined types are:
+ * type 1: new shm area
+ * Area length
+ * Size of path (followed by path)
+ *
+ * type 2: Close shm area:
+ * No payload
+ *
+ * type 3: shm buffer
+ * offset
+ * bufsize
+ *
+ * type 4: ack buffer
+ * offset
+ *
+ * Type 4 goes from the client to the server
+ * The rest are from the server to the client
+ * The client should never write in the SHM
+ */
+
+
+#define LISTEN_BACKLOG 10
+
+enum
+{
+  COMMAND_NEW_SHM_AREA = 1,
+  COMMAND_CLOSE_SHM_AREA = 2,
+  COMMAND_NEW_BUFFER = 3,
+  COMMAND_ACK_BUFFER = 4
+};
+
+typedef struct _ShmArea ShmArea;
+typedef struct _ShmBuffer ShmBuffer;
+
+struct _ShmArea
+{
+  int id;
+
+  int use_count;
+
+  int shm_fd;
+
+  char *shm_area_buf;
+  size_t shm_area_len;
+
+  char *shm_area_name;
+
+  ShmAllocSpace *allocspace;
+
+  ShmArea *next;
+};
+
+struct _ShmBuffer
+{
+  int use_count;
+
+  ShmArea *shm_area;
+  unsigned long offset;
+  size_t size;
+
+  ShmAllocBlock *ablock;
+
+  ShmBuffer *next;
+
+  int num_clients;
+  int clients[0];
+};
+
+
+struct _ShmPipe
+{
+  int main_socket;
+  char *socket_path;
+
+  ShmArea *shm_area;
+
+  int next_area_id;
+
+  ShmBuffer *buffers;
+
+  int num_clients;
+  ShmClient *clients;
+
+  mode_t perms;
+};
+
+struct _ShmClient
+{
+  int fd;
+
+  ShmClient *next;
+};
+
+struct _ShmBlock
+{
+  ShmPipe *pipe;
+  ShmArea *area;
+  ShmAllocBlock *ablock;
+};
+
+struct CommandBuffer
+{
+  unsigned int type;
+  int area_id;
+
+  union
+  {
+    struct
+    {
+      size_t size;
+      unsigned int path_size;
+      /* Followed by path */
+    } new_shm_area;
+    struct
+    {
+      unsigned long offset;
+      unsigned long size;
+    } buffer;
+    struct
+    {
+      unsigned long offset;
+    } ack_buffer;
+  } payload;
+};
+
+static ShmArea *sp_open_shm (char *path, int id, mode_t perms, size_t size);
+static void sp_close_shm (ShmArea * area);
+static int sp_shmbuf_dec (ShmPipe * self, ShmBuffer * buf,
+    ShmBuffer * prev_buf);
+static void sp_shm_area_dec (ShmPipe * self, ShmArea * area);
+
+
+
+#define RETURN_ERROR(format, ...) do {                  \
+  fprintf (stderr, format, __VA_ARGS__);                \
+  sp_close (self);                                      \
+  return NULL;                                          \
+  } while (0)
+
+ShmPipe *
+sp_writer_create (const char *path, size_t size, mode_t perms)
+{
+  ShmPipe *self = spalloc_new (ShmPipe);
+  int flags;
+  struct sockaddr_un sun;
+  int i = 0;
+
+  memset (self, 0, sizeof (ShmPipe));
+
+  self->main_socket = socket (PF_UNIX, SOCK_STREAM, 0);
+
+  if (self->main_socket < 0)
+    RETURN_ERROR ("Could not create socket (%d): %s\n", errno,
+        strerror (errno));
+
+  flags = fcntl (self->main_socket, F_GETFL, 0);
+  if (flags < 0)
+    RETURN_ERROR ("fcntl(F_GETFL) failed (%d): %s\n", errno, strerror (errno));
+
+  if (fcntl (self->main_socket, F_SETFL, flags | O_NONBLOCK | FD_CLOEXEC) < 0)
+    RETURN_ERROR ("fcntl(F_SETFL) failed (%d): %s\n", errno, strerror (errno));
+
+  sun.sun_family = AF_UNIX;
+  strncpy (sun.sun_path, path, sizeof (sun.sun_path) - 1);
+
+  while (bind (self->main_socket, (struct sockaddr *) &sun,
+          sizeof (struct sockaddr_un)) < 0) {
+    if (errno != EADDRINUSE)
+      RETURN_ERROR ("bind() failed (%d): %s\n", errno, strerror (errno));
+
+    if (i > 256)
+      RETURN_ERROR ("Could not find a free socket name for %s", path);
+
+    snprintf (sun.sun_path, sizeof (sun.sun_path), "%s.%d", path, i);
+    i++;
+  }
+
+  self->socket_path = strdup (sun.sun_path);
+
+  if (listen (self->main_socket, LISTEN_BACKLOG) < 0)
+    RETURN_ERROR ("listen() failed (%d): %s\n", errno, strerror (errno));
+
+  self->shm_area = sp_open_shm (NULL, ++self->next_area_id, perms, size);
+
+  self->perms = perms;
+
+  if (!self->shm_area)
+    RETURN_ERROR ("Could not open shm area (%d): %s", errno, strerror (errno));
+
+  return self;
+}
+
+#undef RETURN_ERROR
+
+#define RETURN_ERROR(format, ...)  do {                   \
+  fprintf (stderr, format, __VA_ARGS__);                  \
+  area->use_count--;                                      \
+  sp_close_shm (area);                                    \
+  return NULL;                                            \
+  } while (0)
+
+/**
+ * sp_open_shm:
+ * @path: Path of the shm area for a reader,
+ *  NULL if this is a writer (then it will allocate its own path)
+ *
+ * Opens a ShmArea
+ */
+
+static ShmArea *
+sp_open_shm (char *path, int id, mode_t perms, size_t size)
+{
+  ShmArea *area = spalloc_new (ShmArea);
+  char tmppath[PATH_MAX];
+  int flags;
+  int prot;
+  int i = 0;
+
+  memset (area, 0, sizeof (ShmArea));
+
+  area->use_count = 1;
+
+  area->shm_area_len = size;
+
+
+  if (path)
+    flags = O_RDONLY;
+  else
+    flags = O_RDWR | O_CREAT | O_TRUNC | O_EXCL;
+
+  area->shm_fd = -1;
+
+  if (path) {
+    area->shm_fd = shm_open (path, flags, perms);
+  } else {
+    do {
+      snprintf (tmppath, PATH_MAX, "/shmpipe.5%d.%5d", getpid (), i++);
+      area->shm_fd = shm_open (tmppath, flags, perms);
+    } while (area->shm_fd < 0 && errno == EEXIST);
+  }
+
+  if (area->shm_fd < 0)
+    RETURN_ERROR ("shm_open failed on %s (%d): %s\n",
+        path ? path : tmppath, errno, strerror (errno));
+
+  if (!path) {
+    area->shm_area_name = strdup (tmppath);
+
+    if (ftruncate (area->shm_fd, size))
+      RETURN_ERROR ("Could not resize memory area to header size,"
+          " ftruncate failed (%d): %s\n", errno, strerror (errno));
+
+    prot = PROT_READ | PROT_WRITE;
+  } else {
+    prot = PROT_READ;
+  }
+
+  area->shm_area_buf = mmap (NULL, size, prot, MAP_SHARED, area->shm_fd, 0);
+
+  if (area->shm_area_buf == MAP_FAILED)
+    RETURN_ERROR ("mmap failed (%d): %s\n", errno, strerror (errno));
+
+  area->id = id;
+
+  if (!path)
+    area->allocspace = shm_alloc_space_new (area->shm_area_len);
+
+  return area;
+}
+
+#undef RETURN_ERROR
+
+static void
+sp_close_shm (ShmArea * area)
+{
+  assert (area->use_count == 0);
+
+  if (area->allocspace)
+    shm_alloc_space_free (area->allocspace);
+
+  if (area->shm_area_buf != MAP_FAILED)
+    munmap (area->shm_area_buf, area->shm_area_len);
+
+  if (area->shm_fd >= 0)
+    close (area->shm_fd);
+
+  if (area->shm_area_name) {
+    shm_unlink (area->shm_area_name);
+    free (area->shm_area_name);
+  }
+
+  spalloc_free (ShmArea, area);
+}
+
+static void
+sp_shm_area_inc (ShmArea * area)
+{
+  area->use_count++;
+}
+
+static void
+sp_shm_area_dec (ShmPipe * self, ShmArea * area)
+{
+  assert (area->use_count > 0);
+  area->use_count--;
+
+  if (area->use_count == 0) {
+    ShmArea *item = NULL;
+    ShmArea *prev_item = NULL;
+
+    for (item = self->shm_area; item; item = item->next) {
+      if (item == area) {
+        if (prev_item)
+          prev_item->next = item->next;
+        else
+          self->shm_area = item->next;
+        break;
+      }
+      prev_item = item;
+    }
+    assert (item);
+
+    sp_close_shm (area);
+  }
+}
+
+void
+sp_close (ShmPipe * self)
+{
+  if (self->main_socket >= 0)
+    close (self->main_socket);
+
+  if (self->socket_path) {
+    unlink (self->socket_path);
+    free (self->socket_path);
+  }
+
+  while (self->clients)
+    sp_writer_close_client (self, self->clients);
+
+  while (self->shm_area)
+    sp_shm_area_dec (self, self->shm_area);
+
+  spalloc_free (ShmPipe, self);
+}
+
+int
+sp_writer_setperms_shm (ShmPipe * self, mode_t perms)
+{
+  int ret = 0;
+  ShmArea *area;
+
+  self->perms = perms;
+  for (area = self->shm_area; area; area = area->next)
+    ret |= fchmod (area->shm_fd, perms);
+
+  return ret;
+}
+
+static int
+send_command (int fd, struct CommandBuffer *cb, unsigned short int type,
+    int area_id)
+{
+  cb->type = type;
+  cb->area_id = area_id;
+
+  if (send (fd, cb, sizeof (struct CommandBuffer), MSG_NOSIGNAL) !=
+      sizeof (struct CommandBuffer))
+    return 0;
+
+  return 1;
+}
+
+int
+sp_writer_resize (ShmPipe * self, size_t size)
+{
+  ShmArea *newarea;
+  ShmArea *old_current;
+  ShmClient *client;
+  int c = 0;
+  int pathlen;
+
+  if (self->shm_area->shm_area_len == size)
+    return 0;
+
+  newarea = sp_open_shm (NULL, ++self->next_area_id, self->perms, size);
+
+  if (!newarea)
+    return -1;
+
+  old_current = self->shm_area;
+  newarea->next = self->shm_area;
+  self->shm_area = newarea;
+
+  pathlen = strlen (newarea->shm_area_name) + 1;
+
+  for (client = self->clients; client; client = client->next) {
+    struct CommandBuffer cb = { 0 };
+
+    if (!send_command (client->fd, &cb, COMMAND_CLOSE_SHM_AREA,
+            old_current->id))
+      continue;
+
+    cb.payload.new_shm_area.size = newarea->shm_area_len;
+    cb.payload.new_shm_area.path_size = pathlen;
+    if (!send_command (client->fd, &cb, COMMAND_NEW_SHM_AREA, newarea->id))
+      continue;
+
+    if (send (client->fd, newarea->shm_area_name, pathlen, MSG_NOSIGNAL) !=
+        pathlen)
+      continue;
+    c++;
+  }
+
+  sp_shm_area_dec (self, old_current);
+
+
+  return c;
+}
+
+ShmBlock *
+sp_writer_alloc_block (ShmPipe * self, size_t size)
+{
+  ShmBlock *block;
+  ShmAllocBlock *ablock =
+      shm_alloc_space_alloc_block (self->shm_area->allocspace, size);
+
+  if (!ablock)
+    return NULL;
+
+  block = spalloc_new (ShmBlock);
+  sp_shm_area_inc (self->shm_area);
+  block->pipe = self;
+  block->area = self->shm_area;
+  block->ablock = ablock;
+  return block;
+}
+
+char *
+sp_writer_block_get_buf (ShmBlock * block)
+{
+  return block->area->shm_area_buf +
+      shm_alloc_space_alloc_block_get_offset (block->ablock);
+}
+
+void
+sp_writer_free_block (ShmBlock * block)
+{
+  shm_alloc_space_block_dec (block->ablock);
+  sp_shm_area_dec (block->pipe, block->area);
+  spalloc_free (ShmBlock, block);
+}
+
+/* Returns the number of client this has successfully been sent to */
+
+int
+sp_writer_send_buf (ShmPipe * self, char *buf, size_t size)
+{
+  ShmArea *area = NULL;
+  unsigned long offset = 0;
+  unsigned long bsize = size;
+  ShmBuffer *sb;
+  ShmClient *client = NULL;
+  ShmAllocBlock *ablock = NULL;
+  int i = 0;
+  int c = 0;
+
+  if (self->num_clients == 0)
+    return 0;
+
+  for (area = self->shm_area; area; area = area->next) {
+    if (buf >= area->shm_area_buf &&
+        buf < (area->shm_area_buf + area->shm_area_len)) {
+      offset = buf - area->shm_area_buf;
+      ablock = shm_alloc_space_block_get (area->allocspace, offset);
+      assert (ablock);
+      break;
+    }
+  }
+
+  if (!ablock)
+    return -1;
+
+  sb = spalloc_alloc (sizeof (ShmBuffer) + sizeof (int) * self->num_clients);
+  memset (sb, 0, sizeof (ShmBuffer));
+  memset (sb->clients, -1, sizeof (int) * self->num_clients);
+  sb->shm_area = area;
+  sb->offset = offset;
+  sb->size = size;
+  sb->num_clients = self->num_clients;
+  sb->ablock = ablock;
+
+  for (client = self->clients; client; client = client->next) {
+    struct CommandBuffer cb = { 0 };
+    cb.payload.buffer.offset = offset;
+    cb.payload.buffer.size = bsize;
+    if (!send_command (client->fd, &cb, COMMAND_NEW_BUFFER, self->shm_area->id))
+      continue;
+    sb->clients[i++] = client->fd;
+    c++;
+  }
+
+  if (c == 0) {
+    spalloc_free1 (sizeof (ShmBuffer) + sizeof (int) * sb->num_clients, sb);
+    return 0;
+  }
+
+  sp_shm_area_inc (area);
+  shm_alloc_space_block_inc (ablock);
+
+  sb->use_count = c;
+
+  sb->next = self->buffers;
+  self->buffers = sb;
+
+  return c;
+}
+
+static int
+recv_command (int fd, struct CommandBuffer *cb)
+{
+  int retval;
+
+  retval = recv (fd, cb, sizeof (struct CommandBuffer), MSG_DONTWAIT);
+  if (retval == sizeof (struct CommandBuffer)) {
+    return 1;
+  } else {
+    return 0;
+  }
+}
+
+long int
+sp_client_recv (ShmPipe * self, char **buf)
+{
+  char *area_name = NULL;
+  ShmArea *newarea, *oldarea;
+  ShmArea *area;
+  struct CommandBuffer cb;
+  int retval;
+
+  if (!recv_command (self->main_socket, &cb))
+    return -1;
+
+  switch (cb.type) {
+    case COMMAND_NEW_SHM_AREA:
+      assert (cb.payload.new_shm_area.path_size > 0);
+      assert (cb.payload.new_shm_area.size > 0);
+
+      area_name = malloc (cb.payload.new_shm_area.path_size);
+      retval = recv (self->main_socket, area_name,
+          cb.payload.new_shm_area.path_size, 0);
+      if (retval != cb.payload.new_shm_area.path_size) {
+        free (area_name);
+        return -3;
+      }
+
+      newarea = sp_open_shm (area_name, cb.area_id, 0,
+          cb.payload.new_shm_area.size);
+      free (area_name);
+      if (!newarea)
+        return -4;
+
+      oldarea = self->shm_area;
+      newarea->next = self->shm_area;
+      self->shm_area = newarea;
+      /*
+         if (oldarea)
+         sp_shm_area_dec (self, oldarea);
+       */
+      break;
+
+    case COMMAND_CLOSE_SHM_AREA:
+      for (area = self->shm_area; area; area = area->next) {
+        if (area->id == cb.area_id) {
+          sp_shm_area_dec (self, area);
+          break;
+        }
+      }
+      break;
+
+    case COMMAND_NEW_BUFFER:
+      assert (buf);
+      for (area = self->shm_area; area; area = area->next) {
+        if (area->id == cb.area_id) {
+          *buf = area->shm_area_buf + cb.payload.buffer.offset;
+          sp_shm_area_inc (area);
+          return cb.payload.buffer.size;
+        }
+      }
+      return -23;
+
+    default:
+      return -99;
+  }
+
+  return 0;
+}
+
+int
+sp_writer_recv (ShmPipe * self, ShmClient * client)
+{
+  ShmBuffer *buf = NULL, *prev_buf = NULL;
+  struct CommandBuffer cb;
+
+  if (!recv_command (client->fd, &cb))
+    return -1;
+
+  switch (cb.type) {
+    case COMMAND_ACK_BUFFER:
+
+      for (buf = self->buffers; buf; buf = buf->next) {
+        if (buf->shm_area->id == cb.area_id &&
+            buf->offset == cb.payload.ack_buffer.offset) {
+          sp_shmbuf_dec (self, buf, prev_buf);
+          break;
+        }
+        prev_buf = buf;
+      }
+
+      if (!buf)
+        return -2;
+
+      break;
+    default:
+      return -99;
+  }
+
+  return 0;
+}
+
+int
+sp_client_recv_finish (ShmPipe * self, char *buf)
+{
+  ShmArea *shm_area = NULL;
+  unsigned long offset;
+  struct CommandBuffer cb = { 0 };
+
+  for (shm_area = self->shm_area; shm_area; shm_area = shm_area->next) {
+    if (buf >= shm_area->shm_area_buf &&
+        buf < shm_area->shm_area_buf + shm_area->shm_area_len)
+      break;
+  }
+
+  assert (shm_area);
+
+  offset = buf - shm_area->shm_area_buf;
+
+  sp_shm_area_dec (self, shm_area);
+
+  cb.payload.ack_buffer.offset = offset;
+  return send_command (self->main_socket, &cb, COMMAND_ACK_BUFFER,
+      self->shm_area->id);
+}
+
+ShmPipe *
+sp_client_open (const char *path)
+{
+  ShmPipe *self = spalloc_new (ShmPipe);
+  struct sockaddr_un sun;
+
+  memset (self, 0, sizeof (ShmPipe));
+
+  self->main_socket = socket (PF_UNIX, SOCK_STREAM, 0);
+  if (self->main_socket < 0)
+    goto error;
+
+  sun.sun_family = AF_UNIX;
+  strncpy (sun.sun_path, path, sizeof (sun.sun_path) - 1);
+
+  if (connect (self->main_socket, (struct sockaddr *) &sun,
+          sizeof (struct sockaddr_un)) < 0)
+    goto error;
+
+  return self;
+
+error:
+  sp_close (self);
+  return NULL;
+}
+
+
+ShmClient *
+sp_writer_accept_client (ShmPipe * self)
+{
+  ShmClient *client = NULL;
+  int fd;
+  struct CommandBuffer cb = { 0 };
+  int pathlen = strlen (self->shm_area->shm_area_name) + 1;
+
+
+  fd = accept (self->main_socket, NULL, NULL);
+
+  if (fd < 0) {
+    fprintf (stderr, "Could not client connection");
+    return NULL;
+  }
+
+  cb.payload.new_shm_area.size = self->shm_area->shm_area_len;
+  cb.payload.new_shm_area.path_size = pathlen;
+  if (!send_command (fd, &cb, COMMAND_NEW_SHM_AREA, self->shm_area->id)) {
+    fprintf (stderr, "Sending new shm area failed: %s", strerror (errno));
+    goto error;
+  }
+
+  if (send (fd, self->shm_area->shm_area_name, pathlen, MSG_NOSIGNAL) !=
+      pathlen) {
+    fprintf (stderr, "Sending new shm area path failed: %s", strerror (errno));
+    goto error;
+  }
+
+  client = spalloc_new (ShmClient);
+  client->fd = fd;
+
+  /* Prepend ot linked list */
+  client->next = self->clients;
+  self->clients = client;
+  self->num_clients++;
+
+  return client;
+
+error:
+  close (fd);
+  return NULL;
+}
+
+static int
+sp_shmbuf_dec (ShmPipe * self, ShmBuffer * buf, ShmBuffer * prev_buf)
+{
+  buf->use_count--;
+
+  if (buf->use_count == 0) {
+    /* Remove from linked list */
+    if (prev_buf)
+      prev_buf->next = buf->next;
+    else
+      self->buffers = buf->next;
+
+    shm_alloc_space_block_dec (buf->ablock);
+    sp_shm_area_dec (self, buf->shm_area);
+    spalloc_free1 (sizeof (ShmBuffer) + sizeof (int) * buf->num_clients, buf);
+    return 0;
+  }
+
+  return 1;
+}
+
+void
+sp_writer_close_client (ShmPipe * self, ShmClient * client)
+{
+  ShmBuffer *buffer = NULL, *prev_buf = NULL;
+  ShmClient *item = NULL, *prev_item = NULL;
+
+  close (client->fd);
+
+again:
+  for (buffer = self->buffers; buffer; buffer = buffer->next) {
+    int i;
+
+    for (i = 0; i < buffer->num_clients; i++) {
+      if (buffer->clients[i] == client->fd) {
+        buffer->clients[i] = -1;
+        if (!sp_shmbuf_dec (self, buffer, prev_buf))
+          goto again;
+        break;
+      }
+      prev_buf = buffer;
+    }
+  }
+
+  for (item = self->clients; item; item = item->next) {
+    if (item == client)
+      break;
+    prev_item = item;
+  }
+  assert (item);
+
+  if (prev_item)
+    prev_item->next = client->next;
+  else
+    self->clients = client->next;
+
+  self->num_clients--;
+
+  spalloc_free (ShmClient, client);
+}
+
+int
+sp_get_fd (ShmPipe * self)
+{
+  return self->main_socket;
+}
+
+int
+sp_writer_get_client_fd (ShmClient * client)
+{
+  return client->fd;
+}
+
+int
+sp_writer_pending_writes (ShmPipe * self)
+{
+  return (self->buffers != NULL);
+}
+
+const char *
+sp_writer_get_path (ShmPipe * pipe)
+{
+  return pipe->socket_path;
+}
--- sys/shm/shmpipe.h
+++ sys/shm/shmpipe.h
+/* GStreamer
+ * Copyright (C) <2009> Collabora Ltd
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk
+ * Copyright (C) <2009> Nokia Inc
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/*
+ * None of this code is thread safe, if you want to use it in a multi-threaded
+ * context, please protect it with a mutex.
+ *
+ * First, create a writer with sp_writer_create()
+ * And selectes() on the socket from sp_get_fd()
+ * If the socket is closed or there are errors from any function, the app
+ * should call sp_close() and assume the writer is dead
+ * The server calls sp_writer_accept_client() when there is something to read
+ * from the server fd
+ * It then needs to select() on the socket from sp_writer_get_client_fd()
+ * If it gets an error on that socket, it call sp_writer_close_client().
+ * If there is something to read, it calls sp_writer_recv().
+ *
+ * The writer allocates buffers with sp_writer_alloc_block(),
+ * writes something in the buffer (retrieved with sp_writer_block_get_buf(),
+ * then calls  sp_writer_send_buf() to send the buffer or a subsection to
+ * the other side. When it is done with the block, it calls
+ * sp_writer_free_block().
+ * If alloc fails, then the server must wait for events from the clients before
+ * trying again.
+ *
+ *
+ * The clients connect with sp_client_open()
+ * And select() on the fd from sp_get_fd() until there is something to read.
+ * Then they must read using sp_client_recv() which will return > 0 if there
+ * is a valid buffer (which is read only). It will return 0 if it is an internal
+ * message and <0 if there was an error. If there was an error, one must close
+ * it with sp_close(). If was valid buffer was received, the client must release
+ * it with sp_client_recv_finish() when it is done reading from it.
+ */
+
+
+#ifndef __SHMPIPE_H__
+#define __SHMPIPE_H__
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _ShmClient ShmClient;
+typedef struct _ShmPipe ShmPipe;
+typedef struct _ShmBlock ShmBlock;
+
+ShmPipe *sp_writer_create (const char *path, size_t size, mode_t perms);
+const char *sp_writer_get_path (ShmPipe *pipe);
+void sp_close (ShmPipe * self);
+
+int sp_writer_setperms_shm (ShmPipe * self, mode_t perms);
+int sp_writer_resize (ShmPipe * self, size_t size);
+
+int sp_get_fd (ShmPipe * self);
+int sp_writer_get_client_fd (ShmClient * client);
+
+ShmBlock *sp_writer_alloc_block (ShmPipe * self, size_t size);
+void sp_writer_free_block (ShmBlock *block);
+int sp_writer_send_buf (ShmPipe * self, char *buf, size_t size);
+char *sp_writer_block_get_buf (ShmBlock *block);
+
+ShmClient * sp_writer_accept_client (ShmPipe * self);
+void sp_writer_close_client (ShmPipe *self, ShmClient * client);
+int sp_writer_recv (ShmPipe * self, ShmClient * client);
+
+int sp_writer_pending_writes (ShmPipe * self);
+
+ShmPipe *sp_client_open (const char *path);
+long int sp_client_recv (ShmPipe * self, char **buf);
+int sp_client_recv_finish (ShmPipe * self, char *buf);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SHMPIPE_H__ */




More information about the MeeGo-commits mailing list