summaryrefslogtreecommitdiff
path: root/gst-libs/gst/audio/gstaudiofilterexample.c
blob: 15e111af40456eeee20f69133c3072551a2bf60a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/* 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.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <gst/gst.h>
#include <gst/audio/gstaudiofilter.h>

typedef struct _GstAudiofilterExample GstAudiofilterExample;
typedef struct _GstAudiofilterExampleClass GstAudiofilterExampleClass;

#define GST_TYPE_AUDIOFILTER_EXAMPLE \
  (gst_audiofilter_example_get_type())
#define GST_AUDIOFILTER_EXAMPLE(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIOFILTER_EXAMPLE,GstAudiofilterExample))
#define GST_AUDIOFILTER_EXAMPLE_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOFILTER_EXAMPLE,GstAudiofilterExampleClass))
#define GST_IS_AUDIOFILTER_EXAMPLE(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIOFILTER_EXAMPLE))
#define GST_IS_AUDIOFILTER_EXAMPLE_CLASS(obj) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOFILTER_EXAMPLE))

struct _GstAudiofilterExample {
  GstAudiofilter audiofilter;

};

struct _GstAudiofilterExampleClass {
  GstAudiofilterClass parent_class;

};


/* GstAudiofilterExample signals and args */
enum {
  /* FILL ME */
  LAST_SIGNAL
};

enum {
  ARG_0,
  ARG_METHOD,
  /* FILL ME */
};

static void     gst_audiofilter_example_base_init       (gpointer g_class);
static void	gst_audiofilter_example_class_init	(gpointer g_class, gpointer class_data);

static void	gst_audiofilter_example_set_property		(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void	gst_audiofilter_example_get_property		(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);

GType
gst_audiofilter_example_get_type (void)
{
  static GType audiofilter_example_type = 0;

  if (!audiofilter_example_type) {
    static const GTypeInfo audiofilter_example_info = {
      sizeof(GstAudiofilterExampleClass),
      gst_audiofilter_example_base_init,
      NULL,
      gst_audiofilter_example_class_init,
      NULL,
      NULL,
      sizeof(GstAudiofilterExample),
      0,
      NULL,
    };
    audiofilter_example_type = g_type_register_static(GST_TYPE_AUDIOFILTER,
	"GstAudiofilterExample", &audiofilter_example_info, 0);
  }
  return audiofilter_example_type;
}

static void gst_audiofilter_example_base_init (gpointer g_class)
{
  static GstElementDetails audiofilter_example_details = {
    "Audio filter example",
    "Filter/Effect/Audio",
    "Filters audio",
    "David Schleef <ds@schleef.org>"
  };
  GstAudiofilterExampleClass *klass = (GstAudiofilterExampleClass *) g_class;
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);

  gst_element_class_set_details (element_class, &audiofilter_example_details);
}

static void gst_audiofilter_example_class_init (gpointer g_class, gpointer class_data)
{
  GObjectClass *gobject_class;
  GstElementClass *gstelement_class;
  GstAudiofilterExampleClass *klass;

  klass = (GstAudiofilterExampleClass *)g_class;
  gobject_class = (GObjectClass*)klass;
  gstelement_class = (GstElementClass*)klass;

  gobject_class->set_property = gst_audiofilter_example_set_property;
  gobject_class->get_property = gst_audiofilter_example_get_property;
}

static void
gst_audiofilter_example_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
  GstAudiofilterExample *src;

  /* it's not null if we got it, but it might not be ours */
  g_return_if_fail(GST_IS_AUDIOFILTER_EXAMPLE(object));
  src = GST_AUDIOFILTER_EXAMPLE(object);

  GST_DEBUG("gst_audiofilter_example_set_property");
  switch (prop_id) {
    default:
      break;
  }
}

static void
gst_audiofilter_example_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
  GstAudiofilterExample *src;

  /* it's not null if we got it, but it might not be ours */
  g_return_if_fail(GST_IS_AUDIOFILTER_EXAMPLE(object));
  src = GST_AUDIOFILTER_EXAMPLE(object);

  switch (prop_id) {
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}

static gboolean
plugin_init (GstPlugin *plugin)
{
  return TRUE;
}

GST_PLUGIN_DEFINE (
  GST_VERSION_MAJOR,
  GST_VERSION_MINOR,
  "gstaudiofilter_example",
  "Audio filter example",
  plugin_init,
  VERSION,
  "LGPL",
  GST_PACKAGE,
  GST_ORIGIN
)