diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-25 08:51:15 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-25 08:51:15 +0000 |
commit | da722eecfb7378fad758416b0c291673f4b90632 (patch) | |
tree | 6f3528928e53d0ab3ec78ca5522a716cea3bc18b /sys/v4l2/gstv4l2element.c | |
parent | 637d0fcfb5a03f7e1b71655b1551b8db8363f278 (diff) | |
download | gst-plugins-bad-da722eecfb7378fad758416b0c291673f4b90632.tar.gz gst-plugins-bad-da722eecfb7378fad758416b0c291673f4b90632.tar.bz2 gst-plugins-bad-da722eecfb7378fad758416b0c291673f4b90632.zip |
sys/: Remove client-side overlay handling, use the X-server v4l plugin for that. Nicer overlay, less code. Also make ...
Original commit message from CVS:
* sys/v4l/Makefile.am:
* sys/v4l/gstv4l.c: (plugin_init):
* sys/v4l/gstv4lelement.c: (gst_v4lelement_get_type),
(gst_v4lelement_init), (gst_v4lelement_dispose),
(gst_v4lelement_change_state):
* sys/v4l/gstv4lelement.h:
* sys/v4l/gstv4lxoverlay.c: (gst_v4l_xoverlay_open),
(gst_v4l_xoverlay_close), (idle_refresh),
(gst_v4l_xoverlay_set_xwindow_id):
* sys/v4l/gstv4lxoverlay.h:
* sys/v4l/v4l-overlay_calls.c:
* sys/v4l/v4l_calls.h:
* sys/v4l2/Makefile.am:
* sys/v4l2/gstv4l2.c: (plugin_init):
* sys/v4l2/gstv4l2element.c: (gst_v4l2element_get_type),
(gst_v4l2element_init), (gst_v4l2element_dispose),
(gst_v4l2element_change_state):
* sys/v4l2/gstv4l2element.h:
* sys/v4l2/gstv4l2xoverlay.c: (gst_v4l2_xoverlay_open),
(gst_v4l2_xoverlay_close), (idle_refresh),
(gst_v4l2_xoverlay_set_xwindow_id):
* sys/v4l2/gstv4l2xoverlay.h:
* sys/v4l2/v4l2-overlay_calls.c:
* sys/v4l2/v4l2_calls.h:
Remove client-side overlay handling, use the X-server v4l plugin
for that. Nicer overlay, less code. Also make the plugin
compileable without X (but then without overlay, obviously).
Makes xwindowlistener obsolete, should we remove that?
Diffstat (limited to 'sys/v4l2/gstv4l2element.c')
-rw-r--r-- | sys/v4l2/gstv4l2element.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/v4l2/gstv4l2element.c b/sys/v4l2/gstv4l2element.c index 8326125f..743b3b70 100644 --- a/sys/v4l2/gstv4l2element.c +++ b/sys/v4l2/gstv4l2element.c @@ -28,7 +28,9 @@ #include "v4l2_calls.h" #include "gstv4l2tuner.h" +#ifdef HAVE_XVIDEO #include "gstv4l2xoverlay.h" +#endif #include "gstv4l2colorbalance.h" #include <gst/propertyprobe/propertyprobe.h> @@ -284,11 +286,13 @@ gst_v4l2element_get_type (void) NULL, NULL, }; +#ifdef HAVE_XVIDEO static const GInterfaceInfo v4l2_xoverlay_info = { (GInterfaceInitFunc) gst_v4l2_xoverlay_interface_init, NULL, NULL, }; +#endif static const GInterfaceInfo v4l2_colorbalance_info = { (GInterfaceInitFunc) gst_v4l2_color_balance_interface_init, NULL, @@ -308,8 +312,10 @@ gst_v4l2element_get_type (void) GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info); g_type_add_interface_static (v4l2element_type, GST_TYPE_TUNER, &v4l2_tuner_info); +#ifdef HAVE_XVIDEO g_type_add_interface_static (v4l2element_type, GST_TYPE_X_OVERLAY, &v4l2_xoverlay_info); +#endif g_type_add_interface_static (v4l2element_type, GST_TYPE_COLOR_BALANCE, &v4l2_colorbalance_info); g_type_add_interface_static (v4l2element_type, @@ -412,13 +418,10 @@ gst_v4l2element_init (GstV4l2Element * v4l2element) v4l2element->video_fd = -1; v4l2element->buffer = NULL; v4l2element->device = g_strdup ("/dev/video0"); - v4l2element->display = g_strdup (g_getenv ("DISPLAY")); v4l2element->channels = NULL; v4l2element->norms = NULL; v4l2element->colors = NULL; - - v4l2element->overlay = gst_v4l2_xoverlay_new (v4l2element); } @@ -427,14 +430,6 @@ gst_v4l2element_dispose (GObject * object) { GstV4l2Element *v4l2element = GST_V4L2ELEMENT (object); - if (v4l2element->overlay) { - gst_v4l2_xoverlay_free (v4l2element); - } - - if (v4l2element->display) { - g_free (v4l2element->display); - } - g_free (v4l2element->device); v4l2element->device = NULL; g_free (v4l2element->norm); @@ -576,19 +571,21 @@ gst_v4l2element_change_state (GstElement * element) */ switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: - gst_v4l2_set_display (v4l2element); - if (!gst_v4l2_open (v4l2element)) return GST_STATE_FAILURE; +#ifdef HAVE_XVIDEO gst_v4l2_xoverlay_open (v4l2element); +#endif /* emit a signal! whoopie! */ g_signal_emit (G_OBJECT (v4l2element), gst_v4l2element_signals[SIGNAL_OPEN], 0, v4l2element->device); break; case GST_STATE_READY_TO_NULL: +#ifdef HAVE_XVIDEO gst_v4l2_xoverlay_close (v4l2element); +#endif if (!gst_v4l2_close (v4l2element)) return GST_STATE_FAILURE; |