Simplify caps to get rid of duplicates, fixes #345444
authorStefan Kost <ensonic@users.sourceforge.net>
Sun, 20 Aug 2006 19:30:09 +0000 (19:30 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Sun, 20 Aug 2006 19:30:09 +0000 (19:30 +0000)
Original commit message from CVS:
* gst/gst.c:
* gst/gstpad.c: (gst_pad_set_active):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_transform_caps):
Simplify caps to get rid of duplicates, fixes #345444

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

index 16e7960..a1107e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2006-08-20  Stefan Kost  <ensonic@users.sf.net>
 
+       * gst/gst.c:
+       * gst/gstpad.c: (gst_pad_set_active):
+       * libs/gst/base/gstbasetransform.c:
+       (gst_base_transform_transform_caps):
+          Simplify caps to get rid of duplicates, fixes #345444
+
+2006-08-20  Stefan Kost  <ensonic@users.sf.net>
+
        * gst/gstvalue.c:
        * gst/gstvalue.h:
           Use these optimizations only internaly.
index 8c00dcf..1976212 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -565,6 +565,16 @@ static GstPluginDesc plugin_desc = {
 
 #ifndef GST_DISABLE_REGISTRY
 
+/*
+ * scan_and_update_registry:
+ * @default_registry: the #GstRegistry
+ * @registry_file: registry filename
+ * @write_changes: write registry if it has changed?
+ *
+ * Scans for registry changes and evntualy updates the registry cache. 
+ *
+ * Return: %TRUE if the registry could be updated
+ */
 static gboolean
 scan_and_update_registry (GstRegistry * default_registry,
     const gchar * registry_file, gboolean write_changes)
index ee9f45a..33600db 100644 (file)
@@ -662,10 +662,14 @@ gst_pad_set_active (GstPad * pad, gboolean active)
     }
   }
 
-  if (!active && !ret) {
+  if (!ret) {
     GST_OBJECT_LOCK (pad);
-    g_critical ("Failed to deactivate pad %s:%s, very bad",
-        GST_DEBUG_PAD_NAME (pad));
+    if (!active) {
+      g_critical ("Failed to deactivate pad %s:%s, very bad",
+          GST_DEBUG_PAD_NAME (pad));
+    } else {
+      GST_WARNING ("Failed to activate pad %s:%s", GST_DEBUG_PAD_NAME (pad));
+    }
     GST_OBJECT_UNLOCK (pad);
   }
 
index cc2aabd..6d501a9 100644 (file)
@@ -431,10 +431,11 @@ gst_base_transform_transform_caps (GstBaseTransform * trans,
 
     /* start with empty caps */
     ret = gst_caps_new_empty ();
+    GST_DEBUG_OBJECT (trans, "transform caps (direction = %d)", direction);
 
     if (gst_caps_is_any (caps)) {
       /* for any caps we still have to call the transform function */
-      GST_DEBUG_OBJECT (trans, "from ANY:");
+      GST_DEBUG_OBJECT (trans, "from: ANY");
       temp = klass->transform_caps (trans, direction, caps);
       GST_DEBUG_OBJECT (trans, "  to: %" GST_PTR_FORMAT, temp);
 
@@ -452,16 +453,23 @@ gst_base_transform_transform_caps (GstBaseTransform * trans,
         gst_caps_unref (nth);
         GST_DEBUG_OBJECT (trans, "  to[%d]: %" GST_PTR_FORMAT, i, temp);
 
+        /* FIXME: here we need to only append those structures, that are not yet
+         * in there */
         temp = gst_caps_make_writable (temp);
         gst_caps_append (ret, temp);
       }
+      /* for now simplify caps */
+      GST_DEBUG_OBJECT (trans, "merged: (%d)", gst_caps_get_size (ret));
+      gst_caps_do_simplify (ret);
+      GST_DEBUG_OBJECT (trans, "simplified: (%d)", gst_caps_get_size (ret));
     }
   } else {
     /* else use the identity transform */
     ret = gst_caps_ref (caps);
   }
 
-  GST_DEBUG_OBJECT (trans, "to:   %" GST_PTR_FORMAT, ret);
+  GST_DEBUG_OBJECT (trans, "to: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (ret),
+      ret);
 
   return ret;
 }