From: Thiago Santos Date: Sat, 4 Aug 2012 14:42:05 +0000 (-0300) Subject: pad: add gst_pad_needs_reconfigure X-Git-Tag: RELEASE-0.11.94~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9285ee9184113ef9050c80f9e2648837e57f47a3;p=platform%2Fupstream%2Fgstreamer.git pad: add gst_pad_needs_reconfigure Add an alternative version of gst_pad_check_reconfigure that doesn't clear the reconfigure flag. Useful for increasing error resilience without duplicating the reconfigure code in pad task functions. API: gst_pad_needs_reconfigure https://bugzilla.gnome.org/show_bug.cgi?id=681198 --- diff --git a/gst/gstpad.c b/gst/gstpad.c index 49b65aa..f700c82 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1358,6 +1358,30 @@ gst_pad_is_blocking (GstPad * pad) } /** + * gst_pad_needs_reconfigure: + * @pad: the #GstPad to check + * + * Check the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE + * if the flag was set. + * + * Returns: %TRUE is the GST_PAD_FLAG_NEED_RECONFIGURE flag is set on @pad. + */ +gboolean +gst_pad_needs_reconfigure (GstPad * pad) +{ + gboolean reconfigure; + + g_return_val_if_fail (GST_IS_PAD (pad), FALSE); + + GST_OBJECT_LOCK (pad); + reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad); + GST_DEBUG_OBJECT (pad, "peeking RECONFIGURE flag %d", reconfigure); + GST_OBJECT_UNLOCK (pad); + + return reconfigure; +} + +/** * gst_pad_check_reconfigure: * @pad: the #GstPad to check * diff --git a/gst/gstpad.h b/gst/gstpad.h index 105c479..2fd7ff1 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -852,6 +852,7 @@ gboolean gst_pad_is_blocked (GstPad *pad); gboolean gst_pad_is_blocking (GstPad *pad); void gst_pad_mark_reconfigure (GstPad *pad); +gboolean gst_pad_needs_reconfigure (GstPad *pad); gboolean gst_pad_check_reconfigure (GstPad *pad); void gst_pad_set_element_private (GstPad *pad, gpointer priv); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 062bc83..fdba8f3 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -686,6 +686,7 @@ EXPORTS gst_pad_link_return_get_type gst_pad_mark_reconfigure gst_pad_mode_get_type + gst_pad_needs_reconfigure gst_pad_new gst_pad_new_from_static_template gst_pad_new_from_template