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
This commit is contained in:
Thiago Santos 2012-08-04 11:42:05 -03:00
parent 490d16b88a
commit 9285ee9184
3 changed files with 26 additions and 0 deletions

View file

@ -1357,6 +1357,30 @@ gst_pad_is_blocking (GstPad * pad)
return result;
}
/**
* 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

View file

@ -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);

View file

@ -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