summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/gst/gstreamer-sections.txt1
-rw-r--r--gst/gstghostpad.c4
-rw-r--r--gst/gstpad.c26
-rw-r--r--gst/gstpad.h5
-rw-r--r--win32/common/libgstreamer.def1
5 files changed, 31 insertions, 6 deletions
diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt
index 18bf459f8..814894ba9 100644
--- a/docs/gst/gstreamer-sections.txt
+++ b/docs/gst/gstreamer-sections.txt
@@ -1735,6 +1735,7 @@ GstPad
GstPadDirection
GstPadFlags
GstPadLinkReturn
+gst_pad_link_get_name
GST_PAD_LINK_FAILED
GST_PAD_LINK_SUCCESSFUL
GstPadLinkCheck
diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c
index f6952cb99..c05be8160 100644
--- a/gst/gstghostpad.c
+++ b/gst/gstghostpad.c
@@ -869,8 +869,8 @@ gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget)
/* ERRORS */
link_failed:
{
- GST_WARNING_OBJECT (gpad, "could not link internal and target, reason:%d",
- lret);
+ GST_WARNING_OBJECT (gpad, "could not link internal and target, reason:%s",
+ gst_pad_link_get_name (lret));
return FALSE;
}
}
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 79212d3df..2fe1bdf98 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -251,6 +251,27 @@ gst_flow_to_quark (GstFlowReturn ret)
return 0;
}
+/**
+ * gst_pad_link_get_name:
+ * @ret: a #GstPadLinkReturn to get the name of.
+ *
+ * Gets a string representing the given pad-link return.
+ *
+ * Returns: a static string with the name of the pad-link return.
+ *
+ * Since: 1.3.1
+ */
+const gchar *
+gst_pad_link_get_name (GstPadLinkReturn ret)
+{
+ static const gchar *names[(-(GST_PAD_LINK_REFUSED)) + 1] = {
+ "ok", "wrong hierarchy", "was linked", "wrong direction", "no format",
+ "incompatible scheduling", "refused"
+ };
+ ret = CLAMP (ret, GST_PAD_LINK_REFUSED, GST_PAD_LINK_OK);
+ return names[-ret];
+}
+
#define _do_init \
{ \
gint i; \
@@ -2352,8 +2373,9 @@ concurrent_link:
}
link_failed:
{
- GST_CAT_INFO (GST_CAT_PADS, "link between %s:%s and %s:%s failed",
- GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
+ GST_CAT_INFO (GST_CAT_PADS, "link between %s:%s and %s:%s failed: %s",
+ GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad),
+ gst_pad_link_get_name (result));
GST_PAD_PEER (srcpad) = NULL;
GST_PAD_PEER (sinkpad) = NULL;
diff --git a/gst/gstpad.h b/gst/gstpad.h
index 140ed9788..f84d0f404 100644
--- a/gst/gstpad.h
+++ b/gst/gstpad.h
@@ -179,8 +179,9 @@ typedef enum {
GST_FLOW_CUSTOM_ERROR_2 = -102
} GstFlowReturn;
-const gchar* gst_flow_get_name (GstFlowReturn ret);
-GQuark gst_flow_to_quark (GstFlowReturn ret);
+const gchar* gst_flow_get_name (GstFlowReturn ret);
+GQuark gst_flow_to_quark (GstFlowReturn ret);
+const gchar* gst_pad_link_get_name (GstPadLinkReturn ret);
/**
* GstPadLinkCheck:
diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def
index 059a94594..666fec425 100644
--- a/win32/common/libgstreamer.def
+++ b/win32/common/libgstreamer.def
@@ -752,6 +752,7 @@ EXPORTS
gst_pad_iterate_internal_links_default
gst_pad_link
gst_pad_link_check_get_type
+ gst_pad_link_get_name
gst_pad_link_full
gst_pad_link_return_get_type
gst_pad_mark_reconfigure