From: <wi...@fr...> - 2005-06-23 14:18:30
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wingo Date: Thu Jun 23 2005 07:18:27 PDT Log message: 2005-06-23 Andy Wingo <wi...@po...> * gst/gstghostpad.c (on_int_notify): Catches notify::caps on the internal pad, and hacks accordingly. Doesn't do it on the target pad because we change its caps. Probably catches all cases of interest tho. (gst_ghost_pad_set_property): Connect to notify::caps as appropritate. Modified files: . : ChangeLog gst : gstghostpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.1153&r2=1.1154 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstghostpad.c.diff?r1=1.2&r2=1.3 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.1153 retrieving revision 1.1154 diff -u -d -r1.1153 -r1.1154 --- ChangeLog 23 Jun 2005 13:20:28 -0000 1.1153 +++ ChangeLog 23 Jun 2005 14:18:15 -0000 1.1154 @@ -1,5 +1,12 @@ 2005-06-23 Andy Wingo <wi...@po...> + * gst/gstghostpad.c (on_int_notify): Catches notify::caps on the + internal pad, and hacks accordingly. Doesn't do it on the target + pad because we change its caps. Probably catches all cases of + interest tho. + (gst_ghost_pad_set_property): Connect to notify::caps as + appropritate. + * tests/network-clock.scm (plot-simulation): Pipe data to the elite python skript. Index: gstghostpad.c RCS file: /cvs/gstreamer/gstreamer/gst/gstghostpad.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gstghostpad.c 23 Jun 2005 09:28:27 -0000 1.2 +++ gstghostpad.c 23 Jun 2005 14:18:15 -0000 1.3 @@ -386,9 +386,10 @@ GstProxyPad pad; GstPad *internal; + gulong notify_id; /*< private > */ - gpointer _gst_reserved[1]; + gpointer _gst_reserved[GST_PADDING]; }; struct _GstGhostPadClass @@ -396,7 +397,7 @@ GstProxyPadClass parent_class; @@ -478,6 +479,22 @@ } static void +on_int_notify (GstPad * internal, GParamSpec * unused, GstGhostPad * pad) +{ + GstCaps *caps; + g_object_get (internal, "caps", &caps, NULL); + GST_LOCK (pad); + gst_caps_replace (&(GST_PAD_CAPS (pad)), caps); + GST_UNLOCK (pad); + g_object_notify (G_OBJECT (pad), "caps"); + if (caps) + gst_caps_unref (caps); +} +static void gst_ghost_pad_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { @@ -492,6 +509,8 @@ if (pad->internal) { GstPad *intpeer; + g_signal_handler_disconnect (pad->internal, pad->notify_id); intpeer = gst_pad_get_peer (pad->internal); if (intpeer) { if (GST_PAD_IS_SRC (pad->internal)) { @@ -521,6 +540,13 @@ g_mutex_unlock (GST_PROXY_PAD (pad)->property_lock); return; } + /* could be more general here, iterating over all writable properties... + * taking the short road for now tho */ + pad->notify_id = g_signal_connect (internal, "notify::caps", + G_CALLBACK (on_int_notify), pad); + on_int_notify (internal, NULL, pad); /* a ref was taken by set_parent */ } |