From: <en...@fr...> - 2006-02-07 18:55:09
|
CVS Root: /cvs/gstreamer Module: gst-template Changes by: ensonic Date: Tue Feb 07 2006 10:52:02 PST Log message: * configure.ac: allow installing to $HOME * src/gstplugin.c: (gst_plugin_template_base_init), (gst_plugin_template_init): * src/gstplugin.h: * src/gsttransform.c: (gst_plugin_template_base_init), (gst_plugin_template_class_init), (gst_plugin_template_init), (gst_plugin_template_transform_ip), (gst_plugin_template_set_property), (gst_plugin_template_get_property), (plugin_init): * src/gsttransform.h: add another template * tools/make_element: fix generator, when template (arg2) is given Modified files: gst-plugin : ChangeLog configure.ac gst-plugin/src : gstplugin.c gstplugin.h gst-plugin/tools: make_element Added files: gst-plugin/src : gsttransform.c gsttransform.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-template/gst-plugin/ChangeLog.diff?r1=1.11&r2=1.12 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-template/gst-plugin/configure.ac.diff?r1=1.12&r2=1.13 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-template/gst-plugin/src/gstplugin.c.diff?r1=1.11&r2=1.12 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-template/gst-plugin/src/gstplugin.h.diff?r1=1.8&r2=1.9 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-template/gst-plugin/src/gsttransform.c?rev=1.1&content-type=text/vnd.viewcvs-markup http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-template/gst-plugin/src/gsttransform.h?rev=1.1&content-type=text/vnd.viewcvs-markup http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-template/gst-plugin/tools/make_element.diff?r1=1.1&r2=1.2 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-template/gst-plugin/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChangeLog 23 Jan 2006 21:01:30 -0000 1.11 +++ ChangeLog 7 Feb 2006 18:51:50 -0000 1.12 @@ -1,3 +1,20 @@ +2006-02-07 Stefan Kost <en...@us...> + + * configure.ac: + allow installing to $HOME + * src/gstplugin.c: (gst_plugin_template_base_init), + (gst_plugin_template_init): + * src/gstplugin.h: + * src/gsttransform.c: (gst_plugin_template_base_init), + (gst_plugin_template_class_init), (gst_plugin_template_init), + (gst_plugin_template_transform_ip), + (gst_plugin_template_set_property), + (gst_plugin_template_get_property), (plugin_init): + * src/gsttransform.h: + add another template + * tools/make_element: + fix generator, when template (arg2) is given 2006-01-23 Tim-Philipp Müller <tim at centricular dot net> * src/gstplugin.h: Index: configure.ac RCS file: /cvs/gstreamer/gst-template/gst-plugin/configure.ac,v retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- configure.ac 13 Jan 2006 13:34:14 -0000 1.12 +++ configure.ac 7 Feb 2006 18:51:50 -0000 1.13 @@ -100,8 +100,27 @@ AC_SUBST(GSTPB_BASE_CFLAGS) AC_SUBST(GSTPB_BASE_LIBS) +dnl If we need them, we can also use the gstreamer-controller libraries +PKG_CHECK_MODULES(GSTCTRL, + gstreamer-controller-$GST_MAJORMINOR >= $GSTPB_REQUIRED, + HAVE_GSTCTRL=yes, HAVE_GSTCTRL=no) +dnl Give a warning if we don't have gstreamer-controller +dnl you can turn this into an error if you need them +if test "x$HAVE_GSTCTRL" = "xno"; then + AC_MSG_NOTICE(no GStreamer Controller libraries found (gstreamer-controller-$GST_MAJORMINOR)) +fi +dnl make _CFLAGS and _LIBS available +AC_SUBST(GSTCTRL_CFLAGS) +AC_SUBST(GSTCTRL_LIBS) dnl set the plugindir where plugins should be installed -plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR" +if test "x${prefix}" = "x$HOME"; then + plugindir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins" +else + plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR" AC_SUBST(plugindir) dnl set proper LDFLAGS for plugins Index: gstplugin.c RCS file: /cvs/gstreamer/gst-template/gst-plugin/src/gstplugin.c,v --- gstplugin.c 13 Jan 2006 13:34:14 -0000 1.11 +++ gstplugin.c 7 Feb 2006 18:51:50 -0000 1.12 @@ -1,4 +1,6 @@ -/* Copyright 2005 Thomas Vander Stichele <th...@ap...> +/* + * GStreamer + * Copyright 2005 Thomas Vander Stichele <th...@ap...> * Copyright 2005 Ronald S. Bultje <rb...@ro...> * * Permission is hereby granted, free of charge, to any person obtaining a @@ -40,6 +42,19 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-plugin + * + * <refsect2> + * <title>Example launch line</title> + * <para> + * <programlisting> + * gst-launch -v -m audiotestsrc ! plugin ! fakesink silent=TRUE + * </programlisting> + * </para> + * </refsect2> + */ #ifdef HAVE_CONFIG_H # include <config.h> #endif @@ -137,7 +152,7 @@ static void gst_plugin_template_base_init (GstPluginTemplateClass *klass) { - static GstElementDetails plugin_details = { + static GstElementDetails element_details = { "PluginTemplate", "Generic/PluginTemplate", "Generic Template Plugin", @@ -149,7 +164,7 @@ gst_static_pad_template_get (&src_factory)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_factory)); - gst_element_class_set_details (element_class, &plugin_details); + gst_element_class_set_details (element_class, &element_details); } /* initialize the plugin's class */ @@ -178,7 +193,7 @@ * initialize structure -gst_plugin_template_init (GstPluginTemplate *filter) +gst_plugin_template_init (GstPluginTemplate *filter, GstPluginTemplateClass * klass) GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter); Index: gstplugin.h RCS file: /cvs/gstreamer/gst-template/gst-plugin/src/gstplugin.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gstplugin.h 23 Jan 2006 21:01:31 -0000 1.8 +++ gstplugin.h 7 Feb 2006 18:51:50 -0000 1.9 --- NEW FILE: gsttransform.c --- /* * GStreamer * Copyright (C) 2006 Stefan Kost <en...@us...> * * 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. */ /** * SECTION:element-plugin * <refsect2> * <title>Example launch line</title> * <para> * <programlisting> * gst-launch -v -m audiotestsrc ! plugin ! fakesink silent=TRUE * </programlisting> * </para> * </refsect2> #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <string.h> #include <gst/gst.h> #include <gst/base/gstbasetransform.h> #include <gst/audio/audio.h> #include <gst/controller/gstcontroller.h> #include "gstplugin.h" GST_DEBUG_CATEGORY (plugin_debug); /* Filter signals and args */ enum { /* FILL ME */ LAST_SIGNAL }; PROP_0, PROP_SILENT, static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ( "sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("ANY") ); static GstStaticPadTemplate src_template = "src", GST_PAD_SRC, #define DEBUG_INIT(bla) \ GST_DEBUG_CATEGORY_INIT (plugin_debug, "plugin", 0, "plugin template element"); GST_BOILERPLATE_FULL (GstPluginTemplate, gst_plugin_template, GstBaseTransform, GST_TYPE_BASE_TRANSFORM, DEBUG_INIT); static void gst_plugin_template_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_plugin_template_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstFlowReturn gst_plugin_template_transform_ip (GstBaseTransform * base, GstBuffer * outbuf); static void gst_plugin_template_base_init (gpointer klass) { static GstElementDetails element_details = { "PluginTemplate", "Generic/PluginTemplate", "Generic Template Plugin", "Stefan Kost <en...@us...>" }; GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&src_template)); gst_static_pad_template_get (&sink_template)); gst_element_class_set_details (element_class, &element_details); } gst_plugin_template_class_init (GstPluginTemplateClass * klass) GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; gobject_class->set_property = gst_plugin_template_set_property; gobject_class->get_property = gst_plugin_template_get_property; g_object_class_install_property (gobject_class, PROP_SILENT, g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?", FALSE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); GST_BASE_TRANSFORM_CLASS (klass)->transform_ip = GST_DEBUG_FUNCPTR (gst_plugin_template_transform_ip); gst_plugin_template_init (GstPluginTemplate *filter, GstPluginTemplateClass * klass) filter->silent = FALSE; /* GstBaseTransform vmethod implementations */ /* this function does the actual processing static GstFlowReturn gst_plugin_template_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) GstPluginTemplate *filter = GST_PLUGIN_TEMPLATE (base); if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (outbuf))) gst_object_sync_values (G_OBJECT (filter), GST_BUFFER_TIMESTAMP (outbuf)); if (filter->silent == FALSE) g_print ("I'm plugged, therefore I'm in.\n"); return GST_FLOW_OK; gst_plugin_template_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) GstPluginTemplate *filter; g_return_if_fail (GST_IS_PLUGIN_TEMPLATE (object)); filter = GST_PLUGIN_TEMPLATE (object); switch (prop_id) { case PROP_SILENT: filter->silent = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } gst_plugin_template_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) g_value_set_boolean (value, filter->silent); static gboolean plugin_init (GstPlugin * plugin) /* initialize gst controller library */ gst_controller_init(NULL, NULL); return gst_element_register (plugin, "plugin", GST_RANK_NONE, GST_TYPE_PLUGIN_TEMPLATE); GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin", "Template plugin", plugin_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/" ) --- NEW FILE: gsttransform.h --- /* #ifndef __GST_PLUGIN_TEMPLATE_H__ #define __GST_PLUGIN_TEMPLATE_H__ G_BEGIN_DECLS #define GST_TYPE_PLUGIN_TEMPLATE \ (gst_plugin_template_get_type()) #define GST_PLUGIN_TEMPLATE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTemplate)) #define GST_PLUGIN_TEMPLATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTemplateClass)) #define GST_IS_PLUGIN_TEMPLATE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLUGIN_TEMPLATE)) #define GST_IS_PLUGIN_TEMPLATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLUGIN_TEMPLATE)) typedef struct _GstPluginTemplate GstPluginTemplate; typedef struct _GstPluginTemplateClass GstPluginTemplateClass; struct _GstPluginTemplate { GstBaseTransform element; gboolean silent; struct _GstPluginTemplateClass { GstBaseTransformClass parent_class; GType gst_plugin_template_get_type (void); G_END_DECLS #endif /* __GST_PLUGIN_TEMPLATE_H__ */ Index: make_element RCS file: /cvs/gstreamer/gst-template/gst-plugin/tools/make_element,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- make_element 15 Jan 2004 23:30:20 -0000 1.1 +++ make_element 7 Feb 2006 18:51:50 -0000 1.2 @@ -1,7 +1,8 @@ #!/bin/sh Template=$1; -srcfile=$2; +srcfile=$2.c; +srcfile_h=$2.h; if test x"$1" = x ; then echo "$0 Objectname [srcfile]\n"; |