gstreamer/tools/gobject.c
David Schleef f6f9563dc8 tools: Add element-maker
Add a script that creates elements based on any of the GStreamer
base classes.  It isn't very user friendly at the moment, one
needs to edit the script to make it work properly.  Each base class
has a template file describing what to put into the constructed
element.  Eventually, these templates should be moved to reside
with the base class source and installed to a well-known directory,
where an installed script could find them.

The template files use the .c ending so editors know they are C
source, but gst-indent doesn't handle them correctly.  So they
need to be committed with -n.  Ugh.  I'll try to figure out a fix
for that soon.
2010-04-14 16:43:23 -07:00

80 lines
1.8 KiB
C

% includes
% prototypes
static void gst_replace_set_property (GObject * object,
guint property_id, const GValue * value, GParamSpec * pspec);
static void gst_replace_get_property (GObject * object,
guint property_id, GValue * value, GParamSpec * pspec);
static void gst_replace_dispose (GObject * object);
static void gst_replace_finalize (GObject * object);
% declare-class
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
% set-methods
gobject_class->set_property = gst_replace_set_property;
gobject_class->get_property = gst_replace_get_property;
gobject_class->dispose = gst_replace_dispose;
gobject_class->finalize = gst_replace_finalize;
% methods
void
gst_replace_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GstReplace *replace;
g_return_if_fail (GST_IS_REPLACE (object));
replace = GST_REPLACE (object);
switch (property_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
void
gst_replace_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
GstReplace *replace;
g_return_if_fail (GST_IS_REPLACE (object));
replace = GST_REPLACE (object);
switch (property_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
void
gst_replace_dispose (GObject * object)
{
GstReplace *replace;
g_return_if_fail (GST_IS_REPLACE (object));
replace = GST_REPLACE (object);
/* clean up as possible. may be called multiple times */
G_OBJECT_CLASS (parent_class)->finalize (object);
}
void
gst_replace_finalize (GObject * object)
{
GstReplace *replace;
g_return_if_fail (GST_IS_REPLACE (object));
replace = GST_REPLACE (object);
/* clean up object here */
G_OBJECT_CLASS (parent_class)->finalize (object);
}
% end