#include "gstv4lmjpegsink.h"
static gboolean
-plugin_init (GModule *module,
- GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- if (!gst_v4lelement_factory_init (plugin) ||
- !gst_v4lsrc_factory_init (plugin) ||
- !gst_v4lmjpegsrc_factory_init (plugin) ||
- !gst_v4lmjpegsink_factory_init (plugin)) {
+ /* actually, we can survive without it, but I'll create
+ * that handling later on. */
+ if (!gst_library_load ("xwindowlistener"))
return FALSE;
- }
- return TRUE;
+ if (!gst_element_register (plugin, "v4lelement", GST_RANK_NONE, GST_TYPE_V4LELEMENT))
+ return FALSE;
+ if (!gst_element_register (plugin, "v4lsrc", GST_RANK_NONE, GST_TYPE_V4LSRC))
+ return FALSE;
+ if (!gst_element_register (plugin, "v4lmjpegsrc", GST_RANK_NONE, GST_TYPE_V4LMJPEGSRC))
+ return FALSE;
+ if (!gst_element_register (plugin, "v4lmjpegsink", GST_RANK_NONE, GST_TYPE_V4LMJPEGSINK))
+ return FALSE;
+ return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"video4linux",
- plugin_init
-};
+ "elements for Video 4 Linux",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
#include "gstv4lcolorbalance.h"
/* elementfactory information */
-static GstElementDetails gst_v4lelement_details = {
+static GstElementDetails gst_v4lelement_details = GST_ELEMENT_DETAILS (
"Generic video4linux Element",
"Generic/Video",
- "LGPL",
"Generic plugin for handling common video4linux calls",
- VERSION,
- "Ronald Bultje <rbultje@ronald.bitfreak.net>",
- "(C) 2001",
-};
+ "Ronald Bultje <rbultje@ronald.bitfreak.net>"
+);
/* V4lElement signals and args */
enum {
};
+static void gst_v4lelement_base_init (gpointer g_class);
static void gst_v4lelement_class_init (GstV4lElementClass *klass);
static void gst_v4lelement_init (GstV4lElement *v4lelement);
static void gst_v4lelement_dispose (GObject *object);
if (!v4lelement_type) {
static const GTypeInfo v4lelement_info = {
sizeof(GstV4lElementClass),
- NULL,
+ gst_v4lelement_base_init,
NULL,
(GClassInitFunc)gst_v4lelement_class_init,
NULL,
}
+static void
+gst_v4lelement_base_init (gpointer g_class)
+{
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_v4lelement_details);
+}
static void
gst_v4lelement_class_init (GstV4lElementClass *klass)
{
return GST_STATE_SUCCESS;
}
-
-
-gboolean
-gst_v4lelement_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
-
- /* actually, we can survive without it, but I'll create
- * that handling later on. */
- if (!gst_library_load ("xwindowlistener"))
- return FALSE;
-
- /* create an elementfactory for the v4lelement */
- factory = gst_element_factory_new("v4lelement", GST_TYPE_V4LELEMENT,
- &gst_v4lelement_details);
- g_return_val_if_fail(factory != NULL, FALSE);
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
#include <sys/types.h>
#define _LINUX_TIME_H
#include <linux/videodev.h>
+#include <gst/gst.h>
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
#define GST_TYPE_V4LELEMENT \
(gst_v4lelement_get_type())
GType gst_v4lelement_get_type(void);
-gboolean gst_v4lelement_factory_init (GstPlugin *plugin);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
#endif /* __GST_V4LELEMENT_H__ */
static GstElementDetails gst_v4lmjpegsink_details = {
"Video (video4linux/MJPEG) sink",
"Sink/Video",
- "LGPL",
"Writes MJPEG-encoded frames to a zoran MJPEG/video4linux device",
- VERSION,
- "Ronald Bultje <rbultje@ronald.bitfreak.net>",
- "(C) 2001",
+ "Ronald Bultje <rbultje@ronald.bitfreak.net>"
};
/* v4lmjpegsink signals and args */
/* init functions */
+static void gst_v4lmjpegsink_base_init (gpointer g_class);
static void gst_v4lmjpegsink_class_init (GstV4lMjpegSinkClass *klass);
static void gst_v4lmjpegsink_init (GstV4lMjpegSink *v4lmjpegsink);
if (!v4lmjpegsink_type) {
static const GTypeInfo v4lmjpegsink_info = {
sizeof(GstV4lMjpegSinkClass),
- NULL,
+ gst_v4lmjpegsink_base_init,
NULL,
(GClassInitFunc)gst_v4lmjpegsink_class_init,
NULL,
return v4lmjpegsink_type;
}
+static void
+gst_v4lmjpegsink_base_init (gpointer g_class)
+{
+ GstCaps *caps;
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_v4lmjpegsink_details);
+
+ caps = gst_caps_new ("v4lmjpegsink_caps",
+ "video/x-jpeg",
+ gst_props_new (
+ "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "height", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
+ NULL )
+ );
+ capslist = gst_caps_append(capslist, caps);
+
+ sink_template = gst_pad_template_new (
+ "sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ capslist, NULL);
+ gst_element_class_add_pad_template (gstelement_class, sink_template);
+}
static void
gst_v4lmjpegsink_class_init (GstV4lMjpegSinkClass *klass)
{
return GST_STATE_SUCCESS;
}
-
-
-gboolean
-gst_v4lmjpegsink_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
- GstCaps *caps;
-
- /* create an elementfactory for the v4lmjpegsink element */
- factory = gst_element_factory_new("v4lmjpegsink",GST_TYPE_V4LMJPEGSINK,
- &gst_v4lmjpegsink_details);
- g_return_val_if_fail(factory != NULL, FALSE);
-
- caps = gst_caps_new ("v4lmjpegsink_caps",
- "video/x-jpeg",
- gst_props_new (
- "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "height", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
- NULL )
- );
- capslist = gst_caps_append(capslist, caps);
-
- sink_template = gst_pad_template_new (
- "sink",
- GST_PAD_SINK,
- GST_PAD_ALWAYS,
- capslist, NULL);
-
- gst_element_factory_add_pad_template (factory, sink_template);
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
#include <videodev_mjpeg.h>
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
#define GST_TYPE_V4LMJPEGSINK \
GType gst_v4lmjpegsink_get_type(void);
-gboolean gst_v4lmjpegsink_factory_init (GstPlugin *plugin);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
#endif /* __GST_SDLVIDEOSINK_H__ */
static GstElementDetails gst_v4lmjpegsrc_details = {
"Video (video4linux/MJPEG) Source",
"Source/Video",
- "LGPL",
"Reads MJPEG-encoded frames from a zoran MJPEG/video4linux device",
- VERSION,
- "Ronald Bultje <rbultje@ronald.bitfreak.net>",
- "(C) 2001",
+ "Ronald Bultje <rbultje@ronald.bitfreak.net>"
};
/* V4lMjpegSrc signals and args */
/* init functions */
+static void gst_v4lmjpegsrc_base_init (gpointer g_class);
static void gst_v4lmjpegsrc_class_init (GstV4lMjpegSrcClass *klass);
static void gst_v4lmjpegsrc_init (GstV4lMjpegSrc *v4lmjpegsrc);
if (!v4lmjpegsrc_type) {
static const GTypeInfo v4lmjpegsrc_info = {
sizeof(GstV4lMjpegSrcClass),
- NULL,
+ gst_v4lmjpegsrc_base_init,
NULL,
(GClassInitFunc)gst_v4lmjpegsrc_class_init,
NULL,
}
+static void
+gst_v4lmjpegsrc_base_init (gpointer g_class)
+{
+ GstCaps *caps;
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_v4lmjpegsrc_details);
+
+ caps = gst_caps_new ("v4lmjpegsrc_caps",
+ "video/x-jpeg",
+ gst_props_new (
+ "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "height", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
+ NULL )
+ );
+ capslist = gst_caps_append(capslist, caps);
+
+ src_template = gst_pad_template_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ capslist, NULL);
+
+ gst_element_class_add_pad_template (gstelement_class, src_template);
+}
static void
gst_v4lmjpegsrc_class_init (GstV4lMjpegSrcClass *klass)
{
/* free the buffer struct et all */
gst_buffer_default_free(buf);
}
-
-
-gboolean
-gst_v4lmjpegsrc_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
- GstCaps *caps;
-
- /* create an elementfactory for the v4lmjpegsrcparse element */
- factory = gst_element_factory_new("v4lmjpegsrc",GST_TYPE_V4LMJPEGSRC,
- &gst_v4lmjpegsrc_details);
- g_return_val_if_fail(factory != NULL, FALSE);
-
- caps = gst_caps_new ("v4lmjpegsrc_caps",
- "video/x-jpeg",
- gst_props_new (
- "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "height", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
- NULL )
- );
- capslist = gst_caps_append(capslist, caps);
-
- src_template = gst_pad_template_new (
- "src",
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- capslist, NULL);
-
- gst_element_factory_add_pad_template (factory, src_template);
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
#include <sys/time.h>
#include <videodev_mjpeg.h>
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
#define GST_TYPE_V4LMJPEGSRC \
(gst_v4lmjpegsrc_get_type())
GType gst_v4lmjpegsrc_get_type(void);
-gboolean gst_v4lmjpegsrc_factory_init (GstPlugin *plugin);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
#endif /* __GST_V4LMJPEGSRC_H__ */
#include <gst/video/video.h>
/* elementfactory information */
-static GstElementDetails gst_v4lsrc_details = {
+static GstElementDetails gst_v4lsrc_details = GST_ELEMENT_DETAILS (
"Video (video4linux/raw) Source",
"Source/Video",
- "LGPL",
"Reads raw frames from a video4linux (BT8x8) device",
- VERSION,
- "Ronald Bultje <rbultje@ronald.bitfreak.net>",
- "(C) 2001",
-};
+ "Ronald Bultje <rbultje@ronald.bitfreak.net>"
+);
/* V4lSrc signals and args */
enum {
/* init functions */
+static void gst_v4lsrc_base_init (gpointer g_class);
static void gst_v4lsrc_class_init (GstV4lSrcClass *klass);
static void gst_v4lsrc_init (GstV4lSrc *v4lsrc);
if (!v4lsrc_type) {
static const GTypeInfo v4lsrc_info = {
sizeof(GstV4lSrcClass),
- NULL,
+ gst_v4lsrc_base_init,
NULL,
(GClassInitFunc)gst_v4lsrc_class_init,
NULL,
return v4lsrc_type;
}
+static void
+gst_v4lsrc_base_init (gpointer g_class)
+{
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_v4lsrc_details);
+ src_template = gst_pad_template_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ NULL);
+
+ gst_element_class_add_pad_template (gstelement_class, src_template);
+}
static void
gst_v4lsrc_class_init (GstV4lSrcClass *klass)
{
GST_V4LSRC(element)->clock = clock;
}
-
-gboolean
-gst_v4lsrc_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
-
- /* create an elementfactory for the v4lsrc */
- factory = gst_element_factory_new("v4lsrc",GST_TYPE_V4LSRC,
- &gst_v4lsrc_details);
- g_return_val_if_fail(factory != NULL, FALSE);
-
- src_template = gst_pad_template_new (
- "src",
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- NULL);
-
- gst_element_factory_add_pad_template (factory, src_template);
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
#include <gstv4lelement.h>
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
#define GST_TYPE_V4LSRC \
(gst_v4lsrc_get_type())
GType gst_v4lsrc_get_type(void);
-gboolean gst_v4lsrc_factory_init (GstPlugin *plugin);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
#endif /* __GST_V4LSRC_H__ */