From 3511b2772b3e5d7d299e8eac9105672079a8c1da Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 11 Aug 2008 14:51:58 +0000 Subject: [PATCH] gst-libs/gst/audio/: Move audiofiltertemplate to gst-template. Original commit message from CVS: * gst-libs/gst/audio/.cvsignore: * gst-libs/gst/audio/Makefile.am: * gst-libs/gst/audio/gstaudiofiltertemplate.c: * gst-libs/gst/audio/make_filter: Move audiofiltertemplate to gst-template. --- ChangeLog | 8 + gst-libs/gst/audio/.gitignore | 1 - gst-libs/gst/audio/Makefile.am | 11 +- gst-libs/gst/audio/gstaudiofiltertemplate.c | 262 ---------------------------- gst-libs/gst/audio/make_filter | 42 ----- 5 files changed, 9 insertions(+), 315 deletions(-) delete mode 100644 gst-libs/gst/audio/gstaudiofiltertemplate.c delete mode 100755 gst-libs/gst/audio/make_filter diff --git a/ChangeLog b/ChangeLog index 480a3ac..4b03d38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-08-11 Stefan Kost + * gst-libs/gst/audio/.cvsignore: + * gst-libs/gst/audio/Makefile.am: + * gst-libs/gst/audio/gstaudiofiltertemplate.c: + * gst-libs/gst/audio/make_filter: + Move audiofiltertemplate to gst-template. + +2008-08-11 Stefan Kost + * docs/libs/gst-plugins-base-libs-sections.txt: * gst-libs/gst/audio/gstaudiosrc.h: More docs and shuffling. What can we do with the hundreds of #defines. diff --git a/gst-libs/gst/audio/.gitignore b/gst-libs/gst/audio/.gitignore index 23bff76..5480c97 100644 --- a/gst-libs/gst/audio/.gitignore +++ b/gst-libs/gst/audio/.gitignore @@ -1,4 +1,3 @@ -gstaudiofilterexample.c libgstaudio_la-multichannel-enumtypes.lo multichannel-enumtypes.c multichannel-enumtypes.h diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am index a748547..14306dd 100644 --- a/gst-libs/gst/audio/Makefile.am +++ b/gst-libs/gst/audio/Makefile.am @@ -11,9 +11,7 @@ lib_LTLIBRARIES = \ libgstaudio-@GST_MAJORMINOR@.la noinst_LTLIBRARIES = libgstaudiofilterexample.la -EXTRA_DIST = gstaudiofiltertemplate.c make_filter -CLEANFILES = gstaudiofilterexample.c \ - $(BUILT_SOURCES) +CLEANFILES = $(BUILT_SOURCES) libgstaudio_@GST_MAJORMINOR@_la_SOURCES = \ audio.c \ @@ -49,13 +47,6 @@ libgstaudio_@GST_MAJORMINOR@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) \ $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-@GST_MAJORMINOR@.la libgstaudio_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) -libgstaudiofilterexample_la_SOURCES = gstaudiofilterexample.c -libgstaudiofilterexample_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) -libgstaudiofilterexample_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - -gstaudiofilterexample.c: $(srcdir)/make_filter $(srcdir)/gstaudiofiltertemplate.c - $(srcdir)/make_filter AudioFilterExample $(srcdir)/gstaudiofiltertemplate.c - noinst_PROGRAMS = testchannels testchannels_SOURCES = testchannels.c testchannels_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) diff --git a/gst-libs/gst/audio/gstaudiofiltertemplate.c b/gst-libs/gst/audio/gstaudiofiltertemplate.c deleted file mode 100644 index 0749fb5..0000000 --- a/gst-libs/gst/audio/gstaudiofiltertemplate.c +++ /dev/null @@ -1,262 +0,0 @@ -/* GStreamer - * Copyright (C) <1999> Erik Walthinsen - * Copyright (C) <2003> David Schleef - * - * 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. - */ - -/* - * This file was (probably) generated from - * $Id$ - * and - * MAKEFILTERVERSION - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -GST_DEBUG_CATEGORY_STATIC (audio_filter_template_debug); -#define GST_CAT_DEFAULT audio_filter_template_debug - -static const GstElementDetails audio_filter_template_details = -GST_ELEMENT_DETAILS ("Audio filter template", - "Filter/Effect/Audio", - "Filters audio", - "David Schleef "); - -typedef struct _GstAudioFilterTemplate GstAudioFilterTemplate; -typedef struct _GstAudioFilterTemplateClass GstAudioFilterTemplateClass; - -#define GST_TYPE_AUDIO_FILTER_TEMPLATE \ - (gst_audio_filter_template_get_type()) -#define GST_AUDIO_FILTER_TEMPLATE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplate)) -#define GST_AUDIO_FILTER_TEMPLATE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplateClass)) -#define GST_IS_AUDIO_FILTER_TEMPLATE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE)) -#define GST_IS_AUDIO_FILTER_TEMPLATE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE)) - -struct _GstAudioFilterTemplate -{ - GstAudioFilter audiofilter; -}; - -struct _GstAudioFilterTemplateClass -{ - GstAudioFilterClass parent_class; -}; - - -enum -{ - /* FILL ME */ - LAST_SIGNAL -}; - -enum -{ - ARG_0 - /* FILL ME */ -}; - -GST_BOILERPLATE (GstAudioFilterTemplate, gst_audio_filter_template, - GstAudioFilter, GST_TYPE_AUDIO_FILTER); - -static void gst_audio_filter_template_set_property (GObject * object, - guint prop_id, const GValue * value, GParamSpec * pspec); -static void gst_audio_filter_template_get_property (GObject * object, - guint prop_id, GValue * value, GParamSpec * pspec); - -static gboolean gst_audio_filter_template_setup (GstAudioFilter * filter, - GstRingBufferSpec * spec); -static GstFlowReturn gst_audio_filter_template_filter (GstBaseTransform * bt, - GstBuffer * outbuf, GstBuffer * inbuf); -static GstFlowReturn -gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform, - GstBuffer * buf); - -#define ALLOWED_CAPS_STRING \ - GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS - -static void -gst_audio_filter_template_base_init (gpointer g_class) -{ - GstAudioFilterTemplateClass *klass = (GstAudioFilterTemplateClass *) g_class; - GstAudioFilterClass *audiofilter_class = GST_AUDIO_FILTER_CLASS (g_class); - GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - GstCaps *caps; - - gst_element_class_set_details (element_class, &audio_filter_template_details); - - caps = gst_caps_from_string (ALLOWED_CAPS_STRING); - gst_audio_filter_class_add_pad_templates (audiofilter_class, caps); - gst_caps_unref (caps); -} - -static void -gst_audio_filter_template_class_init (GstAudioFilterTemplateClass * klass) -{ - GObjectClass *gobject_class; - GstBaseTransformClass *btrans_class; - GstAudioFilterClass *audio_filter_class; - - gobject_class = (GObjectClass *) klass; - btrans_class = (GstBaseTransformClass *) klass; - audio_filter_class = (GstAudioFilterClass *) klass; - -#if 0 - g_object_class_install_property (gobject_class, ARG_METHOD, - g_param_spec_enum ("method", "method", "method", - GST_TYPE_AUDIOTEMPLATE_METHOD, GST_AUDIOTEMPLATE_METHOD_1, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -#endif - - gobject_class->set_property = gst_audio_filter_template_set_property; - gobject_class->get_property = gst_audio_filter_template_get_property; - - /* this function will be called whenever the format changes */ - audio_filter_class->setup = gst_audio_filter_template_setup; - - /* here you set up functions to process data (either in place, or from - * one input buffer to another output buffer); only one is required */ - btrans_class->transform = gst_audio_filter_template_filter; - btrans_class->transform_ip = gst_audio_filter_template_filter_inplace; -} - -static void -gst_audio_filter_template_init (GstAudioFilterTemplate * audio_filter_template, - GstAudioFilterTemplateClass * g_class) -{ - GST_DEBUG ("init"); - - /* do stuff if you need to */ -} - -static void -gst_audio_filter_template_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - GstAudioFilterTemplate *filter; - - filter = GST_AUDIO_FILTER_TEMPLATE (object); - - GST_DEBUG ("set property %u", prop_id); - - GST_OBJECT_LOCK (filter); - switch (prop_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } - GST_OBJECT_UNLOCK (filter); -} - -static void -gst_audio_filter_template_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec) -{ - GstAudioFilterTemplate *filter; - - filter = GST_AUDIO_FILTER_TEMPLATE (object); - - GST_DEBUG ("get property %u", prop_id); - - GST_OBJECT_LOCK (filter); - switch (prop_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } - GST_OBJECT_UNLOCK (filter); -} - -static gboolean -gst_audio_filter_template_setup (GstAudioFilter * filter, - GstRingBufferSpec * spec) -{ - GstAudioFilterTemplate *audio_filter_template; - - audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (filter); - - /* if any setup needs to be done, do it here */ - - return TRUE; /* it's all good */ -} - -/* You may choose to implement either a copying filter or an - * in-place filter (or both). Implementing only one will give - * full functionality, however, implementing both will cause - * audiofilter to use the optimal function in every situation, - * with a minimum of memory copies. */ - -static GstFlowReturn -gst_audio_filter_template_filter (GstBaseTransform * base_transform, - GstBuffer * inbuf, GstBuffer * outbuf) -{ - GstAudioFilterTemplate *audio_filter_template; - GstAudioFilter *audiofilter; - - audiofilter = GST_AUDIO_FILTER (base_transform); - audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform); - - /* do something interesting here. This simply copies the source - * to the destination. */ - - memcpy (GST_BUFFER_DATA (outbuf), GST_BUFFER_DATA (inbuf), - GST_BUFFER_SIZE (inbuf)); - - return GST_FLOW_OK; -} - -static GstFlowReturn -gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform, - GstBuffer * buf) -{ - GstAudioFilterTemplate *audio_filter_template; - GstAudioFilter *audiofilter; - - audiofilter = GST_AUDIO_FILTER (base_transform); - audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform); - - /* do something interesting here. This simply copies the source - * to the destination. */ - - return GST_FLOW_OK; -} - -static gboolean -plugin_init (GstPlugin * plugin) -{ - GST_DEBUG_CATEGORY_INIT (audio_filter_template_debug, "audiofiltertemplate", - 0, "audiofiltertemplate"); - - return gst_element_register (plugin, "audiofiltertemplate", GST_RANK_NONE, - GST_TYPE_AUDIO_FILTER_TEMPLATE); -} - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "gstaudio_filter_template", - "Audio filter template", - plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/gst-libs/gst/audio/make_filter b/gst-libs/gst/audio/make_filter deleted file mode 100755 index eaeaa06..0000000 --- a/gst-libs/gst/audio/make_filter +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -LANG=C -LC_COLLATE=C -export LANG -export LC_COLLATE - -Template=$1; -srcfile=$2; - -if test x"$1" = x ; then - echo "$0 Objectname [srcfile]\n"; - echo " creates gstobjectname.{c,h} implementing GstObjectname,\n"; - echo " subclassing GstAudiofilter.\n"; - exit 1; -fi - -if test x"$2" = x ; then - srcfile="gstaudiofiltertemplate.c" -fi - -id=`echo '$Id$' | sed \ - -e 's/\$I[d]: \([^$]*\)\$/\1/g'` -echo $id - -TEMPLATE=`echo $Template | tr [:lower:] [:upper:]` -template=`echo $Template | tr [:upper:] [:lower:]` - -echo TEMPLATE $TEMPLATE -echo template $template - -# remember to break up the Id: in the line below -sed \ - -e 's/gstaudiofiltertemplate\.c/SOURCEFILE/g' \ - -e "s/AudiofilterTemplate/$Template/g" \ - -e "s/audiofiltertemplate/$template/g" \ - -e "s/VIDEOFILTERTEMPLATE/$TEMPLATE/g" \ - -e 's/\$I[d]: \([^$]*\)\$/\1/g' \ - -e 's/SOURCEFILE/gstaudiofiltertemplate\.c/g' \ - -e "s%MAKEFILTERVERSION%$id%g" \ - $srcfile >gst$template.c.tmp && mv gst$template.c.tmp gst$template.c - -- 2.7.4