gst/base/gstbasetransform.c: Better debug if no transform is possible.
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 28 Jul 2005 10:38:02 +0000 (10:38 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 28 Jul 2005 10:38:02 +0000 (10:38 +0000)
Original commit message from CVS:
* gst/base/gstbasetransform.c: (gst_base_transform_setcaps):
Better debug if no transform is possible.

ChangeLog
gst/base/gstbasetransform.c
libs/gst/base/gstbasetransform.c

index 943eeb2..f559bf2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-28  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * gst/base/gstbasetransform.c: (gst_base_transform_setcaps):
+         Better debug if no transform is possible.
+
 2005-07-27  Wim Taymans  <wim@fluendo.com>
 
        * docs/random/wtay/network-transp:
index 3aba064..2ab0db9 100644 (file)
@@ -299,6 +299,7 @@ gst_base_transform_configure_caps (GstBaseTransform * trans, GstCaps * in,
   return ret;
 }
 
+#include <string.h>
 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);
index 3aba064..2ab0db9 100644 (file)
@@ -299,6 +299,7 @@ gst_base_transform_configure_caps (GstBaseTransform * trans, GstCaps * in,
   return ret;
 }
 
+#include <string.h>
 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);