gstreamer/tests/old/examples/gob/gst-identity2.gob

140 lines
3.6 KiB
Text
Raw Normal View History

%header{
#include <gst/gst.h>
#include "gst-identity2.h"
#include "gst-identity2-private.h"
%}
class Gst:Identity2 from Gst:Element {
/* plugin init */
private gboolean
plugin_init (GModule *module, GstPlugin *plugin)
{
Add docs for adder, use GST_ELEMENT_DETAILS macro, define GstElementDetails at the top Original commit message from CVS: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-base-plugins-docs.sgml: * docs/plugins/gst-plugins-base-plugins-sections.txt: * ext/cdparanoia/gstcdparanoiasrc.c: * ext/gnomevfs/gstgnomevfssink.c: (gst_gnome_vfs_sink_base_init), (gst_gnome_vfs_sink_class_init): * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_base_init): * ext/ogg/gstoggdemux.c: (gst_ogg_demux_base_init): * ext/ogg/gstoggmux.c: * ext/ogg/gstoggparse.c: (gst_ogg_parse_base_init): * ext/ogg/gstogmparse.c: (gst_ogm_audio_parse_base_init), (gst_ogm_video_parse_base_init), (gst_ogm_text_parse_base_init): * ext/pango/gsttextoverlay.c: * ext/pango/gsttextrender.c: * ext/theora/theoradec.c: * ext/theora/theoraenc.c: * ext/vorbis/vorbisdec.c: * ext/vorbis/vorbisenc.c: * gst-libs/gst/audio/gstaudiofilter.c: (gst_audio_filter_base_init): * gst-libs/gst/audio/gstaudiofiltertemplate.c: (gst_audio_filter_template_base_init): * gst/adder/gstadder.c: (gst_adder_get_type): * gst/adder/gstadder.h: * gst/audioconvert/gstaudioconvert.c: * gst/audiotestsrc/gstaudiotestsrc.c: (gst_audiostestsrc_wave_get_type), (gst_audio_test_src_class_init), (gst_audio_test_src_create): * gst/ffmpegcolorspace/gstffmpegcolorspace.c: * gst/playback/gstdecodebin.c: * gst/playback/gstplaybin.c: * gst/playback/gststreamselector.c: (gst_stream_selector_base_init): * gst/subparse/gstsubparse.c: (gst_sub_parse_base_init): * gst/volume/gstvolume.c: * sys/v4l/gstv4lmjpegsink.c: * sys/v4l/gstv4lmjpegsrc.c: * tests/check/libs/cddabasesrc.c: * tests/old/examples/gob/gst-identity2.gob: Add docs for adder, use GST_ELEMENT_DETAILS macro, define GstElementDetails at the top
2006-03-24 10:42:11 +00:00
static GstElementDetails identity2_details =
GST_ELEMENT_DETAILS (
"GOB Identity",
"Filter/Effect",
"Does nothing",
Add docs for adder, use GST_ELEMENT_DETAILS macro, define GstElementDetails at the top Original commit message from CVS: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-base-plugins-docs.sgml: * docs/plugins/gst-plugins-base-plugins-sections.txt: * ext/cdparanoia/gstcdparanoiasrc.c: * ext/gnomevfs/gstgnomevfssink.c: (gst_gnome_vfs_sink_base_init), (gst_gnome_vfs_sink_class_init): * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_base_init): * ext/ogg/gstoggdemux.c: (gst_ogg_demux_base_init): * ext/ogg/gstoggmux.c: * ext/ogg/gstoggparse.c: (gst_ogg_parse_base_init): * ext/ogg/gstogmparse.c: (gst_ogm_audio_parse_base_init), (gst_ogm_video_parse_base_init), (gst_ogm_text_parse_base_init): * ext/pango/gsttextoverlay.c: * ext/pango/gsttextrender.c: * ext/theora/theoradec.c: * ext/theora/theoraenc.c: * ext/vorbis/vorbisdec.c: * ext/vorbis/vorbisenc.c: * gst-libs/gst/audio/gstaudiofilter.c: (gst_audio_filter_base_init): * gst-libs/gst/audio/gstaudiofiltertemplate.c: (gst_audio_filter_template_base_init): * gst/adder/gstadder.c: (gst_adder_get_type): * gst/adder/gstadder.h: * gst/audioconvert/gstaudioconvert.c: * gst/audiotestsrc/gstaudiotestsrc.c: (gst_audiostestsrc_wave_get_type), (gst_audio_test_src_class_init), (gst_audio_test_src_create): * gst/ffmpegcolorspace/gstffmpegcolorspace.c: * gst/playback/gstdecodebin.c: * gst/playback/gstplaybin.c: * gst/playback/gststreamselector.c: (gst_stream_selector_base_init): * gst/subparse/gstsubparse.c: (gst_sub_parse_base_init): * gst/volume/gstvolume.c: * sys/v4l/gstv4lmjpegsink.c: * sys/v4l/gstv4lmjpegsrc.c: * tests/check/libs/cddabasesrc.c: * tests/old/examples/gob/gst-identity2.gob: Add docs for adder, use GST_ELEMENT_DETAILS macro, define GstElementDetails at the top
2006-03-24 10:42:11 +00:00
"Wim Taymans <wim.taymans@chello.be>");
GstElementFactory *factory;
factory = gst_elementfactory_new ("identity2", TYPE_SELF,
&identity2_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_plugin_add_feature (plugin, &(factory->feature));
return TRUE;
}
/* pads FIXME gob oculd be improved here */
private GstPad *sinkpad =
{
gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (o), o->_priv->sinkpad);
gst_pad_set_chain_function (o->_priv->sinkpad, chain);
gst_pad_set_bufferpool_function (o->_priv->sinkpad, get_bufferpool);
//gst_pad_set_negotiate_function (o->_priv->sinkpad, negotiate_sink);
};
private GstPad *srcpad =
{
gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (o), o->_priv->srcpad);
//gst_pad_set_negotiate_function (o->_priv->srcpad, negotiate_src);
};
/* arguments */
/*
private gboolean loop_based = FALSE; argument BOOL loop_based
get {
ARG = self->_priv->loop_based;
}
set {
self->_priv->loop_based = ARG;
if (self->_priv->loop_based) {
gst_element_set_loop_function (GST_ELEMENT (self), loop);
gst_pad_set_chain_function (self->_priv->sinkpad, NULL);
}
else {
gst_pad_set_chain_function (self->_priv->sinkpad, chain);
gst_element_set_loop_function (GST_ELEMENT (self), NULL);
}
};*/
private guint sleep_time = 0; argument UINT sleep_time link;
private gboolean silent = FALSE; argument BOOL silent link;
/* signals */
private signal last NONE(NONE) void handoff(self);
/* core code here */
private GstBufferPool*
get_bufferpool (GstPad *pad (check null))
{
Self *self = SELF (gst_pad_get_parent (pad));
return gst_pad_get_bufferpool (self->_priv->srcpad);
}
/* private GstPadNegotiateReturn
negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
Self *self = SELF (gst_pad_get_parent (pad));
return gst_pad_negotiate_proxy (pad, self->_priv->sinkpad, caps);
}
private GstPadNegotiateReturn
negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
Self *self = SELF (gst_pad_get_parent (pad));
return gst_pad_negotiate_proxy (pad, self->_priv->srcpad, caps);
} */
private void
chain (GstPad *pad (check null), GstBuffer *buf (check null))
{
Self *self;
self = SELF (gst_pad_get_parent (pad));
if (!self->_priv->silent)
g_print("identity2: chain ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(pad));
handoff (self);
gst_pad_push (self->_priv->srcpad, buf);
if (self->_priv->sleep_time)
usleep (self->_priv->sleep_time);
}
/*private void
loop (GstElement *element (check null))
{
Self *self = SELF (element);
GstBuffer *buf;
do {
buf = gst_pad_pull (self->_priv->sinkpad);
g_print("identity2: loop ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(self->_priv->sinkpad));
handoff (self);
gst_pad_push (self->_priv->srcpad, buf);
if (self->_priv->sleep_time)
usleep (self->_priv->sleep_time);
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
}*/
}
%{
GstPluginDesc plugin_desc = {
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"identity2",
gst_identity2_plugin_init
};
%}