From 61fefbb54201970dc42a514c9b836f1dc32f80be Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Jun 2012 16:14:19 +0200 Subject: [PATCH] pad: move gst_pad_set_caps() to compat We want code to explicitly send a caps event instead. --- docs/gst/gstreamer-sections.txt | 1 - gst/gstcompat.h | 20 ++++++++++++++++++++ gst/gstpad.c | 35 ----------------------------------- gst/gstpad.h | 1 - 4 files changed, 20 insertions(+), 37 deletions(-) diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index cd6e570..44e0c45 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -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 diff --git a/gst/gstcompat.h b/gst/gstcompat.h index 97728f4..62ee85d 100644 --- a/gst/gstcompat.h +++ b/gst/gstcompat.h @@ -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 */ diff --git a/gst/gstpad.c b/gst/gstpad.c index 2a0069b..6ec225e 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -2337,41 +2337,6 @@ gst_pad_get_current_caps (GstPad * pad) } /** - * 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. * diff --git a/gst/gstpad.h b/gst/gstpad.h index 268a57c..2281ed7 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -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); -- 2.7.4