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.
This commit is contained in:
David Schleef 2010-04-14 16:32:34 -07:00
parent c48de5c594
commit f6f9563dc8
21 changed files with 1357 additions and 2 deletions

View file

@ -2,11 +2,11 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
SUBDIRS = \
gst-libs gst sys ext pkgconfig \
m4 common docs tests po
m4 common docs tests po tools
DIST_SUBDIRS = \
gst gst-libs sys ext pkgconfig \
m4 common docs tests po
m4 common docs tests po tools
# include before EXTRA_DIST for win32 assignment
include $(top_srcdir)/common/win32.mak

View file

@ -1754,6 +1754,7 @@ docs/version.entities
pkgconfig/Makefile
pkgconfig/gstreamer-plugins-bad.pc
pkgconfig/gstreamer-plugins-bad-uninstalled.pc
tools/Makefile
m4/Makefile
win32/common/config.h
)

20
tools/Makefile.am Normal file
View file

@ -0,0 +1,20 @@
EXTRA_DIST = \
element-maker \
base.c \
gobject.c \
gstaudiofilter.c \
gstaudiosink.c \
gstaudiosrc.c \
gstbaseaudiosink.c \
gstbaseaudiosrc.c \
gstbasertpdepayload.c \
gstbasertppayload.c \
gstbasesink.c \
gstbasesrc.c \
gstbasetransform.c \
gstcddabasesrc.c \
gstelement.c \
gstpushsrc.c \
gsttagdemux.c \
gstvideosink.c

33
tools/base.c Normal file
View file

@ -0,0 +1,33 @@
% copyright
/* GStreamer
* Copyright (C) 2010 FIXME <fixme@example.com>
*
* 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.
*/
% includes
#include <gst/gst.h>
% part2
enum
{
ARG_0
};
% end

233
tools/element-maker Executable file
View file

@ -0,0 +1,233 @@
#!/bin/sh
class=basetransform
GST_IS_REPLACE=MY_IS_EXAMPLE
GST_REPLACE=MY_EXAMPLE
GST_TYPE_REPLACE=MY_TYPE_EXAMPLE
GstReplace=MyExample
gst_replace=my_example
gstreplace=myexample
replace=example
source=gst$class.c
pkg=`grep -A 10000 '^% pkg-config' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
GST_TYPE_BASE_REPLACE=`grep -A 10000 '^% TYPE_CLASS_NAME' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
GstBaseReplace=`grep -A 10000 '^% ClassName' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1`
generate ()
{
grep -A 10000 '^% copyright' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
cat <<EOF
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
EOF
grep -A 10000 '^% includes' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% includes' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% includes' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
cat <<EOF
#include "gstreplace.h"
/* prototypes */
EOF
grep -A 10000 '^% prototypes' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% prototypes' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% prototypes' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
cat <<EOF
enum
{
PROP_0
};
/* pad templates */
static GstStaticPadTemplate gst_replace_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("application/unknown")
);
static GstStaticPadTemplate gst_replace_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("application/unknown")
);
/* class initialization */
GST_BOILERPLATE (GstReplace, gst_replace, GstBaseReplace,
GST_TYPE_BASE_REPLACE);
static void
gst_replace_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_replace_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_replace_sink_template));
gst_element_class_set_details_simple (element_class, "FIXME",
"Generic", "FIXME", "FIXME <fixme@example.com>");
}
static void
gst_replace_class_init (GstReplaceClass * klass)
{
EOF
grep -A 10000 '^% declare-class' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% declare-class' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% declare-class' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
echo
grep -A 10000 '^% set-methods' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% set-methods' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% set-methods' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
cat <<EOF
}
static void
gst_replace_init (GstReplace * replace, GstReplaceClass * replace_class)
{
}
EOF
grep -A 10000 '^% methods' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% methods' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% methods' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
cat <<EOF
static gboolean
plugin_init (GstPlugin * plugin)
{
gst_element_register (plugin, "replace", GST_RANK_NONE,
gst_replace_get_type ());
return TRUE;
}
#define VERSION "0.0.FIXME"
#define PACKAGE "FIXME_package"
#define PACKAGE_NAME "FIXME_package_name"
#define PACKAGE_ORIGIN "http://FIXME.org/"
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"replace",
"FIXME",
plugin_init, VERSION, "LGPL", PACKAGE_NAME, PACKAGE_ORIGIN)
EOF
}
generate_header ()
{
grep -A 10000 '^% copyright' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
cat <<EOF
#ifndef _GST_REPLACE_H_
#define _GST_REPLACE_H_
EOF
grep -A 10000 '^% includes' base.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% includes' gobject.c | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
grep -A 10000 '^% includes' $source | tail -n +2|grep -m 1 -B 10000 '^%'|head -n -1
cat <<EOF
G_BEGIN_DECLS
#define GST_TYPE_REPLACE \
(gst_replace_get_type())
#define GST_REPLACE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_REPLACE,GstReplace))
#define GST_REPLACE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_REPLACE,GstReplaceClass))
#define GST_IS_REPLACE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_REPLACE))
#define GST_IS_REPLACE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_REPLACE))
typedef struct _GstReplace GstReplace;
typedef struct _GstReplaceClass GstReplaceClass;
struct _GstReplace
{
GstBaseReplace base_replace;
};
struct _GstReplaceClass
{
GstBaseReplaceClass base_replace_class;
};
GType gst_replace_get_type (void);
G_END_DECLS
#endif
EOF
}
generate | sed \
-e "s/GST_BASE_REPLACE/$GST_BASE_REPLACE/g" \
-e "s/GST_TYPE_BASE_REPLACE/$GST_TYPE_BASE_REPLACE/g" \
-e "s/GstBaseReplace/$GstBaseReplace/g" \
-e "s/GST_IS_REPLACE/$GST_IS_REPLACE/g" \
-e "s/GST_REPLACE/$GST_REPLACE/g" \
-e "s/GST_TYPE_REPLACE/$GST_TYPE_REPLACE/g" \
-e "s/GstReplace/$GstReplace/g" \
-e "s/gst_replace/$gst_replace/g" \
-e "s/gstreplace/$gstreplace/g" \
-e "s/replace/$replace/g" >myexample.c
generate_header | sed \
-e "s/GST_BASE_REPLACE/$GST_BASE_REPLACE/g" \
-e "s/GST_TYPE_BASE_REPLACE/$GST_TYPE_BASE_REPLACE/g" \
-e "s/GstBaseReplace/$GstBaseReplace/g" \
-e "s/GST_IS_REPLACE/$GST_IS_REPLACE/g" \
-e "s/GST_REPLACE/$GST_REPLACE/g" \
-e "s/GST_TYPE_REPLACE/$GST_TYPE_REPLACE/g" \
-e "s/GstReplace/$GstReplace/g" \
-e "s/gst_replace/$gst_replace/g" \
-e "s/gstreplace/$gstreplace/g" \
-e "s/replace/$replace/g" >myexample.h
gst-indent myexample.c
echo pkg is $pkg
gcc -Wall $(pkg-config --cflags gstreamer-0.10 $pkg) -c -o myexample.o myexample.c
gcc -shared -o myexample.so myexample.o $(pkg-config --libs gstreamer-0.10 $pkg)

80
tools/gobject.c Normal file
View file

@ -0,0 +1,80 @@
% 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

23
tools/gstaudiofilter.c Normal file
View file

@ -0,0 +1,23 @@
% ClassName
GstAudioFilter
% TYPE_CLASS_NAME
GST_TYPE_AUDIO_FILTER
% pkg-config
gstreamer-audio-0.10
% includes
#include <gst/audio/gstaudiofilter.h>
% prototypes
static gboolean
gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format);
% declare-class
GstAudioFilter *audio_filter_class = GST_AUDIO_FILTER (klass);
% set-methods
audio_filter_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static gboolean
gst_replace_setup (GstAudioFilter * filter, GstRingBufferSpec * format)
{
}
% end

58
tools/gstaudiosink.c Normal file
View file

@ -0,0 +1,58 @@
% ClassName
GstAudioSink
% TYPE_CLASS_NAME
GST_TYPE_AUDIO_SINK
% pkg-config
gstreamer-audio-0.10
% includes
#include <gst/audio/gstaudiosink.h>
% prototypes
static gboolean gst_replace_open (GstAudioSrc * src);
static gboolean
gst_replace_prepare (GstAudioSrc * src, GstRingBufferSpec * spec);
static gboolean gst_replace_unprepare (GstAudioSrc * src);
static gboolean gst_replace_close (GstAudioSrc * src);
static guint gst_replace_read (GstAudioSrc * src, gpointer data, guint length);
static guint gst_replace_delay (GstAudioSrc * src);
static void gst_replace_reset (GstAudioSrc * src);
% declare-class
GstAudioSink *audio_sink_class = GST_AUDIO_SINK (klass);
% set-methods
audio_sink_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static gboolean
gst_replace_open (GstAudioSrc * src)
{
}
static gboolean
gst_replace_prepare (GstAudioSrc * src, GstRingBufferSpec * spec)
{
}
static gboolean
gst_replace_unprepare (GstAudioSrc * src)
{
}
static gboolean
gst_replace_close (GstAudioSrc * src)
{
}
static guint
gst_replace_read (GstAudioSrc * src, gpointer data, guint length)
{
}
static guint
gst_replace_delay (GstAudioSrc * src)
{
}
static void
gst_replace_reset (GstAudioSrc * src)
{
}
% end

59
tools/gstaudiosrc.c Normal file
View file

@ -0,0 +1,59 @@
% ClassName
GstAudioSrc
% TYPE_CLASS_NAME
GST_TYPE_AUDIO_SRC
% pkg-config
gstreamer-audio-0.10
% includes
#include <gst/audio/gstaudiosrc.h>
% prototypes
static gboolean gst_replace_open (GstAudioSink * sink);
static gboolean
gst_replace_prepare (GstAudioSink * sink, GstRingBufferSpec * spec);
static gboolean gst_replace_unprepare (GstAudioSink * sink);
static gboolean gst_replace_close (GstAudioSink * sink);
static guint
gst_replace_write (GstAudioSink * sink, gpointer data, guint length);
static guint gst_replace_delay (GstAudioSink * sink);
static void gst_replace_reset (GstAudioSink * sink);
% declare-class
GstAudioSrc *audio_src_class = GST_AUDIO_SRC (klass);
% set-methods
audio_src_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static gboolean
gst_replace_open (GstAudioSink * sink)
{
}
static gboolean
gst_replace_prepare (GstAudioSink * sink, GstRingBufferSpec * spec)
{
}
static gboolean
gst_replace_unprepare (GstAudioSink * sink)
{
}
static gboolean
gst_replace_close (GstAudioSink * sink)
{
}
static guint
gst_replace_write (GstAudioSink * sink, gpointer data, guint length)
{
}
static guint
gst_replace_delay (GstAudioSink * sink)
{
}
static void
gst_replace_reset (GstAudioSink * sink)
{
}
% end

22
tools/gstbaseaudiosink.c Normal file
View file

@ -0,0 +1,22 @@
% ClassName
GstBaseAudioSink
% TYPE_CLASS_NAME
GST_TYPE_BASE_AUDIO_SINK
% pkg-config
gstreamer-audio-0.10
% includes
#include <gst/audio/gstbaseaudiosink.h>
% prototypes
static GstRingBuffer *gst_replace_create_ringbuffer (GstBaseAudioSink * sink);
% declare-class
GstBaseAudioSink *base_audio_sink_class = GST_BASE_AUDIO_SINK (klass);
% set-methods
base_audio_sink_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static GstRingBuffer *
gst_replace_create_ringbuffer (GstBaseAudioSink * sink)
{
}
% end

22
tools/gstbaseaudiosrc.c Normal file
View file

@ -0,0 +1,22 @@
% ClassName
GstBaseAudioSrc
% TYPE_CLASS_NAME
GST_TYPE_BASE_AUDIO_SRC
% pkg-config
gstreamer-audio-0.10
% includes
#include <gst/audio/gstbaseaudiosrc.h>
% prototypes
static GstRingBuffer *gst_replace_create_ringbuffer (GstBaseAudioSrc * src);
% declare-class
GstBaseAudioSrc *base_audio_src_class = GST_BASE_AUDIO_SRC (klass);
% set-methods
base_audio_src_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static GstRingBuffer *
gst_replace_create_ringbuffer (GstBaseAudioSrc * src)
{
}
% end

View file

@ -0,0 +1,57 @@
% ClassName
GstBaseRTPDepayload
% TYPE_CLASS_NAME
GST_TYPE_BASE_RTP_DEPAYLOAD
% pkg-config
gstreamer-rtp-0.10
% includes
#include <gst/rtp/gstbasertpdepayload.h>
% prototypes
static gboolean
gst_replace_set_caps (GstBaseRTPDepayload * filter, GstCaps * caps);
static GstFlowReturn
gst_replace_add_to_queue (GstBaseRTPDepayload * filter, GstBuffer * in);
static GstBuffer *gst_replace_process (GstBaseRTPDepayload * base,
GstBuffer * in);
static void
gst_replace_set_gst_timestamp (GstBaseRTPDepayload * filter, guint32 timestamp,
Gst Buffer * buf);
static gboolean
gst_replace_packet_lost (GstBaseRTPDepayload * filter, GstEvent * event);
% declare-class
GstBaseRTPDepayload *base_rtpdepayload_class = GST_BASE_RTPDEPAYLOAD (klass);
% set-methods
base_rtpdepayload_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static gboolean
gst_replace_set_caps (GstBaseRTPDepayload * filter, GstCaps * caps)
{
}
static GstFlowReturn
gst_replace_add_to_queue (GstBaseRTPDepayload * filter, GstBuffer * in)
{
}
static GstBuffer *
gst_replace_process (GstBaseRTPDepayload * base, GstBuffer * in)
{
}
static void
gst_replace_set_gst_timestamp (GstBaseRTPDepayload * filter, guint32 timestamp,
Gst Buffer * buf)
{
}
static gboolean
gst_replace_packet_lost (GstBaseRTPDepayload * filter, GstEvent * event)
{
}
% end

46
tools/gstbasertppayload.c Normal file
View file

@ -0,0 +1,46 @@
% ClassName
GstBaseRTPPayload
% TYPE_CLASS_NAME
GST_TYPE_BASE_RTP_PAYLOAD
% pkg-config
gstreamer-rtp-0.10
% includes
#include <gst/rtp/gstbasertppayload.h>
% prototypes
static gboolean
gst_replace_set_caps (GstBaseRTPPayload * payload, GstCaps * caps);
static GstFlowReturn
gst_replace_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer);
static gboolean gst_replace_handle_event (GstPad * pad, GstEvent * event);
static GstCaps *gst_replace_get_caps (GstBaseRTPPayload * payload,
GstPad * pad);
% declare-class
GstBaseRTPPayload *base_rtppayload_class = GST_BASE_RTPPAYLOAD (klass);
% set-methods
base_rtppayload_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static gboolean
gst_replace_set_caps (GstBaseRTPPayload * payload, GstCaps * caps)
{
}
static GstFlowReturn
gst_replace_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer)
{
}
static gboolean
gst_replace_handle_event (GstPad * pad, GstEvent * event)
{
}
static GstCaps *
gst_replace_get_caps (GstBaseRTPPayload * payload, GstPad * pad)
{
}
% end

130
tools/gstbasesink.c Normal file
View file

@ -0,0 +1,130 @@
% ClassName
GstBaseSink
% TYPE_CLASS_NAME
GST_TYPE_BASE_SINK
% pkg-config
gstreamer-base-0.10
% includes
#include <gst/base/gstbasesink.h>
% prototypes
static GstCaps *gst_replace_get_caps (GstBaseSink * sink);
static gboolean gst_replace_set_caps (GstBaseSink * sink, GstCaps * caps);
static GstFlowReturn
gst_replace_buffer_alloc (GstBaseSink * sink, guint64 offset, guint size,
GstCaps * caps, GstBuffer ** buf);
static void
gst_replace_get_times (GstBaseSink * sink, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end);
static gboolean gst_replace_start (GstBaseSink * sink);
static gboolean gst_replace_stop (GstBaseSink * sink);
static gboolean gst_replace_unlock (GstBaseSink * sink);
static gboolean gst_replace_event (GstBaseSink * sink, GstEvent * event);
static GstFlowReturn
gst_replace_preroll (GstBaseSink * sink, GstBuffer * buffer);
static GstFlowReturn
gst_replace_render (GstBaseSink * sink, GstBuffer * buffer);
static GstStateChangeReturn gst_replace_async_play (GstBaseSink * sink);
static gboolean gst_replace_activate_pull (GstBaseSink * sink, gboolean active);
static void gst_replace_fixate (GstBaseSink * sink, GstCaps * caps);
static gboolean gst_replace_unlock_stop (GstBaseSink * sink);
static GstFlowReturn
gst_replace_render_list (GstBaseSink * sink, GstBufferList * buffer_list);
% declare-class
GstBaseSink *base_sink_class = GST_BASE_SINK (klass);
% set-methods
base_sink_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static GstCaps *
gst_replace_get_caps (GstBaseSink * sink)
{
}
static gboolean
gst_replace_set_caps (GstBaseSink * sink, GstCaps * caps)
{
}
static GstFlowReturn
gst_replace_buffer_alloc (GstBaseSink * sink, guint64 offset, guint size,
GstCaps * caps, GstBuffer ** buf)
{
}
static void
gst_replace_get_times (GstBaseSink * sink, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
}
static gboolean
gst_replace_start (GstBaseSink * sink)
{
}
static gboolean
gst_replace_stop (GstBaseSink * sink)
{
}
static gboolean
gst_replace_unlock (GstBaseSink * sink)
{
}
static gboolean
gst_replace_event (GstBaseSink * sink, GstEvent * event)
{
}
static GstFlowReturn
gst_replace_preroll (GstBaseSink * sink, GstBuffer * buffer)
{
}
static GstFlowReturn
gst_replace_render (GstBaseSink * sink, GstBuffer * buffer)
{
}
static GstStateChangeReturn
gst_replace_async_play (GstBaseSink * sink)
{
}
static gboolean
gst_replace_activate_pull (GstBaseSink * sink, gboolean active)
{
}
static void
gst_replace_fixate (GstBaseSink * sink, GstCaps * caps)
{
}
static gboolean
gst_replace_unlock_stop (GstBaseSink * sink)
{
}
static GstFlowReturn
gst_replace_render_list (GstBaseSink * sink, GstBufferList * buffer_list)
{
}
% end

150
tools/gstbasesrc.c Normal file
View file

@ -0,0 +1,150 @@
% ClassName
GstBaseSrc
% TYPE_CLASS_NAME
GST_TYPE_BASE_SRC
% pkg-config
gstreamer-base-0.10
% includes
#include <gst/base/gstbasesrc.h>
% prototypes
static GstCaps *gst_replace_get_caps (GstBaseSrc * src);
static gboolean gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps);
static gboolean gst_replace_negotiate (GstBaseSrc * src);
static gboolean gst_replace_newsegment (GstBaseSrc * src);
static gboolean gst_replace_start (GstBaseSrc * src);
static gboolean gst_replace_stop (GstBaseSrc * src);
static void
gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end);
static gboolean gst_replace_get_size (GstBaseSrc * src, guint64 * size);
static gboolean gst_replace_is_seekable (GstBaseSrc * src);
static gboolean gst_replace_unlock (GstBaseSrc * src);
static gboolean gst_replace_event (GstBaseSrc * src, GstEvent * event);
static GstFlowReturn
gst_replace_create (GstBaseSrc * src, guint64 offset, guint size,
GstBuffer ** buf);
static gboolean gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment);
static gboolean gst_replace_query (GstBaseSrc * src, GstQuery * query);
static gboolean gst_replace_check_get_range (GstBaseSrc * src);
static void gst_replace_fixate (GstBaseSrc * src, GstCaps * caps);
static gboolean gst_replace_unlock_stop (GstBaseSrc * src);
static gboolean
gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
GstSegment * segment);
% declare-class
GstBaseSrc *base_src_class = GST_BASE_SRC (klass);
% set-methods
base_src_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static GstCaps *
gst_replace_get_caps (GstBaseSrc * src)
{
}
static gboolean
gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps)
{
}
static gboolean
gst_replace_negotiate (GstBaseSrc * src)
{
}
static gboolean
gst_replace_newsegment (GstBaseSrc * src)
{
}
static gboolean
gst_replace_start (GstBaseSrc * src)
{
}
static gboolean
gst_replace_stop (GstBaseSrc * src)
{
}
static void
gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
}
static gboolean
gst_replace_get_size (GstBaseSrc * src, guint64 * size)
{
}
static gboolean
gst_replace_is_seekable (GstBaseSrc * src)
{
}
static gboolean
gst_replace_unlock (GstBaseSrc * src)
{
}
static gboolean
gst_replace_event (GstBaseSrc * src, GstEvent * event)
{
}
static GstFlowReturn
gst_replace_create (GstBaseSrc * src, guint64 offset, guint size,
GstBuffer ** buf)
{
}
static gboolean
gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment)
{
}
static gboolean
gst_replace_query (GstBaseSrc * src, GstQuery * query)
{
}
static gboolean
gst_replace_check_get_range (GstBaseSrc * src)
{
}
static void
gst_replace_fixate (GstBaseSrc * src, GstCaps * caps)
{
}
static gboolean
gst_replace_unlock_stop (GstBaseSrc * src)
{
}
static gboolean
gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
GstSegment * segment)
{
}
% end

154
tools/gstbasetransform.c Normal file
View file

@ -0,0 +1,154 @@
% ClassName
GstBaseTransform
% TYPE_CLASS_NAME
GST_TYPE_BASE_TRANSFORM
% pkg-config
gstreamer-base-0.10
% includes
#include <gst/base/gstbasetransform.h>
% prototypes
static GstCaps *gst_replace_transform_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps);
static void
gst_replace_fixate_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
static gboolean
gst_replace_transform_size (GstBaseTransform * trans,
GstPadDirection direction,
GstCaps * caps, guint size, GstCaps * othercaps, guint * othersize);
static gboolean
gst_replace_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
guint * size);
static gboolean
gst_replace_set_caps (GstBaseTransform * trans, GstCaps * incaps,
GstCaps * outcaps);
static gboolean gst_replace_start (GstBaseTransform * trans);
static gboolean gst_replace_stop (GstBaseTransform * trans);
static gboolean gst_replace_event (GstBaseTransform * trans, GstEvent * event);
static GstFlowReturn
gst_replace_transform (GstBaseTransform * trans, GstBuffer * inbuf,
GstBuffer * outbuf);
static GstFlowReturn
gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf);
static GstFlowReturn
gst_replace_prepare_output_buffer (GstBaseTransform * trans,
GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf);
static gboolean
gst_replace_src_event (GstBaseTransform * trans, GstEvent * event);
static void
gst_replace_before_transform (GstBaseTransform * trans, GstBuffer * buffer);
% declare-class
GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass);
% set-methods
base_transform_class->transform_caps = GST_DEBUG_FUNCPTR (gst_replace_transform_caps);
base_transform_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_replace_fixate_caps);
base_transform_class->transform_size = GST_DEBUG_FUNCPTR (gst_replace_transform_size);
base_transform_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_replace_get_unit_size);
base_transform_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
base_transform_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
base_transform_class->transform = GST_DEBUG_FUNCPTR (gst_replace_transform);
base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_replace_transform_ip);
base_transform_class->prepare_output_buffer = GST_DEBUG_FUNCPTR (gst_replace_prepare_output_buffer);
base_transform_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
base_transform_class->before_transform = GST_DEBUG_FUNCPTR (gst_replace_before_transform);
% methods
static GstCaps *
gst_replace_transform_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps)
{
return NULL;
}
static void
gst_replace_fixate_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
{
}
static gboolean
gst_replace_transform_size (GstBaseTransform * trans,
GstPadDirection direction,
GstCaps * caps, guint size, GstCaps * othercaps, guint * othersize)
{
return FALSE;
}
static gboolean
gst_replace_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
guint * size)
{
return FALSE;
}
static gboolean
gst_replace_set_caps (GstBaseTransform * trans, GstCaps * incaps,
GstCaps * outcaps)
{
return FALSE;
}
static gboolean
gst_replace_start (GstBaseTransform * trans)
{
return FALSE;
}
static gboolean
gst_replace_stop (GstBaseTransform * trans)
{
return FALSE;
}
static gboolean
gst_replace_event (GstBaseTransform * trans, GstEvent * event)
{
return FALSE;
}
static GstFlowReturn
gst_replace_transform (GstBaseTransform * trans, GstBuffer * inbuf,
GstBuffer * outbuf)
{
return GST_FLOW_ERROR;
}
static GstFlowReturn
gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
{
return GST_FLOW_ERROR;
}
static GstFlowReturn
gst_replace_prepare_output_buffer (GstBaseTransform * trans,
GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf)
{
return GST_FLOW_ERROR;
}
static gboolean
gst_replace_src_event (GstBaseTransform * trans, GstEvent * event)
{
return FALSE;
}
static void
gst_replace_before_transform (GstBaseTransform * trans, GstBuffer * buffer)
{
}
% end

51
tools/gstcddabasesrc.c Normal file
View file

@ -0,0 +1,51 @@
% ClassName
GstCddaBaseSrc
% TYPE_CLASS_NAME
GST_TYPE_CDDA_BASE_SRC
% pkg-config
gstreamer-cdda-0.10
% includes
#include <gst/cdda/gstcddabasesrc.h>
% prototypes
static gboolean gst_replace_open (GstCddaBaseSrc * src, const gchar * device);
static void gst_replace_close (GstCddaBaseSrc * src);
static GstBuffer *gst_replace_read_sector (GstCddaBaseSrc * src, gint sector);
static gchar *gst_replace_get_default_device (GstCddaBaseSrc * src);
static gchar **gst_replace_probe_devices (GstCddaBaseSrc * src);
% declare-class
GstcddaBaseSrc *cddabase_src_class = GST_CDDABASE_SRC (klass);
% set-methods
cddabase_src_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static gboolean
gst_replace_open (GstCddaBaseSrc * src, const gchar * device)
{
}
static void
gst_replace_close (GstCddaBaseSrc * src)
{
}
static GstBuffer *
gst_replace_read_sector (GstCddaBaseSrc * src, gint sector)
{
}
static gchar *
gst_replace_get_default_device (GstCddaBaseSrc * src)
{
}
static gchar **
gst_replace_probe_devices (GstCddaBaseSrc * src)
{
}
% end

118
tools/gstelement.c Normal file
View file

@ -0,0 +1,118 @@
% ClassName
GstElement
% TYPE_CLASS_NAME
GST_TYPE_ELEMENT
% pkg-config
gstreamer-0.10
% includes
#include <gst/gst.h>
% prototypes
static GstPad *gst_replace_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
static void gst_replace_release_pad (GstElement * element, GstPad * pad);
static GstStateChangeReturn
gst_replace_get_state (GstElement * element, GstState * state,
GstState * pending, GstClockTime timeout);
static GstStateChangeReturn
gst_replace_set_state (GstElement * element, GstState state);
static GstStateChangeReturn
gst_replace_change_state (GstElement * element, GstStateChange transition);
static void gst_replace_set_bus (GstElement * element, GstBus * bus);
static GstClock *gst_replace_provide_clock (GstElement * element);
static gboolean gst_replace_set_clock (GstElement * element, GstClock * clock);
static GstIndex *gst_replace_get_index (GstElement * element);
static void gst_replace_set_index (GstElement * element, GstIndex * index);
static gboolean gst_replace_send_event (GstElement * element, GstEvent * event);
static const GstQueryType *gst_replace_get_query_types (GstElement * element);
static gboolean gst_replace_query (GstElement * element, GstQuery * query);
% declare-class
GstElement *element_class = GST_ELEMENT (klass);
% set-methods
element_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static GstPad *
gst_replace_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * name)
{
return NULL;
}
static void
gst_replace_release_pad (GstElement * element, GstPad * pad)
{
}
static GstStateChangeReturn
gst_replace_get_state (GstElement * element, GstState * state,
GstState * pending, GstClockTime timeout)
{
return GST_STATE_CHANGE_OK;
}
static GstStateChangeReturn
gst_replace_set_state (GstElement * element, GstState state)
{
return GST_STATE_CHANGE_OK;
}
static GstStateChangeReturn
gst_replace_change_state (GstElement * element, GstStateChange transition)
{
return GST_STATE_CHANGE_OK;
}
static void
gst_replace_set_bus (GstElement * element, GstBus * bus)
{
}
static GstClock *
gst_replace_provide_clock (GstElement * element)
{
}
static gboolean
gst_replace_set_clock (GstElement * element, GstClock * clock)
{
}
static GstIndex *
gst_replace_get_index (GstElement * element)
{
}
static void
gst_replace_set_index (GstElement * element, GstIndex * index)
{
}
static gboolean
gst_replace_send_event (GstElement * element, GstEvent * event)
{
}
static const GstQueryType *
gst_replace_get_query_types (GstElement * element)
{
}
static gboolean
gst_replace_query (GstElement * element, GstQuery * query)
{
}
% end

22
tools/gstpushsrc.c Normal file
View file

@ -0,0 +1,22 @@
% ClassName
GstPushSrc
% TYPE_CLASS_NAME
GST_TYPE_PUSH_SRC
% pkg-config
gstreamer-base-0.10
% includes
#include <gst/base/gstpushsrc.h>
% prototypes
static GstFlowReturn gst_replace_create (GstPushSrc * src, GstBuffer ** buf);
% declare-class
GstPushSrc *pushsrc_class = GST_PUSHSRC (klass);
% set-methods
pushsrc_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static GstFlowReturn
gst_replace_create (GstPushSrc * src, GstBuffer ** buf)
{
}
% end

47
tools/gsttagdemux.c Normal file
View file

@ -0,0 +1,47 @@
% ClassName
GstTagDemux
% TYPE_CLASS_NAME
GST_TYPE_TAG_DEMUX
% pkg-config
gstreamer-tag-0.10
% includes
#include <gst/tag/gsttagdemux.h>
% prototypes
static gboolean
gst_replace_identify_tag (GstTagDemux * demux,
GstBuffer * buffer, gboolean start_tag, guint * tag_size);
static GstTagDemuxResult
gst_replace_parse_tag (GstTagDemux * demux,
GstBuffer * buffer,
gboolean start_tag, guint * tag_size, GstTagList ** tags);
static GstTagList *gst_replace_merge_tags (GstTagDemux * demux,
const GstTagList * start_tags, const GstTagList * end_tags);
% declare-class
GstTagdemux *tagdemux_class = GST_TAGDEMUX (klass);
% set-methods
tagdemux_class-> = GST_DEBUG_FUNCPTR (gst_replace_);
% methods
static gboolean
gst_replace_identify_tag (GstTagDemux * demux,
GstBuffer * buffer, gboolean start_tag, guint * tag_size)
{
}
static GstTagDemuxResult
gst_replace_parse_tag (GstTagDemux * demux,
GstBuffer * buffer,
gboolean start_tag, guint * tag_size, GstTagList ** tags)
{
}
static GstTagList *
gst_replace_merge_tags (GstTagDemux * demux,
const GstTagList * start_tags, const GstTagList * end_tags)
{
}
% end

29
tools/gstvideosink.c Normal file
View file

@ -0,0 +1,29 @@
% ClassName
GstVideoSink
% TYPE_CLASS_NAME
GST_TYPE_VIDEO_SINK
% pkg-config
gstreamer-video-0.10
% includes
#include <gst/video/gstvideosink.h>
% prototypes
static GstFlowReturn
gst_replace_show_frame (GstVideoSink * video_sink, GstBuffer * buf);
% declare-class
GstVideoSinkClass *video_sink_class = GST_VIDEO_SINK_CLASS (klass);
% set-methods
video_sink_class->show_frame = GST_DEBUG_FUNCPTR (gst_replace_show_frame);
% methods
static GstFlowReturn
gst_replace_show_frame (GstVideoSink * video_sink, GstBuffer * buf)
{
return GST_FLOW_OK;
}
% end