Ok,<br>I've started from the plugin template from cvs as suggested on plugin writer manual.<br>All that I've done was to change the base class to gst_base_src, just to see if I can create my own plugin deriving it from base_src.
<br>Here's some snippet:<br><br><br>.h<br><br>#include <gst/base/gstbasesrc.h><br><br>G_BEGIN_DECLS<br><br>/* #defines don't like whitespacey bits */<br>#define GST_TYPE_PLUGIN_TEMPLATE \<br> (gst_plugin_template_get_type())/*(gst_base_src_get_type())*/
<br>#define GST_PLUGIN_TEMPLATE(obj) \<br> (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTattile))<br>#define GST_PLUGIN_TEMPLATE_CLASS(klass) \<br> (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTattileClass))
<br>#define GST_IS_PLUGIN_TEMPLATE(obj) \<br> (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLUGIN_TEMPLATE))<br>#define GST_IS_PLUGIN_TEMPLATE_CLASS(klass) \<br> (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLUGIN_TEMPLATE))
<br><br>typedef struct _GstMyPlugin GstMyPlugin ;<br>typedef struct _GstMyPlugin Class GstMyPlugin Class;<br><br>struct _GstMyPlugin <br>{<br> GstBaseSrc element;<br><br> GstPad *srcpad;<br><br> gboolean silent;<br>};<br>
<br>struct _GstMyPlugin Class <br>{<br> GstBaseSrcClass parent_class;<br>};<br><br>GType gst_plugin_template_get_type (void);<br><br>G_END_DECLS<br><br>#endif /* __GST_PLUGIN_TEMPLATE_H__ */<br><br><br><br>And .c :<br><br>
<br><br>#include "gstplugin.h"<br><br>GST_DEBUG_CATEGORY_STATIC (gst_plugin_template_debug);<br>#define GST_CAT_DEFAULT gst_plugin_template_debug<br><br>/* Filter signals and args */<br>enum<br>{<br> /* FILL ME */
<br> LAST_SIGNAL<br>};<br><br>enum<br>{<br> ARG_0,<br> ARG_SILENT<br>};<br><br>static GstFlowReturn create (GstBaseSrc *src, guint64 offset, guint size,<br> GstBuffer **buf);<br><br><br>static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
<br> GST_PAD_SRC,<br> GST_PAD_ALWAYS,<br> GST_STATIC_CAPS ("ANY")<br> );<br><br>GST_BOILERPLATE (GstMyPlugin, gst_plugin_template, GstBaseSrc ,<br> GST_TYPE_BASE_SRC);<br><br>static void gst_plugin_template_set_property (GObject * object, guint prop_id,
<br> const GValue * value, GParamSpec * pspec);<br>static void gst_plugin_template_get_property (GObject * object, guint prop_id,<br> GValue * value, GParamSpec * pspec);<br><br>static gboolean gst_plugin_template_set_caps (GstPad * pad, GstCaps * caps);
<br>static GstFlowReturn gst_plugin_template_chain (GstPad * pad, GstBuffer * buf);<br><br>.........<br><br>I'm omitting the implementation of these function because I haven't touched the plugin template from cvs, I've only erased all the references to the sink element since I'm trying to write a src plugin.
<br><br>Thank's.<br><br><br><br><br><br><br><div><span class="gmail_quote">2007/6/29, René Stadler <<a href="mailto:mail@renestadler.de">mail@renestadler.de</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am Freitag, den 29.06.2007, 18:34 +0200 schrieb Riccardo Corona:<br>> I've wrote the vmethod create() and set the type as GST_TYPE_BASE_SRC,<br>> but now gst-inspect give me this error :<br><br>> CRITICAL **: file E:\devel-cvs\src\gstreamer\gst\gstelementfactory.c:
<br>> line 266: assertion `g_type_is_a (type, GST_TYPE_ELEMENT)'<br>> failed<br>><br>This indicates a problem with the setup of your element. Could be<br>anything. No one can help you without seeing your code.
<br><br><br><snipped away mess of previous mails><br><br>--<br>Regards,<br> René Stadler<br><br></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Corona