pad: move gst_pad_set_caps() to compat

We want code to explicitly send a caps event instead.
This commit is contained in:
Wim Taymans 2012-06-18 16:14:19 +02:00
parent 85feb64912
commit 61fefbb542
4 changed files with 20 additions and 37 deletions

View file

@ -1623,7 +1623,6 @@ gst_pad_can_link
gst_pad_get_allowed_caps
gst_pad_get_current_caps
gst_pad_get_pad_template_caps
gst_pad_set_caps
gst_pad_get_peer
gst_pad_use_fixed_caps

View file

@ -58,6 +58,26 @@ G_BEGIN_DECLS
#define gst_tag_list_free(taglist) gst_tag_list_unref(taglist)
static inline gboolean
gst_pad_set_caps (GstPad * pad, GstCaps * caps)
{
GstEvent *event;
gboolean res = TRUE;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (caps != NULL && gst_caps_is_fixed (caps), FALSE);
event = gst_event_new_caps (caps);
if (GST_PAD_IS_SRC (pad))
res = gst_pad_push_event (pad, event);
else
res = gst_pad_send_event (pad, event);
return res;
}
#ifndef GST_DISABLE_DEPRECATED
#endif /* not GST_DISABLE_DEPRECATED */

View file

@ -2336,41 +2336,6 @@ gst_pad_get_current_caps (GstPad * pad)
return result;
}
/**
* gst_pad_set_caps:
* @pad: a #GstPad to set the capabilities of.
* @caps: (transfer none): a #GstCaps to set.
*
* Sets the capabilities of this pad. The caps must be fixed. Any previous
* caps on the pad will be unreffed. This function refs the caps so you should
* unref if as soon as you don't need it anymore.
* It is possible to set NULL caps, which will make the pad unnegotiated
* again.
*
* Returns: TRUE if the caps could be set. FALSE if the caps were not fixed
* or bad parameters were provided to this function.
*
* MT safe.
*/
gboolean
gst_pad_set_caps (GstPad * pad, GstCaps * caps)
{
GstEvent *event;
gboolean res = TRUE;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (caps != NULL && gst_caps_is_fixed (caps), FALSE);
event = gst_event_new_caps (caps);
if (GST_PAD_IS_SRC (pad))
res = gst_pad_push_event (pad, event);
else
res = gst_pad_send_event (pad, event);
return res;
}
/**
* gst_pad_get_pad_template_caps:
* @pad: a #GstPad to get the template capabilities from.

View file

@ -926,7 +926,6 @@ GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
/* capsnego function for linked/unlinked pads */
GstCaps * gst_pad_get_current_caps (GstPad * pad);
gboolean gst_pad_has_current_caps (GstPad * pad);
gboolean gst_pad_set_caps (GstPad * pad, GstCaps *caps);
/* capsnego for linked pads */
GstCaps * gst_pad_get_allowed_caps (GstPad * pad);