Commit a7a372c3 authored by Stefan Kost's avatar Stefan Kost

configure.ac: allow installing to $HOME

Original commit message from CVS:
* 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
parent d658c57f
common @ 58567e55
Subproject commit bc4325349e8d0ec90aa5c5e74566880cc2e82527
Subproject commit 58567e5519f2d00a4592491db1a6e8302993279e
2006-02-07 Stefan Kost <ensonic@users.sf.net>
* 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:
......
......@@ -100,8 +100,27 @@ dnl make _CFLAGS and _LIBS available
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"
fi
AC_SUBST(plugindir)
dnl set proper LDFLAGS for plugins
......
/* Copyright 2005 Thomas Vander Stichele <thomas@apestaart.org>
/*
* GStreamer
* Copyright 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
*
* 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 @@ gst_gst_plugin_template_get_type (void)
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_plugin_template_base_init (GstPluginTemplateClass *klass)
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 @@ gst_plugin_template_class_init (GstPluginTemplateClass *klass)
* initialize structure
*/
static void
gst_plugin_template_init (GstPluginTemplate *filter)
gst_plugin_template_init (GstPluginTemplate *filter, GstPluginTemplateClass * klass)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter);
......
/* Copyright 2005 Thomas Vander Stichele <thomas@apestaart.org>
/*
* GStreamer
* Copyright 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
*
* Permission is hereby granted, free of charge, to any person obtaining a
......
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <ensonic@users.sf.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* 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
};
enum {
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 =
GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("ANY")
);
#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 <ensonic@users.sf.net>"
};
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_template));
gst_element_class_set_details (element_class, &element_details);
}
static void
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);
}
static void
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;
}
static void
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);
break;
}
}
static void
gst_plugin_template_get_property (GObject * object, guint prop_id,
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:
g_value_set_boolean (value, filter->silent);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
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/"
)
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <ensonic@users.sf.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_PLUGIN_TEMPLATE_H__
#define __GST_PLUGIN_TEMPLATE_H__
#include <gst/gst.h>
#include <gst/base/gstbasetransform.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__ */
#!/bin/sh
Template=$1;
srcfile=$2;
srcfile=$2.c;
srcfile_h=$2.h;
if test x"$1" = x ; then
echo "$0 Objectname [srcfile]\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment