gst_pad_proxy_getcaps() now takes a GstCaps* parameter to inform
the other side about the possible caps and preferences.
+ gst_pad_get_pad_template_caps() and gst_pad_get_pad_template()
+ return a new reference of the caps or template now and the return
+ value needs to be unreffed after usage.
+
+* GstPadTemplate
+ gst_pad_template_get_caps() returns a new reference of the caps
+ and the return value needs to be unreffed after usage.
+
* GstMiniObject
A miniobject is now a simple refcounted structure holding the information
common to buffers, events, messages, queries and caps.
*
* Gets the template for @pad.
*
- * Returns: (transfer none): the #GstPadTemplate from which this pad was
- * instantiated, or %NULL if this pad has no template.
- *
- * FIXME: currently returns an unrefcounted padtemplate.
+ * Returns: (transfer full): the #GstPadTemplate from which this pad was
+ * instantiated, or %NULL if this pad has no template. Unref after
+ * usage.
*/
GstPadTemplate *
gst_pad_get_pad_template (GstPad * pad)
{
+ GstPadTemplate *templ;
+
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
- return GST_PAD_PAD_TEMPLATE (pad);
-}
+ templ = GST_PAD_PAD_TEMPLATE (pad);
+ return (templ ? gst_object_ref (templ) : NULL);
+}
/* should be called with the pad LOCK held */
/* refs the caps, so caller is responsible for getting it unreffed */
*
* Gets the capabilities for @pad's template.
*
- * Returns: (transfer none): the #GstCaps of this pad template. If you intend
- * to keep a reference on the caps, make a copy (see gst_caps_copy ()).
+ * Returns: (transfer full): the #GstCaps of this pad template.
+ * Unref after usage.
*/
-const GstCaps *
+GstCaps *
gst_pad_get_pad_template_caps (GstPad * pad)
{
static GstStaticCaps anycaps = GST_STATIC_CAPS ("ANY");
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
if (GST_PAD_PAD_TEMPLATE (pad))
- return GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
+ return gst_pad_template_get_caps (GST_PAD_PAD_TEMPLATE (pad));
return gst_static_caps_get (&anycaps);
}
void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps);
void gst_pad_set_setcaps_function (GstPad *pad, GstPadSetCapsFunction setcaps);
-G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
+GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
/* capsnego function for linked/unlinked pads */
GstCaps * gst_pad_get_current_caps (GstPad * pad);
*
* Gets the capabilities of the pad template.
*
- * Returns: (transfer none): the #GstCaps of the pad template. If you need to
- * keep a reference to the caps, take a ref (see gst_caps_ref ()).
+ * Returns: (transfer full): the #GstCaps of the pad template.
+ * Unref after usage.
*/
GstCaps *
gst_pad_template_get_caps (GstPadTemplate * templ)
{
+ GstCaps *caps;
g_return_val_if_fail (GST_IS_PAD_TEMPLATE (templ), NULL);
- return GST_PAD_TEMPLATE_CAPS (templ);
+ caps = GST_PAD_TEMPLATE_CAPS (templ);
+
+ return (caps ? gst_caps_ref (caps) : NULL);
}
/**