[gst-devel] Patch: add xid property to xvideosink

Anthony Green green at spindazzle.org
Mon Nov 17 07:07:24 CET 2003


Hello,

	This patch adds an xid property to xvideosink.  This lets us easily
embed the xvideosink into other applications.

Thanks,

AG

-------------- next part --------------
2003-11-17  Anthony Green  <green at spindazzle.org>

	* sys/xvideo/xvideosink.c (gst_xvideosink_class_init): Add xid
	property.
	(gst_xvideosink_get_property): Get the xid.
	(gst_xvideosink_set_property): Set the xid.


Index: sys/xvideo/xvideosink.c
===================================================================
RCS file: /cvsroot/gstreamer/gst-plugins/sys/xvideo/xvideosink.c,v
retrieving revision 1.58
diff -c -u -p -r1.58 xvideosink.c
--- sys/xvideo/xvideosink.c	11 Nov 2003 00:43:29 -0000	1.58
+++ sys/xvideo/xvideosink.c	17 Nov 2003 14:57:17 -0000
@@ -46,6 +46,7 @@ enum {
   ARG_0,
   ARG_DISABLE_XV,
   ARG_AUTOSIZE,
+  ARG_XID,
 };
 
 static void		gst_xvideosink_base_init	(gpointer g_class);
@@ -172,6 +173,9 @@ gst_xvideosink_class_init (GstXVideoSink
   g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_AUTOSIZE,
     g_param_spec_boolean ("auto_size", "Auto Size", "Resizes the window to negotiated size",
                           TRUE, G_PARAM_READWRITE));
+  g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_XID,
+    g_param_spec_ulong ("xid", "Parent XID", "Set the parent XID",
+                        0, G_MAXULONG, 0, G_PARAM_READWRITE));
 
   gobject_class->set_property = gst_xvideosink_set_property;
   gobject_class->get_property = gst_xvideosink_get_property;
@@ -723,6 +727,9 @@ gst_xvideosink_set_property (GObject *ob
     case ARG_AUTOSIZE:
       xvideosink->auto_size = g_value_get_boolean (value);
       break;
+    case ARG_XID:
+      xvideosink->xwindow_id = g_value_get_ulong (value);
+      break;
     default:
       break;
   }
@@ -742,6 +749,9 @@ gst_xvideosink_get_property (GObject *ob
       break;
     case ARG_AUTOSIZE:
       g_value_set_boolean (value, xvideosink->auto_size);
+      break;
+    case ARG_XID:
+      g_value_set_ulong (value, xvideosink->xwindow_id);
       break;
     default: {
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);


More information about the gstreamer-devel mailing list