mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
docs: add deprecation guards
Move GstPadIntLinkFunction to private header to avoid a dozen #ifdefs. Use a gpointer in public header instead.
This commit is contained in:
parent
da21881f28
commit
9ff4ec3104
4 changed files with 24 additions and 10 deletions
|
@ -241,5 +241,10 @@ extern GstDebugCategory *_priv_GST_CAT_POLL;
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
|
||||
#endif
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_PRIVATE_H__ */
|
||||
|
|
14
gst/gstpad.c
14
gst/gstpad.c
|
@ -1132,7 +1132,7 @@ had_right_state:
|
|||
* take an indeterminate amount of time.
|
||||
* You can pass NULL as the callback to make this call block. Be careful with
|
||||
* this blocking call as it might not return for reasons stated above.
|
||||
*
|
||||
*
|
||||
* <note>
|
||||
* Pad block handlers are only called for source pads in push mode
|
||||
* and sink pads in pull mode.
|
||||
|
@ -2022,7 +2022,7 @@ no_format:
|
|||
* @sinkpad: the sink #GstPad.
|
||||
*
|
||||
* Checks if the source pad and the sink pad are compatible so they can be
|
||||
* linked.
|
||||
* linked.
|
||||
*
|
||||
* Returns: TRUE if the pads can be linked.
|
||||
*/
|
||||
|
@ -3287,7 +3287,7 @@ gst_pad_iterate_internal_links_default (GstPad * pad)
|
|||
* two concurrent iterators were used and the last iterator would still be
|
||||
* thread-unsafe. Just don't use this method anymore. */
|
||||
data = g_slice_new (IntLinkIterData);
|
||||
data->list = GST_PAD_INTLINKFUNC (pad) (pad);
|
||||
data->list = ((GstPadIntLinkFunction) GST_PAD_INTLINKFUNC (pad)) (pad);
|
||||
data->cookie = 0;
|
||||
|
||||
GST_WARNING_OBJECT (pad, "Making unsafe iterator");
|
||||
|
@ -3398,7 +3398,7 @@ add_unref_pad_to_list (GstPad * pad, GList ** list)
|
|||
* Deprecated: This function does not ref the pads in the list so that they
|
||||
* could become invalid by the time the application accesses them. It's also
|
||||
* possible that the list changes while handling the pads, which the caller of
|
||||
* this function is unable to know. Use the thread-safe
|
||||
* this function is unable to know. Use the thread-safe
|
||||
* gst_pad_iterate_internal_links_default() instead.
|
||||
*/
|
||||
#ifndef GST_REMOVE_DEPRECATED
|
||||
|
@ -3490,11 +3490,11 @@ no_parent:
|
|||
*
|
||||
* Returns: (transfer full) (element-type Gst.Pad): a newly allocated #GList
|
||||
* of pads, free with g_list_free().
|
||||
*
|
||||
*
|
||||
* Deprecated: This function does not ref the pads in the list so that they
|
||||
* could become invalid by the time the application accesses them. It's also
|
||||
* possible that the list changes while handling the pads, which the caller of
|
||||
* this function is unable to know. Use the thread-safe
|
||||
* this function is unable to know. Use the thread-safe
|
||||
* gst_pad_iterate_internal_links() instead.
|
||||
*/
|
||||
#ifndef GST_REMOVE_DEPRECATED
|
||||
|
@ -3511,7 +3511,7 @@ gst_pad_get_internal_links (GstPad * pad)
|
|||
GST_WARNING_OBJECT (pad, "Calling unsafe internal links");
|
||||
|
||||
if (GST_PAD_INTLINKFUNC (pad))
|
||||
res = GST_PAD_INTLINKFUNC (pad) (pad);
|
||||
res = ((GstPadIntLinkFunction) GST_PAD_INTLINKFUNC (pad)) (pad);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
13
gst/gstpad.h
13
gst/gstpad.h
|
@ -192,7 +192,7 @@ GQuark gst_flow_to_quark (GstFlowReturn ret);
|
|||
* @GST_PAD_LINK_CHECK_NOTHING: Don't check hierarchy or caps compatibility.
|
||||
* @GST_PAD_LINK_CHECK_HIERARCHY: Check the pads have same parents/grandparents.
|
||||
* Could be omitted if it is already known that the two elements that own the
|
||||
* pads are in the same bin.
|
||||
* pads are in the same bin.
|
||||
* @GST_PAD_LINK_CHECK_TEMPLATE_CAPS: Check if the pads are compatible by using
|
||||
* their template caps. This is much faster than @GST_PAD_LINK_CHECK_CAPS, but
|
||||
* would be unsafe e.g. if one pad has %GST_CAPS_ANY.
|
||||
|
@ -223,7 +223,7 @@ typedef enum {
|
|||
/**
|
||||
* GST_PAD_LINK_CHECK_DEFAULT:
|
||||
*
|
||||
* The default checks done when linking pads (i.e. the ones used by
|
||||
* The default checks done when linking pads (i.e. the ones used by
|
||||
* gst_pad_link()).
|
||||
*
|
||||
* Since: 0.10.30
|
||||
|
@ -405,7 +405,10 @@ typedef gboolean (*GstPadCheckGetRangeFunction) (GstPad *pad);
|
|||
*
|
||||
* Deprecated: use the threadsafe #GstPadIterIntLinkFunction instead.
|
||||
*/
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* GstPadIterIntLinkFunction:
|
||||
|
@ -708,7 +711,11 @@ struct _GstPad {
|
|||
GstPadQueryFunction queryfunc;
|
||||
|
||||
/* internal links */
|
||||
GstPadIntLinkFunction intlinkfunc;
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
GstPadIntLinkFunction _intlinkfunc;
|
||||
#else
|
||||
gpointer intlinkfunc;
|
||||
#endif
|
||||
|
||||
GstPadBufferAllocFunction bufferallocfunc;
|
||||
|
||||
|
|
|
@ -298,6 +298,7 @@ G_END_DECLS
|
|||
/* We don't have deprecation guards here on purpose, it's enough to have
|
||||
* deprecation guards around _gst_plugin_register_static(), and will result in
|
||||
* much better error messages when compiling with -DGST_DISABLE_DEPRECATED */
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
#define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,package,origin) \
|
||||
static void GST_GNUC_CONSTRUCTOR \
|
||||
_gst_plugin_static_init__ ##init (void) \
|
||||
|
@ -318,6 +319,7 @@ _gst_plugin_static_init__ ##init (void) \
|
|||
}; \
|
||||
_gst_plugin_register_static (&plugin_desc_); \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GST_LICENSE_UNKNOWN:
|
||||
|
|
Loading…
Reference in a new issue