[gst-devel] source plugin blocked in PAUSE state
Riccardo Corona
coronariccardo at gmail.com
Mon Jul 2 16:44:26 CEST 2007
Ok,
I've started from the plugin template from cvs as suggested on plugin writer
manual.
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.
Here's some snippet:
.h
#include <gst/base/gstbasesrc.h>
G_BEGIN_DECLS
/* #defines don't like whitespacey bits */
#define GST_TYPE_PLUGIN_TEMPLATE \
(gst_plugin_template_get_type())/*(gst_base_src_get_type())*/
#define GST_PLUGIN_TEMPLATE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTattile))
#define GST_PLUGIN_TEMPLATE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLUGIN_TEMPLATE,GstPluginTattileClass))
#define GST_IS_PLUGIN_TEMPLATE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLUGIN_TEMPLATE))
#define GST_IS_PLUGIN_TEMPLATE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLUGIN_TEMPLATE))
typedef struct _GstMyPlugin GstMyPlugin ;
typedef struct _GstMyPlugin Class GstMyPlugin Class;
struct _GstMyPlugin
{
GstBaseSrc element;
GstPad *srcpad;
gboolean silent;
};
struct _GstMyPlugin Class
{
GstBaseSrcClass parent_class;
};
GType gst_plugin_template_get_type (void);
G_END_DECLS
#endif /* __GST_PLUGIN_TEMPLATE_H__ */
And .c :
#include "gstplugin.h"
GST_DEBUG_CATEGORY_STATIC (gst_plugin_template_debug);
#define GST_CAT_DEFAULT gst_plugin_template_debug
/* Filter signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
ARG_0,
ARG_SILENT
};
static GstFlowReturn create (GstBaseSrc *src, guint64 offset, guint size,
GstBuffer **buf);
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("ANY")
);
GST_BOILERPLATE (GstMyPlugin, gst_plugin_template, GstBaseSrc ,
GST_TYPE_BASE_SRC);
static void gst_plugin_template_set_property (GObject * object, guint
prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_plugin_template_get_property (GObject * object, guint
prop_id,
GValue * value, GParamSpec * pspec);
static gboolean gst_plugin_template_set_caps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_plugin_template_chain (GstPad * pad, GstBuffer *
buf);
.........
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.
Thank's.
2007/6/29, René Stadler <mail at renestadler.de>:
>
> Am Freitag, den 29.06.2007, 18:34 +0200 schrieb Riccardo Corona:
> > I've wrote the vmethod create() and set the type as GST_TYPE_BASE_SRC,
> > but now gst-inspect give me this error :
>
> > CRITICAL **: file E:\devel-cvs\src\gstreamer\gst\gstelementfactory.c:
> > line 266: assertion `g_type_is_a (type, GST_TYPE_ELEMENT)'
> > failed
> >
> This indicates a problem with the setup of your element. Could be
> anything. No one can help you without seeing your code.
>
>
> <snipped away mess of previous mails>
>
> --
> Regards,
> René Stadler
>
>
--
Riccardo Corona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070702/fc5f689e/attachment.htm>
More information about the gstreamer-devel
mailing list