From f6195ba59aa6981e7e3af2dfd556df6d870bf2ad Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Thu, 28 Jul 2005 10:38:02 +0000 Subject: [PATCH] gst/base/gstbasetransform.c: Better debug if no transform is possible. Original commit message from CVS: * gst/base/gstbasetransform.c: (gst_base_transform_setcaps): Better debug if no transform is possible. --- ChangeLog | 5 +++++ gst/base/gstbasetransform.c | 22 +++++++++++++++++++++- libs/gst/base/gstbasetransform.c | 22 +++++++++++++++++++++- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 943eeb21ac..f559bf2b00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-28 Ronald S. Bultje + + * gst/base/gstbasetransform.c: (gst_base_transform_setcaps): + Better debug if no transform is possible. + 2005-07-27 Wim Taymans * docs/random/wtay/network-transp: diff --git a/gst/base/gstbasetransform.c b/gst/base/gstbasetransform.c index 3aba064ebe..2ab0db9fb9 100644 --- a/gst/base/gstbasetransform.c +++ b/gst/base/gstbasetransform.c @@ -299,6 +299,7 @@ gst_base_transform_configure_caps (GstBaseTransform * trans, GstCaps * in, return ret; } +#include static gboolean gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) { @@ -321,7 +322,10 @@ gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) /* see how we can transform the input caps */ othercaps = gst_base_transform_transform_caps (trans, pad, caps); - + if (!strcmp (GST_OBJECT_NAME (trans), "vconv")) { + g_print ("%s transforms into %s\n", + gst_caps_to_string (caps), gst_caps_to_string (othercaps)); + } /* check if transform is empty */ if (!othercaps || gst_caps_is_empty (othercaps)) goto no_transform; @@ -361,6 +365,11 @@ gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) peercaps = gst_pad_get_caps (otherpeer); intersect = gst_caps_intersect (peercaps, othercaps); + if (!strcmp (GST_OBJECT_NAME (trans), "vconv")) { + g_print ("%s -> %s = %s\n", + gst_caps_to_string (peercaps), + gst_caps_to_string (othercaps), gst_caps_to_string (intersect)); + } gst_caps_unref (peercaps); gst_caps_unref (othercaps); othercaps = intersect; @@ -369,6 +378,9 @@ gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) "filtering against peer yields %" GST_PTR_FORMAT, othercaps); } + if (gst_caps_is_empty (othercaps)) + goto no_transform_possible; + if (!gst_caps_is_fixed (othercaps)) { GstCaps *temp; @@ -426,6 +438,14 @@ no_transform: ret = FALSE; goto done; } +no_transform_possible: + { + GST_DEBUG_OBJECT (trans, + "transform could not transform %" GST_PTR_FORMAT + " in anything we support", caps); + ret = FALSE; + goto done; + } could_not_fixate: { GST_DEBUG_OBJECT (trans, "FAILED to fixate %" GST_PTR_FORMAT, othercaps); diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 3aba064ebe..2ab0db9fb9 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -299,6 +299,7 @@ gst_base_transform_configure_caps (GstBaseTransform * trans, GstCaps * in, return ret; } +#include static gboolean gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) { @@ -321,7 +322,10 @@ gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) /* see how we can transform the input caps */ othercaps = gst_base_transform_transform_caps (trans, pad, caps); - + if (!strcmp (GST_OBJECT_NAME (trans), "vconv")) { + g_print ("%s transforms into %s\n", + gst_caps_to_string (caps), gst_caps_to_string (othercaps)); + } /* check if transform is empty */ if (!othercaps || gst_caps_is_empty (othercaps)) goto no_transform; @@ -361,6 +365,11 @@ gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) peercaps = gst_pad_get_caps (otherpeer); intersect = gst_caps_intersect (peercaps, othercaps); + if (!strcmp (GST_OBJECT_NAME (trans), "vconv")) { + g_print ("%s -> %s = %s\n", + gst_caps_to_string (peercaps), + gst_caps_to_string (othercaps), gst_caps_to_string (intersect)); + } gst_caps_unref (peercaps); gst_caps_unref (othercaps); othercaps = intersect; @@ -369,6 +378,9 @@ gst_base_transform_setcaps (GstPad * pad, GstCaps * caps) "filtering against peer yields %" GST_PTR_FORMAT, othercaps); } + if (gst_caps_is_empty (othercaps)) + goto no_transform_possible; + if (!gst_caps_is_fixed (othercaps)) { GstCaps *temp; @@ -426,6 +438,14 @@ no_transform: ret = FALSE; goto done; } +no_transform_possible: + { + GST_DEBUG_OBJECT (trans, + "transform could not transform %" GST_PTR_FORMAT + " in anything we support", caps); + ret = FALSE; + goto done; + } could_not_fixate: { GST_DEBUG_OBJECT (trans, "FAILED to fixate %" GST_PTR_FORMAT, othercaps);