2004-01-16 00:55:29 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* Copyright (C) <2003> David Schleef <ds@schleef.org>
|
|
|
|
*
|
|
|
|
* 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 <gst/gst.h>
|
|
|
|
#include <gst/audio/audio.h>
|
|
|
|
#include <gst/audio/gstaudiofilter.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (audio_filter_template_debug);
|
|
|
|
#define GST_CAT_DEFAULT audio_filter_template_debug
|
|
|
|
|
2006-04-28 19:46:37 +00:00
|
|
|
static const GstElementDetails audio_filter_template_details =
|
2006-03-24 10:42:11 +00:00
|
|
|
GST_ELEMENT_DETAILS ("Audio filter template",
|
|
|
|
"Filter/Effect/Audio",
|
|
|
|
"Filters audio",
|
|
|
|
"David Schleef <ds@schleef.org>");
|
|
|
|
|
2005-12-01 14:29:09 +00:00
|
|
|
typedef struct _GstAudioFilterTemplate GstAudioFilterTemplate;
|
|
|
|
typedef struct _GstAudioFilterTemplateClass GstAudioFilterTemplateClass;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
2005-07-10 12:03:58 +00:00
|
|
|
#define GST_TYPE_AUDIO_FILTER_TEMPLATE \
|
|
|
|
(gst_audio_filter_template_get_type())
|
|
|
|
#define GST_AUDIO_FILTER_TEMPLATE(obj) \
|
2005-12-01 14:29:09 +00:00
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplate))
|
2005-07-10 12:03:58 +00:00
|
|
|
#define GST_AUDIO_FILTER_TEMPLATE_CLASS(klass) \
|
2005-12-01 14:29:09 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplateClass))
|
2005-07-10 12:03:58 +00:00
|
|
|
#define GST_IS_AUDIO_FILTER_TEMPLATE(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE))
|
2006-09-16 21:54:48 +00:00
|
|
|
#define GST_IS_AUDIO_FILTER_TEMPLATE_CLASS(klass) \
|
2005-07-10 12:03:58 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE))
|
2004-01-16 00:55:29 +00:00
|
|
|
|
2005-12-01 14:29:09 +00:00
|
|
|
struct _GstAudioFilterTemplate
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
2005-12-01 14:29:09 +00:00
|
|
|
GstAudioFilter audiofilter;
|
2004-01-16 00:55:29 +00:00
|
|
|
};
|
|
|
|
|
2005-12-01 14:29:09 +00:00
|
|
|
struct _GstAudioFilterTemplateClass
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
2005-12-01 14:29:09 +00:00
|
|
|
GstAudioFilterClass parent_class;
|
2004-01-16 00:55:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
enum
|
|
|
|
{
|
2004-01-16 00:55:29 +00:00
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
enum
|
|
|
|
{
|
2004-05-21 23:38:49 +00:00
|
|
|
ARG_0
|
|
|
|
/* FILL ME */
|
2004-01-16 00:55:29 +00:00
|
|
|
};
|
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_BOILERPLATE (GstAudioFilterTemplate, gst_audio_filter_template,
|
|
|
|
GstAudioFilter, GST_TYPE_AUDIO_FILTER);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
2005-07-10 12:03:58 +00:00
|
|
|
static void gst_audio_filter_template_set_property (GObject * object,
|
2004-03-14 22:34:34 +00:00
|
|
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
2005-07-10 12:03:58 +00:00
|
|
|
static void gst_audio_filter_template_get_property (GObject * object,
|
2004-03-14 22:34:34 +00:00
|
|
|
guint prop_id, GValue * value, GParamSpec * pspec);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
static gboolean gst_audio_filter_template_setup (GstAudioFilter * filter,
|
|
|
|
GstRingBufferSpec * spec);
|
|
|
|
static GstFlowReturn gst_audio_filter_template_filter (GstBaseTransform * bt,
|
2004-03-14 22:34:34 +00:00
|
|
|
GstBuffer * outbuf, GstBuffer * inbuf);
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform,
|
|
|
|
GstBuffer * buf);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
#define ALLOWED_CAPS_STRING \
|
|
|
|
GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS
|
2004-01-16 00:55:29 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
2005-07-10 12:03:58 +00:00
|
|
|
gst_audio_filter_template_base_init (gpointer g_class)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
2005-12-01 14:29:09 +00:00
|
|
|
GstAudioFilterTemplateClass *klass = (GstAudioFilterTemplateClass *) g_class;
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GstAudioFilterClass *audiofilter_class = GST_AUDIO_FILTER_CLASS (g_class);
|
2004-01-16 00:55:29 +00:00
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GstCaps *caps;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
2005-12-01 14:29:09 +00:00
|
|
|
gst_element_class_set_details (element_class, &audio_filter_template_details);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
caps = gst_caps_from_string (ALLOWED_CAPS_STRING);
|
|
|
|
gst_audio_filter_class_add_pad_templates (audiofilter_class, caps);
|
|
|
|
gst_caps_unref (caps);
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
gst_audio_filter_template_class_init (GstAudioFilterTemplateClass * klass)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GstBaseTransformClass *btrans_class;
|
2005-12-01 14:29:09 +00:00
|
|
|
GstAudioFilterClass *audio_filter_class;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
btrans_class = (GstBaseTransformClass *) klass;
|
|
|
|
audio_filter_class = (GstAudioFilterClass *) klass;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
|
|
|
#if 0
|
2004-03-14 22:34:34 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_METHOD,
|
|
|
|
g_param_spec_enum ("method", "method", "method",
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_TYPE_AUDIOTEMPLATE_METHOD, GST_AUDIOTEMPLATE_METHOD_1,
|
|
|
|
G_PARAM_READWRITE));
|
2004-01-16 00:55:29 +00:00
|
|
|
#endif
|
|
|
|
|
2005-07-10 12:03:58 +00:00
|
|
|
gobject_class->set_property = gst_audio_filter_template_set_property;
|
|
|
|
gobject_class->get_property = gst_audio_filter_template_get_property;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
/* this function will be called whenever the format changes */
|
2005-12-01 14:29:09 +00:00
|
|
|
audio_filter_class->setup = gst_audio_filter_template_setup;
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
|
|
|
|
/* 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;
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
gst_audio_filter_template_init (GstAudioFilterTemplate * audio_filter_template,
|
|
|
|
GstAudioFilterTemplateClass * g_class)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_DEBUG ("init");
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
/* do stuff if you need to */
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-07-10 12:03:58 +00:00
|
|
|
gst_audio_filter_template_set_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:34 +00:00
|
|
|
const GValue * value, GParamSpec * pspec)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GstAudioFilterTemplate *filter;
|
|
|
|
|
|
|
|
filter = GST_AUDIO_FILTER_TEMPLATE (object);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_DEBUG ("set property %u", prop_id);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_OBJECT_LOCK (filter);
|
2004-01-16 00:55:29 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
default:
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
2004-01-16 00:55:29 +00:00
|
|
|
break;
|
|
|
|
}
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_OBJECT_UNLOCK (filter);
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-07-10 12:03:58 +00:00
|
|
|
gst_audio_filter_template_get_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:34 +00:00
|
|
|
GValue * value, GParamSpec * pspec)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GstAudioFilterTemplate *filter;
|
|
|
|
|
|
|
|
filter = GST_AUDIO_FILTER_TEMPLATE (object);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_DEBUG ("get property %u", prop_id);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_OBJECT_LOCK (filter);
|
2004-01-16 00:55:29 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GST_OBJECT_UNLOCK (filter);
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
gst_audio_filter_template_setup (GstAudioFilter * filter,
|
|
|
|
GstRingBufferSpec * spec)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
2005-12-01 14:29:09 +00:00
|
|
|
GstAudioFilterTemplate *audio_filter_template;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (filter);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
|
|
|
/* if any setup needs to be done, do it here */
|
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
return TRUE; /* it's all good */
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_audio_filter_template_filter (GstBaseTransform * base_transform,
|
|
|
|
GstBuffer * inbuf, GstBuffer * outbuf)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
2005-12-01 14:29:09 +00:00
|
|
|
GstAudioFilterTemplate *audio_filter_template;
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GstAudioFilter *audiofilter;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
audiofilter = GST_AUDIO_FILTER (base_transform);
|
|
|
|
audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
|
|
|
/* do something interesting here. This simply copies the source
|
|
|
|
* to the destination. */
|
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
memcpy (GST_BUFFER_DATA (outbuf), GST_BUFFER_DATA (inbuf),
|
|
|
|
GST_BUFFER_SIZE (inbuf));
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform,
|
2004-03-14 22:34:34 +00:00
|
|
|
GstBuffer * buf)
|
2004-01-16 00:55:29 +00:00
|
|
|
{
|
2005-12-01 14:29:09 +00:00
|
|
|
GstAudioFilterTemplate *audio_filter_template;
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
GstAudioFilter *audiofilter;
|
2004-01-16 00:55:29 +00:00
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
audiofilter = GST_AUDIO_FILTER (base_transform);
|
|
|
|
audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform);
|
2004-01-16 00:55:29 +00:00
|
|
|
|
|
|
|
/* do something interesting here. This simply copies the source
|
|
|
|
* to the destination. */
|
|
|
|
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
return GST_FLOW_OK;
|
2004-01-16 00:55:29 +00:00
|
|
|
}
|
gst-libs/gst/audio/: Oops, forgot to commit fixed-up example.
Original commit message from CVS:
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/gstaudiofiltertemplate.c:
(gst_audio_filter_template_base_init),
(gst_audio_filter_template_class_init),
(gst_audio_filter_template_init),
(gst_audio_filter_template_set_property),
(gst_audio_filter_template_get_property),
(gst_audio_filter_template_setup),
(gst_audio_filter_template_filter),
(gst_audio_filter_template_filter_inplace), (plugin_init):
Oops, forgot to commit fixed-up example.
2007-02-03 23:28:45 +00:00
|
|
|
|
|
|
|
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);
|