fix most of sys dir. v4l2 and dxr3 pending, as I don't have them

Original commit message from CVS:
fix most of sys dir. v4l2 and dxr3 pending, as I don't have them
This commit is contained in:
Benjamin Otte 2003-11-02 14:47:52 +00:00
parent 01a9ce9134
commit 679866123c
9 changed files with 119 additions and 177 deletions

View file

@ -29,23 +29,34 @@
#include "gstv4lmjpegsink.h" #include "gstv4lmjpegsink.h"
static gboolean static gboolean
plugin_init (GModule *module, plugin_init (GstPlugin *plugin)
GstPlugin *plugin)
{ {
if (!gst_v4lelement_factory_init (plugin) || /* actually, we can survive without it, but I'll create
!gst_v4lsrc_factory_init (plugin) || * that handling later on. */
!gst_v4lmjpegsrc_factory_init (plugin) || if (!gst_library_load ("xwindowlistener"))
!gst_v4lmjpegsink_factory_init (plugin)) { return FALSE;
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 FALSE;
}
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"video4linux", "video4linux",
plugin_init "elements for Video 4 Linux",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -28,15 +28,12 @@
#include "gstv4lcolorbalance.h" #include "gstv4lcolorbalance.h"
/* elementfactory information */ /* elementfactory information */
static GstElementDetails gst_v4lelement_details = { static GstElementDetails gst_v4lelement_details = GST_ELEMENT_DETAILS (
"Generic video4linux Element", "Generic video4linux Element",
"Generic/Video", "Generic/Video",
"LGPL",
"Generic plugin for handling common video4linux calls", "Generic plugin for handling common video4linux calls",
VERSION, "Ronald Bultje <rbultje@ronald.bitfreak.net>"
"Ronald Bultje <rbultje@ronald.bitfreak.net>", );
"(C) 2001",
};
/* V4lElement signals and args */ /* V4lElement signals and args */
enum { enum {
@ -54,6 +51,7 @@ enum {
}; };
static void gst_v4lelement_base_init (gpointer g_class);
static void gst_v4lelement_class_init (GstV4lElementClass *klass); static void gst_v4lelement_class_init (GstV4lElementClass *klass);
static void gst_v4lelement_init (GstV4lElement *v4lelement); static void gst_v4lelement_init (GstV4lElement *v4lelement);
static void gst_v4lelement_dispose (GObject *object); static void gst_v4lelement_dispose (GObject *object);
@ -134,7 +132,7 @@ gst_v4lelement_get_type (void)
if (!v4lelement_type) { if (!v4lelement_type) {
static const GTypeInfo v4lelement_info = { static const GTypeInfo v4lelement_info = {
sizeof(GstV4lElementClass), sizeof(GstV4lElementClass),
NULL, gst_v4lelement_base_init,
NULL, NULL,
(GClassInitFunc)gst_v4lelement_class_init, (GClassInitFunc)gst_v4lelement_class_init,
NULL, NULL,
@ -187,6 +185,13 @@ gst_v4lelement_get_type (void)
} }
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 static void
gst_v4lelement_class_init (GstV4lElementClass *klass) gst_v4lelement_class_init (GstV4lElementClass *klass)
{ {
@ -377,23 +382,3 @@ gst_v4lelement_change_state (GstElement *element)
return GST_STATE_SUCCESS; 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;
}

View file

@ -38,10 +38,9 @@
#include <sys/types.h> #include <sys/types.h>
#define _LINUX_TIME_H #define _LINUX_TIME_H
#include <linux/videodev.h> #include <linux/videodev.h>
#include <gst/gst.h>
#ifdef __cplusplus G_BEGIN_DECLS
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_V4LELEMENT \ #define GST_TYPE_V4LELEMENT \
(gst_v4lelement_get_type()) (gst_v4lelement_get_type())
@ -108,10 +107,7 @@ struct _GstV4lElementClass {
GType gst_v4lelement_get_type(void); GType gst_v4lelement_get_type(void);
gboolean gst_v4lelement_factory_init (GstPlugin *plugin);
#ifdef __cplusplus G_END_DECLS
}
#endif /* __cplusplus */
#endif /* __GST_V4LELEMENT_H__ */ #endif /* __GST_V4LELEMENT_H__ */

View file

@ -31,11 +31,8 @@
static GstElementDetails gst_v4lmjpegsink_details = { static GstElementDetails gst_v4lmjpegsink_details = {
"Video (video4linux/MJPEG) sink", "Video (video4linux/MJPEG) sink",
"Sink/Video", "Sink/Video",
"LGPL",
"Writes MJPEG-encoded frames to a zoran MJPEG/video4linux device", "Writes MJPEG-encoded frames to a zoran MJPEG/video4linux device",
VERSION, "Ronald Bultje <rbultje@ronald.bitfreak.net>"
"Ronald Bultje <rbultje@ronald.bitfreak.net>",
"(C) 2001",
}; };
/* v4lmjpegsink signals and args */ /* v4lmjpegsink signals and args */
@ -57,6 +54,7 @@ enum {
/* init functions */ /* init functions */
static void gst_v4lmjpegsink_base_init (gpointer g_class);
static void gst_v4lmjpegsink_class_init (GstV4lMjpegSinkClass *klass); static void gst_v4lmjpegsink_class_init (GstV4lMjpegSinkClass *klass);
static void gst_v4lmjpegsink_init (GstV4lMjpegSink *v4lmjpegsink); static void gst_v4lmjpegsink_init (GstV4lMjpegSink *v4lmjpegsink);
@ -100,7 +98,7 @@ gst_v4lmjpegsink_get_type (void)
if (!v4lmjpegsink_type) { if (!v4lmjpegsink_type) {
static const GTypeInfo v4lmjpegsink_info = { static const GTypeInfo v4lmjpegsink_info = {
sizeof(GstV4lMjpegSinkClass), sizeof(GstV4lMjpegSinkClass),
NULL, gst_v4lmjpegsink_base_init,
NULL, NULL,
(GClassInitFunc)gst_v4lmjpegsink_class_init, (GClassInitFunc)gst_v4lmjpegsink_class_init,
NULL, NULL,
@ -114,7 +112,32 @@ gst_v4lmjpegsink_get_type (void)
return v4lmjpegsink_type; 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 static void
gst_v4lmjpegsink_class_init (GstV4lMjpegSinkClass *klass) gst_v4lmjpegsink_class_init (GstV4lMjpegSinkClass *klass)
{ {
@ -459,38 +482,3 @@ gst_v4lmjpegsink_change_state (GstElement *element)
return GST_STATE_SUCCESS; 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;
}

View file

@ -25,9 +25,7 @@
#include <videodev_mjpeg.h> #include <videodev_mjpeg.h>
#ifdef __cplusplus G_BEGIN_DECLS
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_V4LMJPEGSINK \ #define GST_TYPE_V4LMJPEGSINK \
@ -94,11 +92,7 @@ struct _GstV4lMjpegSinkClass {
GType gst_v4lmjpegsink_get_type(void); GType gst_v4lmjpegsink_get_type(void);
gboolean gst_v4lmjpegsink_factory_init (GstPlugin *plugin);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GST_SDLVIDEOSINK_H__ */ #endif /* __GST_SDLVIDEOSINK_H__ */

View file

@ -31,11 +31,8 @@
static GstElementDetails gst_v4lmjpegsrc_details = { static GstElementDetails gst_v4lmjpegsrc_details = {
"Video (video4linux/MJPEG) Source", "Video (video4linux/MJPEG) Source",
"Source/Video", "Source/Video",
"LGPL",
"Reads MJPEG-encoded frames from a zoran MJPEG/video4linux device", "Reads MJPEG-encoded frames from a zoran MJPEG/video4linux device",
VERSION, "Ronald Bultje <rbultje@ronald.bitfreak.net>"
"Ronald Bultje <rbultje@ronald.bitfreak.net>",
"(C) 2001",
}; };
/* V4lMjpegSrc signals and args */ /* V4lMjpegSrc signals and args */
@ -66,6 +63,7 @@ enum {
/* init functions */ /* init functions */
static void gst_v4lmjpegsrc_base_init (gpointer g_class);
static void gst_v4lmjpegsrc_class_init (GstV4lMjpegSrcClass *klass); static void gst_v4lmjpegsrc_class_init (GstV4lMjpegSrcClass *klass);
static void gst_v4lmjpegsrc_init (GstV4lMjpegSrc *v4lmjpegsrc); static void gst_v4lmjpegsrc_init (GstV4lMjpegSrc *v4lmjpegsrc);
@ -123,7 +121,7 @@ gst_v4lmjpegsrc_get_type (void)
if (!v4lmjpegsrc_type) { if (!v4lmjpegsrc_type) {
static const GTypeInfo v4lmjpegsrc_info = { static const GTypeInfo v4lmjpegsrc_info = {
sizeof(GstV4lMjpegSrcClass), sizeof(GstV4lMjpegSrcClass),
NULL, gst_v4lmjpegsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_v4lmjpegsrc_class_init, (GClassInitFunc)gst_v4lmjpegsrc_class_init,
NULL, NULL,
@ -139,6 +137,32 @@ gst_v4lmjpegsrc_get_type (void)
} }
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 static void
gst_v4lmjpegsrc_class_init (GstV4lMjpegSrcClass *klass) gst_v4lmjpegsrc_class_init (GstV4lMjpegSrcClass *klass)
{ {
@ -814,38 +838,3 @@ gst_v4lmjpegsrc_buffer_free (GstBufferPool *pool, GstBuffer *buf, gpointer user_
/* free the buffer struct et all */ /* free the buffer struct et all */
gst_buffer_default_free(buf); 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;
}

View file

@ -24,9 +24,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <videodev_mjpeg.h> #include <videodev_mjpeg.h>
#ifdef __cplusplus G_BEGIN_DECLS
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_V4LMJPEGSRC \ #define GST_TYPE_V4LMJPEGSRC \
(gst_v4lmjpegsrc_get_type()) (gst_v4lmjpegsrc_get_type())
@ -112,10 +110,7 @@ struct _GstV4lMjpegSrcClass {
GType gst_v4lmjpegsrc_get_type(void); GType gst_v4lmjpegsrc_get_type(void);
gboolean gst_v4lmjpegsrc_factory_init (GstPlugin *plugin);
#ifdef __cplusplus G_END_DECLS
}
#endif /* __cplusplus */
#endif /* __GST_V4LMJPEGSRC_H__ */ #endif /* __GST_V4LMJPEGSRC_H__ */

View file

@ -30,15 +30,12 @@
#include <gst/video/video.h> #include <gst/video/video.h>
/* elementfactory information */ /* elementfactory information */
static GstElementDetails gst_v4lsrc_details = { static GstElementDetails gst_v4lsrc_details = GST_ELEMENT_DETAILS (
"Video (video4linux/raw) Source", "Video (video4linux/raw) Source",
"Source/Video", "Source/Video",
"LGPL",
"Reads raw frames from a video4linux (BT8x8) device", "Reads raw frames from a video4linux (BT8x8) device",
VERSION, "Ronald Bultje <rbultje@ronald.bitfreak.net>"
"Ronald Bultje <rbultje@ronald.bitfreak.net>", );
"(C) 2001",
};
/* V4lSrc signals and args */ /* V4lSrc signals and args */
enum { enum {
@ -59,6 +56,7 @@ enum {
/* init functions */ /* init functions */
static void gst_v4lsrc_base_init (gpointer g_class);
static void gst_v4lsrc_class_init (GstV4lSrcClass *klass); static void gst_v4lsrc_class_init (GstV4lSrcClass *klass);
static void gst_v4lsrc_init (GstV4lSrc *v4lsrc); static void gst_v4lsrc_init (GstV4lSrc *v4lsrc);
@ -114,7 +112,7 @@ gst_v4lsrc_get_type (void)
if (!v4lsrc_type) { if (!v4lsrc_type) {
static const GTypeInfo v4lsrc_info = { static const GTypeInfo v4lsrc_info = {
sizeof(GstV4lSrcClass), sizeof(GstV4lSrcClass),
NULL, gst_v4lsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_v4lsrc_class_init, (GClassInitFunc)gst_v4lsrc_class_init,
NULL, NULL,
@ -129,7 +127,21 @@ gst_v4lsrc_get_type (void)
return v4lsrc_type; 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 static void
gst_v4lsrc_class_init (GstV4lSrcClass *klass) gst_v4lsrc_class_init (GstV4lSrcClass *klass)
{ {
@ -826,26 +838,3 @@ gst_v4lsrc_set_clock (GstElement *element,
GST_V4LSRC(element)->clock = clock; 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;
}

View file

@ -22,9 +22,7 @@
#include <gstv4lelement.h> #include <gstv4lelement.h>
#ifdef __cplusplus G_BEGIN_DECLS
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_V4LSRC \ #define GST_TYPE_V4LSRC \
(gst_v4lsrc_get_type()) (gst_v4lsrc_get_type())
@ -94,10 +92,7 @@ struct _GstV4lSrcClass {
GType gst_v4lsrc_get_type(void); GType gst_v4lsrc_get_type(void);
gboolean gst_v4lsrc_factory_init (GstPlugin *plugin);
#ifdef __cplusplus G_END_DECLS
}
#endif /* __cplusplus */
#endif /* __GST_V4LSRC_H__ */ #endif /* __GST_V4LSRC_H__ */