mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
v4l plugins: add open/close signals v4l2 plugins: add open/close signals move source format enumeration from v4l2elem...
Original commit message from CVS: v4l plugins: * add open/close signals v4l2 plugins: * add open/close signals * move source format enumeration from v4l2element to v4l2src * adapt to the final v4l2 API in kernel 2.5 (patches for 2.4 on http://bytesex.org/patches) * small tweaks
This commit is contained in:
parent
f0ceb74eb2
commit
957282a65d
3 changed files with 34 additions and 4 deletions
|
@ -1,14 +1,14 @@
|
||||||
TODO list (short term):
|
TODO list (short term):
|
||||||
=======================
|
=======================
|
||||||
* fix clocking issues by using gst clock for v4lsrc and by using it
|
* fix clocking issues by using gst clock for v4lsrc and by using it
|
||||||
as a correction for v4lmjpegsrc/v4l2src
|
as a correction for v4lmjpegsrc/v4l2src (pause brokenness etc.)
|
||||||
* v4lsrc/v4lmjpegsrc/v4l2src: fix interlacing (not handled at all...)
|
* v4lsrc/v4lmjpegsrc/v4l2src: fix interlacing (not handled at all...)
|
||||||
|
|
||||||
TODO list (long term):
|
TODO list (long term):
|
||||||
======================
|
======================
|
||||||
* v4lmpegsrc (*hint* MPEG card needed *hint*)
|
* v4lmpegsrc (*hint* MPEG card needed *hint*)
|
||||||
* v4l2sink
|
* v4l2sink
|
||||||
* BSD-videosrc (meteorsrc?)
|
* BSD-videosrc (bktr)
|
||||||
* color correction (brightness, hue, etc.)
|
* color correction (brightness, hue, etc.)
|
||||||
* gamma correction
|
* gamma correction
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ Useful Documentation:
|
||||||
MJPEG/V4L API : ./videodev_mjpeg.h
|
MJPEG/V4L API : ./videodev_mjpeg.h
|
||||||
Linux/V4L API : /usr/include/linux/videodev.h or
|
Linux/V4L API : /usr/include/linux/videodev.h or
|
||||||
http://roadrunner.swansea.uk.linux.org/v4l.shtml
|
http://roadrunner.swansea.uk.linux.org/v4l.shtml
|
||||||
Linux/V4L2 API: http://www.thedirks.org/v4l2/
|
Linux/V4L2 API: /usr/include/linux/videodev2.h or
|
||||||
|
http://www.thedirks.org/v4l2/
|
||||||
|
(kernel patches: http://bytesex.org/patches/)
|
||||||
BSD/Meteor API: /usr/include/machine/ioctl_meteor.h
|
BSD/Meteor API: /usr/include/machine/ioctl_meteor.h
|
||||||
mjpegtools : http://www.sourceforge.net/projects/mjpeg
|
mjpegtools : http://www.sourceforge.net/projects/mjpeg
|
||||||
|
|
|
@ -33,6 +33,8 @@ static GstElementDetails gst_v4lelement_details = {
|
||||||
/* V4lElement signals and args */
|
/* V4lElement signals and args */
|
||||||
enum {
|
enum {
|
||||||
/* FILL ME */
|
/* FILL ME */
|
||||||
|
SIGNAL_OPEN,
|
||||||
|
SIGNAL_CLOSE,
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -82,7 +84,7 @@ static gboolean plugin_init (GModule *mo
|
||||||
|
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
/*static guint gst_v4lelement_signals[LAST_SIGNAL] = { 0 }; */
|
static guint gst_v4lelement_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
|
@ -205,6 +207,18 @@ gst_v4lelement_class_init (GstV4lElementClass *klass)
|
||||||
g_param_spec_pointer("videowindow","videowindow","videowindow",
|
g_param_spec_pointer("videowindow","videowindow","videowindow",
|
||||||
G_PARAM_WRITABLE));
|
G_PARAM_WRITABLE));
|
||||||
|
|
||||||
|
/* signals */
|
||||||
|
gst_v4lelement_signals[SIGNAL_OPEN] =
|
||||||
|
g_signal_new("open", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
|
||||||
|
G_STRUCT_OFFSET(GstV4lElementClass, open),
|
||||||
|
NULL, NULL, g_cclosure_marshal_VOID__STRING,
|
||||||
|
G_TYPE_NONE, 1, G_TYPE_STRING);
|
||||||
|
gst_v4lelement_signals[SIGNAL_CLOSE] =
|
||||||
|
g_signal_new("close", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
|
||||||
|
G_STRUCT_OFFSET(GstV4lElementClass, close),
|
||||||
|
NULL, NULL, g_cclosure_marshal_VOID__STRING,
|
||||||
|
G_TYPE_NONE, 1, G_TYPE_STRING);
|
||||||
|
|
||||||
gobject_class->set_property = gst_v4lelement_set_property;
|
gobject_class->set_property = gst_v4lelement_set_property;
|
||||||
gobject_class->get_property = gst_v4lelement_get_property;
|
gobject_class->get_property = gst_v4lelement_get_property;
|
||||||
|
|
||||||
|
@ -532,6 +546,10 @@ gst_v4lelement_change_state (GstElement *element)
|
||||||
if (!gst_v4l_open(v4lelement))
|
if (!gst_v4l_open(v4lelement))
|
||||||
return GST_STATE_FAILURE;
|
return GST_STATE_FAILURE;
|
||||||
|
|
||||||
|
g_signal_emit(G_OBJECT(v4lelement),
|
||||||
|
gst_v4lelement_signals[SIGNAL_OPEN], 0,
|
||||||
|
v4lelement->videodev);
|
||||||
|
|
||||||
/* now, sync options */
|
/* now, sync options */
|
||||||
if (v4lelement->norm >= VIDEO_MODE_PAL &&
|
if (v4lelement->norm >= VIDEO_MODE_PAL &&
|
||||||
v4lelement->norm < VIDEO_MODE_AUTO &&
|
v4lelement->norm < VIDEO_MODE_AUTO &&
|
||||||
|
@ -581,6 +599,10 @@ gst_v4lelement_change_state (GstElement *element)
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
if (!gst_v4l_close(v4lelement))
|
if (!gst_v4l_close(v4lelement))
|
||||||
return GST_STATE_FAILURE;
|
return GST_STATE_FAILURE;
|
||||||
|
|
||||||
|
g_signal_emit(G_OBJECT(v4lelement),
|
||||||
|
gst_v4lelement_signals[SIGNAL_CLOSE], 0,
|
||||||
|
v4lelement->videodev);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,12 @@ struct _GstV4lElement {
|
||||||
|
|
||||||
struct _GstV4lElementClass {
|
struct _GstV4lElementClass {
|
||||||
GstElementClass parent_class;
|
GstElementClass parent_class;
|
||||||
|
|
||||||
|
/* signals */
|
||||||
|
void (*open) (GstElement *element,
|
||||||
|
const gchar *device);
|
||||||
|
void (*close) (GstElement *element,
|
||||||
|
const gchar *device);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_v4lelement_get_type(void);
|
GType gst_v4lelement_get_type(void);
|
||||||
|
|
Loading…
Reference in a new issue