pad: add no-reconfigure link check

Enable it to prevent sending reconfigure when linking elements.

Useful for autoplugging when we know caps or bufferpools shouldn't change
to save doing caps renegotiation to end up with the same final scenario.

The no-reconfigure is not a proper check, it is a flag. It is implemented
as a GstPadLinkCheck to avoid creating another gst_pad_link variant.

https://bugzilla.gnome.org/show_bug.cgi?id=757653
This commit is contained in:
Thiago Santos 2015-11-05 17:13:25 -03:00 committed by Sebastian Dröge
parent c570df71e5
commit 83cac0f7b6
2 changed files with 9 additions and 1 deletions

View file

@ -2520,7 +2520,8 @@ gst_pad_link_full (GstPad * srcpad, GstPad * sinkpad, GstPadLinkCheck flags)
GST_CAT_INFO (GST_CAT_PADS, "linked %s:%s and %s:%s, successful", GST_CAT_INFO (GST_CAT_PADS, "linked %s:%s and %s:%s, successful",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad)); GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
gst_pad_send_event (srcpad, gst_event_new_reconfigure ()); if (!(flags & GST_PAD_LINK_CHECK_NO_RECONFIGURE))
gst_pad_send_event (srcpad, gst_event_new_reconfigure ());
done: done:
if (G_LIKELY (parent)) { if (G_LIKELY (parent)) {

View file

@ -196,6 +196,8 @@ const gchar* gst_pad_link_get_name (GstPadLinkReturn ret);
* would be unsafe e.g. if one pad has %GST_CAPS_ANY. * would be unsafe e.g. if one pad has %GST_CAPS_ANY.
* @GST_PAD_LINK_CHECK_CAPS: Check if the pads are compatible by comparing the * @GST_PAD_LINK_CHECK_CAPS: Check if the pads are compatible by comparing the
* caps returned by gst_pad_query_caps(). * caps returned by gst_pad_query_caps().
* @GST_PAD_LINK_CHECK_NO_RECONFIGURE: Disables pushing a reconfigure event when pads are
* linked.
* @GST_PAD_LINK_CHECK_DEFAULT: The default checks done when linking * @GST_PAD_LINK_CHECK_DEFAULT: The default checks done when linking
* pads (i.e. the ones used by gst_pad_link()). * pads (i.e. the ones used by gst_pad_link()).
* *
@ -217,6 +219,11 @@ typedef enum {
GST_PAD_LINK_CHECK_TEMPLATE_CAPS = 1 << 1, GST_PAD_LINK_CHECK_TEMPLATE_CAPS = 1 << 1,
GST_PAD_LINK_CHECK_CAPS = 1 << 2, GST_PAD_LINK_CHECK_CAPS = 1 << 2,
/* Not really checks, more like flags
* Added here to avoid creating a new gst_pad_link_variant */
GST_PAD_LINK_CHECK_NO_RECONFIGURE = 1 << 3,
GST_PAD_LINK_CHECK_DEFAULT = GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS GST_PAD_LINK_CHECK_DEFAULT = GST_PAD_LINK_CHECK_HIERARCHY | GST_PAD_LINK_CHECK_CAPS
} GstPadLinkCheck; } GstPadLinkCheck;