{
GstCaps *caps;
- /* if there are no caps, we can connect */
+ /* if there are no caps, we can link */
if ((src == NULL) && (sink == NULL))
return TRUE;
/* get an intersection */
caps = gst_caps_intersect (src, sink);
- /* if the caps can't connect, there is no intersection */
+ /* if the caps can't link, there is no intersection */
if (caps == NULL)
return FALSE;
- /* hurrah, we can connect, now remove the intersection */
+ /* hurrah, we can link, now remove the intersection */
gst_caps_unref (caps);
return TRUE;
}
/* autoplugging functions */
static GstElement * gst_spider_find_element_to_plug (GstElement *src, GstElementFactory *fac, GstPadDirection dir);
-static GstPadConnectReturn gst_spider_plug (GstSpiderConnection *conn);
-static GstPadConnectReturn gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad);
-/*static GstPadConnectReturn gst_spider_plug_peers (GstSpider *spider, GstPad *srcpad, GstPad *sinkpad); */
-static GstPadConnectReturn gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath);
+static GstPadLinkReturn gst_spider_plug (GstSpiderConnection *conn);
+static GstPadLinkReturn gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad);
+/*static GstPadLinkReturn gst_spider_plug_peers (GstSpider *spider, GstPad *srcpad, GstPad *sinkpad); */
+static GstPadLinkReturn gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath);
/* random functions */
static gchar * gst_spider_unused_elementname (GstBin *bin, const gchar *startwith);
}
/* links src to sink using the elementfactories in plugpath
* plugpath will be removed afterwards */
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath)
{
GstSpider *spider = (GstSpider *) GST_OBJECT_PARENT (conn->src);
return NULL;
}
/* try to establish the link */
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_spider_plug (GstSpiderConnection *conn)
{
GstSpider *spider = (GstSpider *) GST_OBJECT_PARENT (conn->src);
return GST_PAD_LINK_REFUSED;
}
/* try to establish the link using this pad */
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad)
{
GstElement *element;
"SpiderIdentity",
"Generic",
"LGPL",
- "Connection between spider and outside elements",
+ "Link between spider and outside elements",
VERSION,
"Benjamin Otte <in7y118@public.uni-hamburg.de>",
"(C) 2002",
/* functions set in pads, elements and stuff */
static void gst_spider_identity_chain (GstPad *pad, GstBuffer *buf);
static GstElementStateReturn gst_spider_identity_change_state (GstElement *element);
-static GstPadConnectReturn gst_spider_identity_link (GstPad *pad, GstCaps *caps);
+static GstPadLinkReturn gst_spider_identity_link (GstPad *pad, GstCaps *caps);
static GstCaps * gst_spider_identity_getcaps (GstPad *pad, GstCaps *caps);
/* loop functions */
static void gst_spider_identity_dumb_loop (GstSpiderIdentity *ident);
}
/* shamelessly stolen from gstqueue.c to get proxy links */
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_spider_identity_link (GstPad *pad, GstCaps *caps)
{
GstSpiderIdentity *spider_identity = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
return gst_pad_get_allowed_caps (otherpad);
}
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_identity_link (GstPad *pad, GstCaps *caps)
{
GstIdentity *identity;
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_tee_request_new_pad);
}
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_tee_sinklink (GstPad *pad, GstCaps *caps)
{
GstTee *tee;
const GList *pads;
- GstPadConnectReturn set_retval;
+ GstPadLinkReturn set_retval;
tee = GST_TEE (gst_pad_get_parent (pad));
/**
* gst_caps_is_always_compatible:
* @fromcaps: a #GstCaps capability to check compatibility of.
- * @tocaps: the #GstCaps capabilty to check compatibility with.
+ * @tocaps: the #GstCaps capability to check compatibility with.
*
- * Checks if a connection is always possible from fromcaps to tocaps, for all
+ * Checks if a link is always possible from fromcaps to tocaps, for all
* possible capabilities.
*
* Returns: TRUE if compatible under all circumstances, FALSE otherwise.
{
if (fromcaps == NULL) {
if (tocaps == NULL) {
- /* if both are NULL, they can always connect. Think filesrc ! filesink */
+ /* if both are NULL, they can always link. Think filesrc ! filesink */
GST_DEBUG (GST_CAT_CAPS, "both caps NULL, compatible");
return TRUE;
}
* @dest: the #GstElement containing the destination pad.
* @filtercaps: the #GstCaps to use as a filter.
*
- * Connects the source to the destination element using the filtercaps.
+ * Links the source to the destination element using the filtercaps.
* The link must be from source to destination, the other
* direction will not be tried.
* The functions looks for existing pads that aren't linked yet.
* @src: a #GstElement containing the source pad.
* @dest: the #GstElement containing the destination pad.
*
- * Connects the source to the destination element.
+ * Links the source to the destination element.
* The link must be from source to destination, the other
* direction will not be tried.
* The functions looks for existing pads and request pads that aren't
* @destpadname: the name of the #GstPad in destination element.
* @filtercaps: the #GstCaps to use as a filter.
*
- * Connects the two named pads of the source and destination elements.
+ * Links the two named pads of the source and destination elements.
* Side effect is that if one of the pads has no parent, it becomes a
* child of the parent of the other element. If they have different
* parents, the link fails.
* @dest: the #GstElement containing the destination pad.
* @destpadname: the name of the #GstPad in destination element.
*
- * Connects the two named pads of the source and destination elements.
+ * Links the two named pads of the source and destination elements.
* Side effect is that if one of the pads has no parent, it becomes a
* child of the parent of the other element. If they have different
* parents, the link fails.
GST_CAT_CLOCK, /* Clocking */
GST_CAT_ELEMENT_PADS, /* Element pad management */
GST_CAT_ELEMENT_FACTORY, /* Elementfactory stuff */
- GST_CAT_PADS, /* Pad creation/connection */
+ GST_CAT_PADS, /* Pad creation/linking */
GST_CAT_PIPELINE, /* Pipeline stuff */
GST_CAT_PLUGIN_LOADING, /* Plugin loading */
GST_CAT_PLUGIN_ERRORS, /* Errors during plugin loading */
pad->eventfunc = gst_pad_event_default;
pad->convertfunc = gst_pad_convert_default;
pad->queryfunc = gst_pad_query_default;
- pad->intconnfunc = gst_pad_get_internal_links_default;
+ pad->intlinkfunc = gst_pad_get_internal_links_default;
pad->eventmaskfunc = gst_pad_get_event_masks_default;
pad->formatsfunc = gst_pad_get_formats_default;
/**
* gst_pad_set_internal_link_function:
* @pad: a #GstPad to set the internal link function for.
- * @intconn: the #GstPadIntConnFunction to set.
+ * @intlink: the #GstPadIntLinkFunction to set.
*
* Sets the given internal link function for the pad.
*/
void
gst_pad_set_internal_link_function (GstPad *pad,
- GstPadIntConnFunction intconn)
+ GstPadIntLinkFunction intlink)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
- GST_RPAD_INTCONNFUNC (pad) = intconn;
+ GST_RPAD_INTLINKFUNC (pad) = intlink;
GST_DEBUG (GST_CAT_PADS, "internal link for %s:%s set to %s",
- GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (intconn));
+ GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (intlink));
}
/**
/**
* gst_pad_set_link_function:
* @pad: a #GstPad to set the link function for.
- * @link: the #GstPadConnectFunction to set.
+ * @link: the #GstPadLinkFunction to set.
*
* Sets the given link function for the pad. It will be called
* when the pad is linked or relinked with caps.
*/
void
gst_pad_set_link_function (GstPad *pad,
- GstPadConnectFunction link)
+ GstPadLinkFunction link)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
* @srcpad: the source #GstPad to link.
* @sinkpad: the sink #GstPad to link.
*
- * Connects the source pad to the sink pad.
+ * Links the source pad to the sink pad.
*
* Returns: TRUE if the pad could be linked, FALSE otherwise.
*/
* 2. deals with the result code of the link function
* 3. sets fixed caps on the pad.
*/
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
{
GstCaps *oldcaps, *allowed = NULL;
/* we need to notify the link function */
if (notify && GST_RPAD_LINKFUNC (pad)) {
- GstPadConnectReturn res;
+ GstPadLinkReturn res;
gchar *debug_string;
gboolean negotiating;
*
* Tries to set the caps on the given pad.
*
- * Returns: A GstPadConnectReturn value indicating whether the caps
+ * Returns: A #GstPadLinkReturn value indicating whether the caps
* could be set.
*/
-GstPadConnectReturn
+GstPadLinkReturn
gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
{
GstRealPad *peer, *realpad;
- GstPadConnectReturn set_retval;
+ GstPadLinkReturn set_retval;
realpad = GST_PAD_REALIZE (pad);
peer = GST_RPAD_PEER (realpad);
/* no negotiation is performed if the pads have filtercaps */
if (intersection) {
- GstPadConnectReturn res;
+ GstPadLinkReturn res;
res = gst_pad_try_set_caps_func (realsrc, intersection, TRUE);
if (res == GST_PAD_LINK_REFUSED)
*
* Returns: TRUE if the peer pad accepted the caps, FALSE otherwise.
*/
-GstPadConnectReturn
+GstPadLinkReturn
gst_pad_proxy_link (GstPad *pad, GstCaps *caps)
{
GstRealPad *peer, *realpad;
rpad = GST_PAD_REALIZE (pad);
- if (GST_RPAD_INTCONNFUNC (rpad))
- res = GST_RPAD_INTCONNFUNC (rpad) (GST_PAD_CAST (rpad));
+ if (GST_RPAD_INTLINKFUNC (rpad))
+ res = GST_RPAD_INTLINKFUNC (rpad) (GST_PAD_CAST (rpad));
return res;
}
GST_PAD_LINK_DELAYED = 0,
GST_PAD_LINK_OK = 1,
GST_PAD_LINK_DONE = 2
-} GstPadConnectReturn;
+} GstPadLinkReturn;
/* convenience functions */
#ifdef G_HAVE_ISO_VARARGS
GstFormat *dest_format, gint64 *dest_value);
typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
-typedef GList* (*GstPadIntConnFunction) (GstPad *pad);
+typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
typedef const GstFormat* (*GstPadFormatsFunction) (GstPad *pad);
typedef const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad);
typedef const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
-typedef GstPadConnectReturn (*GstPadConnectFunction) (GstPad *pad, GstCaps *caps);
+typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstCaps *caps);
typedef GstCaps* (*GstPadGetCapsFunction) (GstPad *pad, GstCaps *caps);
typedef GstBufferPool* (*GstPadBufferPoolFunction) (GstPad *pad);
GstPadDirection direction;
- GstPadConnectFunction linkfunc;
+ GstPadLinkFunction linkfunc;
GstRealPad *peer;
gpointer sched_private;
GstPadQueryFunction queryfunc;
GstPadFormatsFunction formatsfunc;
GstPadQueryTypeFunction querytypefunc;
- GstPadIntConnFunction intconnfunc;
+ GstPadIntLinkFunction intlinkfunc;
GstPadBufferPoolFunction bufferpoolfunc;
#define GST_RPAD_EVENTHANDLER(pad) (((GstRealPad *)(pad))->eventhandler)
#define GST_RPAD_CONVERTFUNC(pad) (((GstRealPad *)(pad))->convertfunc)
#define GST_RPAD_QUERYFUNC(pad) (((GstRealPad *)(pad))->queryfunc)
-#define GST_RPAD_INTCONNFUNC(pad) (((GstRealPad *)(pad))->intconnfunc)
+#define GST_RPAD_INTLINKFUNC(pad) (((GstRealPad *)(pad))->intlinkfunc)
#define GST_RPAD_FORMATSFUNC(pad) (((GstRealPad *)(pad))->formatsfunc)
#define GST_RPAD_QUERYTYPEFUNC(pad) (((GstRealPad *)(pad))->querytypefunc)
#define GST_RPAD_EVENTMASKFUNC(pad) (((GstRealPad *)(pad))->eventmaskfunc)
const GstEventMask* gst_pad_get_event_masks_default (GstPad *pad);
/* pad links */
-void gst_pad_set_link_function (GstPad *pad, GstPadConnectFunction link);
+void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
/* capsnego functions */
GstCaps* gst_pad_get_caps (GstPad *pad);
GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
-GstPadConnectReturn gst_pad_try_set_caps (GstPad *pad, GstCaps *caps);
+GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, GstCaps *caps);
gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad);
void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
-GstPadConnectReturn gst_pad_proxy_link (GstPad *pad, GstCaps *caps);
+GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, GstCaps *caps);
gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
gboolean gst_pad_query_default (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
-void gst_pad_set_internal_link_function(GstPad *pad, GstPadIntConnFunction intconn);
+void gst_pad_set_internal_link_function(GstPad *pad, GstPadIntLinkFunction intlink);
GList* gst_pad_get_internal_links (GstPad *pad);
GList* gst_pad_get_internal_links_default (GstPad *pad);
gstelement_class->release_locks = GST_DEBUG_FUNCPTR(gst_queue_release_locks);
}
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_queue_link (GstPad *pad, GstCaps *caps)
{
GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
GST_OPT_CHAIN_TO_CHAIN,
GST_OPT_CHAIN_TO_LOOP,
GST_OPT_LOOP_TO_LOOP,
-} ConnectionType;
+} LinkType;
/*
* Entry points for this scheduler.
gst_opt_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad)
{
GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
- ConnectionType type = GST_OPT_INVALID;
+ LinkType type = GST_OPT_INVALID;
GstElement *element1, *element2;
GST_INFO (GST_CAT_SCHEDULING, "pad link between \"%s:%s\" and \"%s:%s\"",
return gst_pad_get_allowed_caps (otherpad);
}
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_identity_link (GstPad *pad, GstCaps *caps)
{
GstIdentity *identity;
gstelement_class->release_locks = GST_DEBUG_FUNCPTR(gst_queue_release_locks);
}
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_queue_link (GstPad *pad, GstCaps *caps)
{
GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_tee_request_new_pad);
}
-static GstPadConnectReturn
+static GstPadLinkReturn
gst_tee_sinklink (GstPad *pad, GstCaps *caps)
{
GstTee *tee;
const GList *pads;
- GstPadConnectReturn set_retval;
+ GstPadLinkReturn set_retval;
tee = GST_TEE (gst_pad_get_parent (pad));
print_query_types (gst_pad_get_query_types (GST_PAD (realpad)));
}
- if (realpad->intconnfunc != gst_pad_get_internal_links_default)
+ if (realpad->intlinkfunc != gst_pad_get_internal_links_default)
g_print (" Has custom intconnfunc(): %s\n",
- GST_DEBUG_FUNCPTR_NAME(realpad->intconnfunc));
+ GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc));
if (realpad->bufferpoolfunc)
g_print (" Has bufferpoolfunc(): %s\n",