Ok,<br>I&#39;ve started from the plugin template from cvs as suggested on plugin writer manual.<br>All that I&#39;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&#39;s some snippet:<br><br><br>.h<br><br>#include &lt;gst/base/gstbasesrc.h&gt;<br><br>G_BEGIN_DECLS<br><br>/* #defines don&#39;t like whitespacey bits */<br>#define GST_TYPE_PLUGIN_TEMPLATE \<br>&nbsp; (gst_plugin_template_get_type())/*(gst_base_src_get_type())*/
<br>#define GST_PLUGIN_TEMPLATE(obj) \<br>&nbsp; (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTattile))<br>#define GST_PLUGIN_TEMPLATE_CLASS(klass) \<br>&nbsp; (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTattileClass))
<br>#define GST_IS_PLUGIN_TEMPLATE(obj) \<br>&nbsp; (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLUGIN_TEMPLATE))<br>#define GST_IS_PLUGIN_TEMPLATE_CLASS(klass) \<br>&nbsp; (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>&nbsp; GstBaseSrc element;<br><br>&nbsp; GstPad *srcpad;<br><br>&nbsp; gboolean silent;<br>};<br>
<br>struct _GstMyPlugin Class <br>{<br>&nbsp; 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 &quot;gstplugin.h&quot;<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>&nbsp; /* FILL ME */
<br>&nbsp; LAST_SIGNAL<br>};<br><br>enum<br>{<br>&nbsp; ARG_0,<br>&nbsp; ARG_SILENT<br>};<br><br>static GstFlowReturn create (GstBaseSrc *src, guint64 offset, guint size,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstBuffer **buf);<br><br><br>static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE (&quot;src&quot;,
<br>&nbsp;&nbsp;&nbsp; GST_PAD_SRC,<br>&nbsp;&nbsp;&nbsp; GST_PAD_ALWAYS,<br>&nbsp;&nbsp;&nbsp; GST_STATIC_CAPS (&quot;ANY&quot;)<br>&nbsp;&nbsp;&nbsp; );<br><br>GST_BOILERPLATE (GstMyPlugin, gst_plugin_template, GstBaseSrc ,<br>&nbsp;&nbsp;&nbsp; GST_TYPE_BASE_SRC);<br><br>static void gst_plugin_template_set_property (GObject * object, guint prop_id,
<br>&nbsp;&nbsp;&nbsp; const GValue * value, GParamSpec * pspec);<br>static void gst_plugin_template_get_property (GObject * object, guint prop_id,<br>&nbsp;&nbsp;&nbsp; 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&#39;m omitting the implementation of these function because I haven&#39;t touched the plugin template from cvs, I&#39;ve only erased all the references to the sink element since I&#39;m trying to write a src plugin.
<br><br>Thank&#39;s.<br><br><br><br><br><br><br><div><span class="gmail_quote">2007/6/29, René Stadler &lt;<a href="mailto:mail@renestadler.de">mail@renestadler.de</a>&gt;:</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>&gt; I&#39;ve wrote the vmethod create() and set the type as GST_TYPE_BASE_SRC,<br>&gt; but now gst-inspect give me this&nbsp;&nbsp;error :<br><br>&gt; CRITICAL **: file E:\devel-cvs\src\gstreamer\gst\gstelementfactory.c:
<br>&gt; line 266: assertion `g_type_is_a (type, GST_TYPE_ELEMENT)&#39;<br>&gt;&nbsp;&nbsp;failed<br>&gt;<br>This indicates a problem with the setup of your element.&nbsp;&nbsp;Could be<br>anything.&nbsp;&nbsp;No one can help you without seeing your code.
<br><br><br>&lt;snipped away mess of previous mails&gt;<br><br>--<br>Regards,<br>&nbsp;&nbsp;René Stadler<br><br></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Corona