From: <sl...@ke...> - 2007-03-22 17:12:40
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: slomo Date: Thu Mar 22 2007 17:12:35 UTC Log message: * gst/gstpad.c: (gst_pad_set_caps), (gst_pad_alloc_buffer_full), (gst_pad_chain_unchecked), (gst_pad_push): Check in set_caps if the caps are compatible with the pad and remove two functions that are redundant now. Fixes #421543. Modified files: . : ChangeLog gst : gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.3132&r2=1.3133 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.548&r2=1.549 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.3132 retrieving revision 1.3133 diff -u -d -r1.3132 -r1.3133 --- ChangeLog 22 Mar 2007 12:31:54 -0000 1.3132 +++ ChangeLog 22 Mar 2007 17:12:23 -0000 1.3133 @@ -1,3 +1,10 @@ +2007-03-22 Sebastian Dröge <sl...@ci...> + + * gst/gstpad.c: (gst_pad_set_caps), (gst_pad_alloc_buffer_full), + (gst_pad_chain_unchecked), (gst_pad_push): + Check in set_caps if the caps are compatible with the pad and remove + two functions that are redundant now. Fixes #421543. 2007-03-22 Wim Taymans <wi...@fl...> * tests/check/gst/gstsystemclock.c: (GST_START_TEST), Index: gstpad.c RCS file: /cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.548 retrieving revision 1.549 diff -u -d -r1.548 -r1.549 --- gstpad.c 22 Mar 2007 08:23:41 -0000 1.548 +++ gstpad.c 22 Mar 2007 17:12:23 -0000 1.549 @@ -2343,6 +2343,9 @@ g_return_val_if_fail (GST_IS_PAD (pad), FALSE); g_return_val_if_fail (caps == NULL || gst_caps_is_fixed (caps), FALSE); + if (!gst_pad_accept_caps (pad, caps)) + goto could_not_set; GST_OBJECT_LOCK (pad); existing = GST_PAD_CAPS (pad); if (existing == caps) @@ -2403,65 +2406,6 @@ } } -static gboolean -gst_pad_configure_sink (GstPad * pad, GstCaps * caps) -{ - GstPadSetCapsFunction setcaps; - gboolean res; - - setcaps = GST_PAD_SETCAPSFUNC (pad); - /* See if pad accepts the caps - only needed if - * no setcaps function */ - if (setcaps == NULL) - if (!gst_pad_accept_caps (pad, caps)) - goto not_accepted; - /* set caps on pad if call succeeds */ - res = gst_pad_set_caps (pad, caps); - /* no need to unref the caps here, set_caps takes a ref and - * our ref goes away when we leave this function. */ - return res; -not_accepted: - { - GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, - "caps %" GST_PTR_FORMAT " not accepted", caps); - return FALSE; - } -} -/* returns TRUE if the src pad could be configured to accept the given caps */ -gst_pad_configure_src (GstPad * pad, GstCaps * caps, gboolean dosetcaps) - if (dosetcaps) - res = gst_pad_set_caps (pad, caps); - else - res = TRUE; /** * gst_pad_get_pad_template_caps: * @pad: a #GstPad to get the template capabilities from. @@ -2742,7 +2686,7 @@ /* we got a new datatype on the pad, see if it can handle it */ if (G_UNLIKELY (caps_changed)) { GST_DEBUG_OBJECT (pad, "caps changed to %p %" GST_PTR_FORMAT, caps, caps); - if (G_UNLIKELY (!gst_pad_configure_src (pad, caps, setcaps))) + if (G_UNLIKELY (setcaps && !gst_pad_set_caps (pad, caps))) goto not_negotiated; return ret; @@ -3443,7 +3387,7 @@ - if (G_UNLIKELY (!gst_pad_configure_sink (pad, caps))) + if (G_UNLIKELY (!gst_pad_set_caps (pad, caps))) @@ -3620,7 +3564,7 @@ /* we got a new datatype from the pad, it had better handle it */ - if (G_UNLIKELY (!gst_pad_configure_src (pad, caps, TRUE))) |