summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--README8
m---------common0
-rw-r--r--gst-app/AUTHORS1
-rw-r--r--gst-app/ChangeLog3
-rw-r--r--gst-app/Makefile.am3
-rw-r--r--gst-app/NEWS1
-rw-r--r--gst-app/README18
-rwxr-xr-xgst-app/autogen.sh14
-rw-r--r--gst-app/configure.ac55
-rw-r--r--gst-app/src/Makefile.am14
-rw-r--r--gst-app/src/gst-app.h1
-rw-r--r--gst-app/src/load.c40
-rw-r--r--gst-app/src/load.h9
-rw-r--r--gst-app/src/main.c29
-rw-r--r--gst-plugin/AUTHORS1
-rw-r--r--gst-plugin/ChangeLog3
-rw-r--r--gst-plugin/Makefile.am3
-rw-r--r--gst-plugin/NEWS1
-rw-r--r--gst-plugin/README12
-rwxr-xr-xgst-plugin/autogen.sh14
-rw-r--r--gst-plugin/configure.ac55
-rw-r--r--gst-plugin/src/Makefile.am16
-rw-r--r--gst-plugin/src/gstplugin.c262
-rw-r--r--gst-plugin/src/gstplugin.h47
25 files changed, 613 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..1ba590b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "common"]
+ path = common
+ url = git://anongit.freedesktop.org/gstreamer/common
diff --git a/README b/README
new file mode 100644
index 0000000..c779ddb
--- /dev/null
+++ b/README
@@ -0,0 +1,8 @@
+This CVS module contains template code for possible GStreamer projects.
+
+
+gst-app
+ basic autotools layout for writing a GStreamer-based application
+
+gst-plugin
+ basic autotools layout for writing a GStreamer plug-in
diff --git a/common b/common
new file mode 160000
+Subproject 316e406cd246e8cbccdf4df4ce32e98c63d7cc7
diff --git a/gst-app/AUTHORS b/gst-app/AUTHORS
new file mode 100644
index 0000000..1bb7449
--- /dev/null
+++ b/gst-app/AUTHORS
@@ -0,0 +1 @@
+Thomas Vander Stichele <thomas@apestaart.org>
diff --git a/gst-app/ChangeLog b/gst-app/ChangeLog
new file mode 100644
index 0000000..02d2786
--- /dev/null
+++ b/gst-app/ChangeLog
@@ -0,0 +1,3 @@
+2002-07-17 Thomas Vander Stichele <thomas@apestaart.org>
+
+ * initial creation on a flight to New York
diff --git a/gst-app/Makefile.am b/gst-app/Makefile.am
new file mode 100644
index 0000000..43340e8
--- /dev/null
+++ b/gst-app/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS=src
+
+EXTRA_DIST=depcomp
diff --git a/gst-app/NEWS b/gst-app/NEWS
new file mode 100644
index 0000000..3474a99
--- /dev/null
+++ b/gst-app/NEWS
@@ -0,0 +1 @@
+Nothing much yet.
diff --git a/gst-app/README b/gst-app/README
new file mode 100644
index 0000000..77751cd
--- /dev/null
+++ b/gst-app/README
@@ -0,0 +1,18 @@
+gst-app is a template for writing your own GStreamer-based app.
+
+The code is deliberately kept simple so that you quickly understand the basics
+of how to set up autotools and your source tree.
+
+This template demonstrates :
+- what to do in autogen.sh
+- how to setup configure.ac (your package name and version, GStreamer flags)
+- how to setup your source dir
+ - main () and main header
+ - supporting source code
+ - Makefile.am
+
+The template performs one simple function : loading a pipeline from xml and
+start to iterate it. Try saving a pipeline from gst-editor, it will play
+with this sample program.
+
+More features might get added to this template later on.
diff --git a/gst-app/autogen.sh b/gst-app/autogen.sh
new file mode 100755
index 0000000..4cc32bc
--- /dev/null
+++ b/gst-app/autogen.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+if test -z $AUTOCONF; then export AUTOCONF=autoconf-2.53; fi
+if test -z $AUTOMAKE; then
+ export AUTOMAKE=automake-1.5
+ export ACLOCAL=aclocal-1.5
+fi
+set -x
+$ACLOCAL &&
+libtoolize --force && \
+# autoheader
+$AUTOCONF && \
+$AUTOMAKE -a && \
+./configure
+
diff --git a/gst-app/configure.ac b/gst-app/configure.ac
new file mode 100644
index 0000000..c7f21cb
--- /dev/null
+++ b/gst-app/configure.ac
@@ -0,0 +1,55 @@
+AC_INIT
+
+dnl Fill in your package name and version here
+PACKAGE=gst-app
+VERSION=0.1.0
+
+dnl these AC_DEFINE_UNQUOTED's are necessary for make dist to work
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AC_DEFINE_UNQUOTED(RELEASE, "$RELEASE")
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+AC_SUBST(RELEASE)
+
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+dnl Check for pkgconfig first
+AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
+
+dnl Give error and exit if we don't have pkgconfig
+if test "x$HAVE_PKGCONFIG" = "xno"; then
+ AC_MSG_ERROR(you need to have pkgconfig installed !)
+fi
+
+dnl Now we're ready to ask for gstreamer libs and cflags
+dnl And we can also ask for the right version of gstreamer
+PKG_CHECK_MODULES(GST, gstreamer >= 0.4.0, HAVE_GST=yes, HAVE_GST=no)
+
+dnl Give error and exit if we don't have gstreamer
+if test "x$HAVE_GST" = "xno"; then
+ AC_MSG_ERROR(you need gstreamer development packages installed !)
+fi
+
+dnl make GST_CFLAGS and GST_LIBS available
+AC_SUBST(GST_CFLAGS)
+AC_SUBST(GST_LIBS)
+
+dnl If we need them, we can also use the plugin libraries
+PKG_CHECK_MODULES(GST_LIBS, gstreamer-libs >= 0.4.0,
+ HAVE_GST_LIBS=yes, HAVE_GST_LIBS=no)
+
+dnl Give a warning if we don't have gstreamer libs
+if test "x$HAVE_GST_LIBS" = "xno"; then
+ AC_MSG_NOTICE(no GStreamer plugin libs found)
+fi
+
+dnl make GST_LIBS_CFLAGS and GST_LIBS_LIBS available
+AC_SUBST(GST_LIBS_CFLAGS)
+AC_SUBST(GST_LIBS_LIBS)
+
+AC_OUTPUT(Makefile src/Makefile)
+
diff --git a/gst-app/src/Makefile.am b/gst-app/src/Makefile.am
new file mode 100644
index 0000000..8385fad
--- /dev/null
+++ b/gst-app/src/Makefile.am
@@ -0,0 +1,14 @@
+# name of your binary
+bin_PROGRAMS = gst-app
+
+# list of source files
+# the prefix is the name of the binary
+gst_app_SOURCES = main.c load.c
+
+# list of headers we're not going to install
+noinst_HEADERS = gst-app.h load.h
+
+# our CFLAGS and LDFLAGS used for compiling and linking
+# make sure you prefix these with the name of your binary
+gst_app_CFLAGS = $(GST_CFLAGS)
+gst_app_LDFLAGS = $(GST_LIBS)
diff --git a/gst-app/src/gst-app.h b/gst-app/src/gst-app.h
new file mode 100644
index 0000000..43f8ce4
--- /dev/null
+++ b/gst-app/src/gst-app.h
@@ -0,0 +1 @@
+#include "load.h"
diff --git a/gst-app/src/load.c b/gst-app/src/load.c
new file mode 100644
index 0000000..e41ab3b
--- /dev/null
+++ b/gst-app/src/load.c
@@ -0,0 +1,40 @@
+/*
+ * GStreamer gst-app template
+ * load.c : load a pipeline from disk
+ */
+
+#include <gst/gst.h>
+
+/*
+ * load an xml pipeline description and parse it
+ * Returns: the top-level element, or NULL if unable to parse
+ */
+
+GstElement *
+gst_app_pipeline_load (const gchar *filename)
+{
+ GstXML *xml;
+ GList *l;
+
+ xml = gst_xml_new ();
+ if (gst_xml_parse_file (xml, filename, NULL) != TRUE)
+ {
+ g_warning ("Error loading pipeline from file '%s'\n", filename);
+ return NULL;
+ }
+
+ l = gst_xml_get_topelements (xml);
+ if (l == NULL)
+ {
+ g_warning ("No toplevel element in file '%s'\n", filename);
+ return NULL;
+ }
+ if (l->next != NULL)
+ {
+ g_warning ("More than one toplevel element in file '%s'\n", filename);
+ return NULL;
+ }
+
+ return GST_ELEMENT (l->data);
+}
+
diff --git a/gst-app/src/load.h b/gst-app/src/load.h
new file mode 100644
index 0000000..374d45d
--- /dev/null
+++ b/gst-app/src/load.h
@@ -0,0 +1,9 @@
+/*
+ * GStreamer gst-app template
+ * load.h : load a pipeline from disk
+ */
+
+#include <gst/gst.h>
+
+GstElement * gst_app_pipeline_load (const gchar *filename);
+
diff --git a/gst-app/src/main.c b/gst-app/src/main.c
new file mode 100644
index 0000000..07afe3f
--- /dev/null
+++ b/gst-app/src/main.c
@@ -0,0 +1,29 @@
+#include "gst-app.h"
+
+int
+main (int argc, char *argv[])
+{
+ gchar *filename;
+ GstElement *pipeline;
+
+ gst_init (&argc, &argv);
+
+ if (argc <= 1)
+ g_error ("Please supply an xml file describing a pipeline !\n");
+
+ filename = g_strdup_printf ("%s", argv[1]);
+ pipeline = gst_app_pipeline_load (filename);
+ if (pipeline == NULL)
+ {
+ g_warning ("Could not get a usable pipeline from file '%s'\n", filename);
+ return 1;
+ }
+
+ gst_element_set_state (pipeline, GST_STATE_PLAYING);
+ while (gst_bin_iterate (GST_BIN (pipeline)))
+ g_print ("+");
+
+ g_print ("\n");
+
+ return 0;
+}
diff --git a/gst-plugin/AUTHORS b/gst-plugin/AUTHORS
new file mode 100644
index 0000000..1bb7449
--- /dev/null
+++ b/gst-plugin/AUTHORS
@@ -0,0 +1 @@
+Thomas Vander Stichele <thomas@apestaart.org>
diff --git a/gst-plugin/ChangeLog b/gst-plugin/ChangeLog
new file mode 100644
index 0000000..02d2786
--- /dev/null
+++ b/gst-plugin/ChangeLog
@@ -0,0 +1,3 @@
+2002-07-17 Thomas Vander Stichele <thomas@apestaart.org>
+
+ * initial creation on a flight to New York
diff --git a/gst-plugin/Makefile.am b/gst-plugin/Makefile.am
new file mode 100644
index 0000000..43340e8
--- /dev/null
+++ b/gst-plugin/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS=src
+
+EXTRA_DIST=depcomp
diff --git a/gst-plugin/NEWS b/gst-plugin/NEWS
new file mode 100644
index 0000000..3474a99
--- /dev/null
+++ b/gst-plugin/NEWS
@@ -0,0 +1 @@
+Nothing much yet.
diff --git a/gst-plugin/README b/gst-plugin/README
new file mode 100644
index 0000000..e800f09
--- /dev/null
+++ b/gst-plugin/README
@@ -0,0 +1,12 @@
+gst-plugin is a template for writing your own GStreamer plug-in.
+
+The code is deliberately kept simple so that you quickly understand the basics
+of how to set up autotools and your source tree.
+
+This template demonstrates :
+- what to do in autogen.sh
+- how to setup configure.ac (your package name and version, GStreamer flags)
+- how to setup your source dir
+- what to put in Makefile.am
+
+More features might get added to this template later on.
diff --git a/gst-plugin/autogen.sh b/gst-plugin/autogen.sh
new file mode 100755
index 0000000..4cc32bc
--- /dev/null
+++ b/gst-plugin/autogen.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+if test -z $AUTOCONF; then export AUTOCONF=autoconf-2.53; fi
+if test -z $AUTOMAKE; then
+ export AUTOMAKE=automake-1.5
+ export ACLOCAL=aclocal-1.5
+fi
+set -x
+$ACLOCAL &&
+libtoolize --force && \
+# autoheader
+$AUTOCONF && \
+$AUTOMAKE -a && \
+./configure
+
diff --git a/gst-plugin/configure.ac b/gst-plugin/configure.ac
new file mode 100644
index 0000000..0130e7e
--- /dev/null
+++ b/gst-plugin/configure.ac
@@ -0,0 +1,55 @@
+AC_INIT
+
+dnl Fill in your package name and version here
+PACKAGE=gst-plugin
+VERSION=0.1.0
+
+dnl these AC_DEFINE_UNQUOTED's are necessary for make dist to work
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AC_DEFINE_UNQUOTED(RELEASE, "$RELEASE")
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+AC_SUBST(RELEASE)
+
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+dnl Check for pkgconfig first
+AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
+
+dnl Give error and exit if we don't have pkgconfig
+if test "x$HAVE_PKGCONFIG" = "xno"; then
+ AC_MSG_ERROR(you need to have pkgconfig installed !)
+fi
+
+dnl Now we're ready to ask for gstreamer libs and cflags
+dnl And we can also ask for the right version of gstreamer
+PKG_CHECK_MODULES(GST, gstreamer >= 0.4.0, HAVE_GST=yes, HAVE_GST=no)
+
+dnl Give error and exit if we don't have gstreamer
+if test "x$HAVE_GST" = "xno"; then
+ AC_MSG_ERROR(you need gstreamer development packages installed !)
+fi
+
+dnl make GST_CFLAGS and GST_LIBS available
+AC_SUBST(GST_CFLAGS)
+AC_SUBST(GST_LIBS)
+
+dnl If we need them, we can also use the plugin libraries
+PKG_CHECK_MODULES(GST_LIBS, gstreamer-libs >= 0.4.0,
+ HAVE_GST_LIBS=yes, HAVE_GST_LIBS=no)
+
+dnl Give a warning if we don't have gstreamer libs
+if test "x$HAVE_GST_LIBS" = "xno"; then
+ AC_MSG_NOTICE(no GStreamer plugin libs found)
+fi
+
+dnl make GST_LIBS_CFLAGS and GST_LIBS_LIBS available
+AC_SUBST(GST_LIBS_CFLAGS)
+AC_SUBST(GST_LIBS_LIBS)
+
+AC_OUTPUT(Makefile src/Makefile)
+
diff --git a/gst-plugin/src/Makefile.am b/gst-plugin/src/Makefile.am
new file mode 100644
index 0000000..09bcc8b
--- /dev/null
+++ b/gst-plugin/src/Makefile.am
@@ -0,0 +1,16 @@
+# location where plug-in will be installed
+plugindir= $(libdir)/gst
+
+# change libgstplugin.la to something more suitable
+plugin_LTLIBRARIES = libgstplugin.la
+
+# sources used to compile this plug-in
+libgstvolume_la_SOURCES = gstplugin.c
+
+# flags used to compile this plugin
+# we use the GST_LIBS flags because we might be using plug-in libs
+libgstvolume_la_CFLAGS = $(GST_LIBS_CFLAGS)
+libgstvolume_la_LDFLAGS = $(GST_LIBS_LDFLAGS)
+
+# headers we need but don't want installed
+noinst_HEADERS = gstplugin.h
diff --git a/gst-plugin/src/gstplugin.c b/gst-plugin/src/gstplugin.c
new file mode 100644
index 0000000..934911c
--- /dev/null
+++ b/gst-plugin/src/gstplugin.c
@@ -0,0 +1,262 @@
+/*
+ *
+ * GStreamer
+ * Copyright (C) 1999-2001 Erik Walthinsen <omega@cse.ogi.edu>
+ *
+ * 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.
+ */
+
+#include <string.h>
+#include <gst/gst.h>
+#include <gst/audio/audio.h>
+#include <gst/control/control.h>
+#include "gstplugin.h"
+
+
+
+static GstElementDetails plugin_details = {
+ "Plugin",
+ "Generic/Plugin",
+ "Generic Template Plugin",
+ VERSION,
+ "Thomas Vander Stichele <thomas@apestaart.org>",
+ "(C) 2002"
+};
+
+
+/* Filter signals and args */
+enum {
+ /* FILL ME */
+ LAST_SIGNAL
+};
+
+enum {
+ ARG_0,
+ ARG_SILENT,
+};
+
+GST_PAD_TEMPLATE_FACTORY (plugin_sink_factory,
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ NULL /* no caps */
+);
+
+GST_PAD_TEMPLATE_FACTORY (plugin_src_factory,
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ NULL /* no caps */
+);
+
+static void plugin_class_init (GstPluginClass *klass);
+static void plugin_init (GstPlugin *filter);
+
+static void plugin_set_property (GObject *object, guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void plugin_get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec);
+
+static void plugin_update_plugin (const GValue *value, gpointer data);
+static void plugin_update_mute (const GValue *value, gpointer data);
+
+static void plugin_chain (GstPad *pad, GstBuffer *buf);
+
+static GstElementClass *parent_class = NULL;
+
+/* this function handles the connection with other plug-ins */
+static GstPadConnectReturn
+plugin_connect (GstPad *pad, GstCaps *caps)
+{
+ GstPlugin *filter;
+ GstPad *otherpad;
+
+ filter = GST_PLUGIN (gst_pad_get_parent (pad));
+ g_return_val_if_fail (filter != NULL, GST_PAD_CONNECT_REFUSED);
+ g_return_val_if_fail (GST_IS_PLUGIN (filter), GST_PAD_CONNECT_REFUSED);
+ otherpad = (pad == filter->srcpad ? filter->sinkpad : filter->srcpad);
+
+ if (GST_CAPS_IS_FIXED (caps))
+ {
+ /* caps are not fixed, so try to connect on the other side and see if
+ * that works */
+
+ if (!gst_pad_try_set_caps (otherpad, caps))
+ return GST_PAD_CONNECT_REFUSED;
+
+ /* caps on other side were accepted, so we're ok */
+ return GST_PAD_CONNECT_OK;
+ }
+ /* not enough information yet, delay negotation */
+ return GST_PAD_CONNECT_DELAYED;
+}
+
+GType
+gst_plugin_get_type (void)
+{
+ static GType plugin_type = 0;
+
+ if (!plugin_type)
+ {
+ static const GTypeInfo plugin_info =
+ {
+ sizeof (GstPluginClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) plugin_class_init,
+ NULL,
+ NULL,
+ sizeof (GstPlugin),
+ 0,
+ (GInstanceInitFunc) plugin_init,
+ };
+ plugin_type = g_type_register_static (GST_TYPE_ELEMENT, "GstPlugin",
+ &plugin_info, 0);
+ }
+ return plugin_type;
+}
+
+static void
+plugin_class_init (GstPluginClass *klass)
+{
+ GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
+
+ gobject_class = (GObjectClass*) klass;
+ gstelement_class = (GstElementClass*) klass;
+
+ parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
+
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MUTE,
+ g_param_spec_boolean ("silent", "silent", "silent",
+ FALSE, G_PARAM_READWRITE));
+
+ gobject_class->set_property = plugin_set_property;
+ gobject_class->get_property = plugin_get_property;
+}
+
+/* initialize the new plug-in
+ * instantiate pads and add them to plug-in
+ * set functions
+ * initialize structure
+ */
+static void
+plugin_init (GstPlugin *filter)
+{
+ filter->sinkpad = gst_pad_new_from_template (plugin_sink_factory (), "sink");
+ gst_pad_set_connect_function (filter->sinkpad, plugin_connect);
+ filter->srcpad = gst_pad_new_from_template (plugin_src_factory (), "src");
+ gst_pad_set_connect_function (filter->srcpad, plugin_connect);
+
+ gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
+ gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
+ gst_pad_set_chain_function (filter->sinkpad, plugin_chain);
+ filter->silent = FALSE;
+
+}
+
+/* chain function
+ * this function does the actual processing
+ */
+
+static void
+plugin_chain (GstPad *pad, GstBuffer *buf)
+{
+ GstPlugin *filter;
+ GstBuffer *out_buf;
+ gfloat *data;
+ gint i, num_samples;
+
+ g_return_if_fail (GST_IS_PAD (pad));
+ g_return_if_fail (buf != NULL);
+
+ filter = GST_PLUGIN (GST_OBJECT_PARENT (pad));
+ g_return_if_fail (GST_IS_PLUGIN (filter));
+
+ if (filter->silent == FALSE)
+ g_print ("I'm plugged, therefore I'm in.\n");
+
+ /* just push out the incoming buffer without touching it */
+ gst_pad_push (filter->srcpad, buf);
+}
+
+static void
+plugin_set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ GstPlugin *filter;
+
+ g_return_if_fail (GST_IS_PLUGIN (object));
+ filter = GST_PLUGIN (object);
+
+ switch (prop_id)
+ {
+ case ARG_SILENT:
+ filter->silent = g_value_get_boolean (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+plugin_get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec)
+{
+ GstPlugin *filter;
+
+ g_return_if_fail (GST_IS_PLUGIN (object));
+ filter = GST_PLUGIN (object);
+
+ switch (prop_id) {
+ case ARG_SILENT:
+ g_value_set_boolean (value, filter->silent);
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+/* initialize the plugin
+ * register the element factories and pad templates
+ * register the features
+ */
+static gboolean
+plugin_init (GModule *module, GstPlugin *plugin)
+{
+ GstElementFactory *factory;
+
+ factory = gst_element_factory_new ("plugin", GST_TYPE_PLUGIN,
+ &plugin_details);
+ g_return_val_if_fail (factory != NULL, FALSE);
+
+ gst_element_factory_add_pad_template (factory, plugin_src_factory ());
+ gst_element_factory_add_pad_template (factory, plugin_sink_factory ());
+
+ gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
+
+ /* plugin initialisation succeeded */
+ return TRUE;
+}
+
+GstPluginDesc plugin_desc = {
+ GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "plugin",
+ plugin_init
+};
diff --git a/gst-plugin/src/gstplugin.h b/gst-plugin/src/gstplugin.h
new file mode 100644
index 0000000..e79d985
--- /dev/null
+++ b/gst-plugin/src/gstplugin.h
@@ -0,0 +1,47 @@
+/*
+ * gstplugin.h: sample header file for plug-in
+ */
+
+#ifndef __GST_PLUGIN_H__
+#define __GST_PLUGIN_H__
+
+#include <gst/gst.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#define GST_TYPE_PLUGIN \
+ (gst_plugin_get_type())
+#define GST_PLUGIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLUGIN,GstPlugin))
+#define GST_PLUGIN_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ULAW,GstPlugin))
+#define GST_IS_PLUGIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLUGIN))
+#define GST_IS_PLUGIN_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLUGIN))
+
+typedef struct _GstPlugin GstPlugin;
+typedef struct _GstPluginClass GstPluginClass;
+
+struct _GstPlugin {
+ GstElement element;
+
+ GstPad *sinkpad, *srcpad;
+
+ gboolean silent;
+};
+
+struct _GstPluginClass {
+ GstElementClass parent_class;
+};
+
+GType gst_plugin_get_type(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GST_PLUGIN_H__ */