gst/base/gstbasetransform.c: Also call the transform function if we have ANY caps.
authorWim Taymans <wim.taymans@gmail.com>
Mon, 22 Aug 2005 19:48:46 +0000 (19:48 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 22 Aug 2005 19:48:46 +0000 (19:48 +0000)
Original commit message from CVS:
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_handle_buffer):
Also call the transform function if we have ANY caps.

* gst/gstpipeline.c: (gst_pipeline_set_new_stream_time):
Fix debug info.

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

index 211187d..e2e8c32 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-08-22  Wim Taymans  <wim@fluendo.com>
+
+       * gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
+       (gst_base_transform_handle_buffer):
+       Also call the transform function if we have ANY caps.
+
+       * gst/gstpipeline.c: (gst_pipeline_set_new_stream_time):
+       Fix debug info.
+
 2005-08-22  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * gst/base/gstbasesrc.c: (gst_base_src_event_handler)
index aa86771..b912d8b 100644 (file)
@@ -222,18 +222,27 @@ gst_base_transform_transform_caps (GstBaseTransform * trans, GstPad * pad,
 
     ret = gst_caps_new_empty ();
 
-    /* we send caps with just one structure to the transform 
-     * function as this is easier for the element */
-    for (i = 0; i < gst_caps_get_size (caps); i++) {
-      GstCaps *nth;
-
-      nth = gst_caps_copy_nth (caps, i);
-      GST_DEBUG_OBJECT (trans, "from[%d]: %" GST_PTR_FORMAT, i, nth);
-      temp = klass->transform_caps (trans, pad, nth);
-      gst_caps_unref (nth);
-      GST_DEBUG_OBJECT (trans, "  to[%d]: %" GST_PTR_FORMAT, i, temp);
+    if (gst_caps_is_any (caps)) {
+      /* for any caps we still have to call the transform function */
+      GST_DEBUG_OBJECT (trans, "from ANY:");
+      temp = klass->transform_caps (trans, pad, caps);
+      GST_DEBUG_OBJECT (trans, "  to: %" GST_PTR_FORMAT, temp);
 
       gst_caps_append (ret, temp);
+    } else {
+      /* we send caps with just one structure to the transform 
+       * function as this is easier for the element */
+      for (i = 0; i < gst_caps_get_size (caps); i++) {
+        GstCaps *nth;
+
+        nth = gst_caps_copy_nth (caps, i);
+        GST_DEBUG_OBJECT (trans, "from[%d]: %" GST_PTR_FORMAT, i, nth);
+        temp = klass->transform_caps (trans, pad, nth);
+        gst_caps_unref (nth);
+        GST_DEBUG_OBJECT (trans, "  to[%d]: %" GST_PTR_FORMAT, i, temp);
+
+        gst_caps_append (ret, temp);
+      }
     }
     gst_caps_do_simplify (ret);
   } else {
@@ -620,6 +629,7 @@ gst_base_transform_handle_buffer (GstBaseTransform * trans, GstBuffer * inbuf,
 
   if (trans->in_place) {
     if (bclass->transform_ip) {
+      /* we do not call make writable here */
       gst_buffer_ref (inbuf);
 
       /* in place transform and subclass supports method */
index b95e2ba..b9f207a 100644 (file)
@@ -410,7 +410,7 @@ gst_pipeline_set_new_stream_time (GstPipeline * pipeline, GstClockTime time)
   GST_LOCK (pipeline);
   pipeline->stream_time = time;
   GST_DEBUG ("%s: set new stream_time to %" GST_TIME_FORMAT,
-      GST_ELEMENT_NAME (pipeline), time);
+      GST_ELEMENT_NAME (pipeline), GST_TIME_ARGS (time));
   GST_UNLOCK (pipeline);
 }
 
index aa86771..b912d8b 100644 (file)
@@ -222,18 +222,27 @@ gst_base_transform_transform_caps (GstBaseTransform * trans, GstPad * pad,
 
     ret = gst_caps_new_empty ();
 
-    /* we send caps with just one structure to the transform 
-     * function as this is easier for the element */
-    for (i = 0; i < gst_caps_get_size (caps); i++) {
-      GstCaps *nth;
-
-      nth = gst_caps_copy_nth (caps, i);
-      GST_DEBUG_OBJECT (trans, "from[%d]: %" GST_PTR_FORMAT, i, nth);
-      temp = klass->transform_caps (trans, pad, nth);
-      gst_caps_unref (nth);
-      GST_DEBUG_OBJECT (trans, "  to[%d]: %" GST_PTR_FORMAT, i, temp);
+    if (gst_caps_is_any (caps)) {
+      /* for any caps we still have to call the transform function */
+      GST_DEBUG_OBJECT (trans, "from ANY:");
+      temp = klass->transform_caps (trans, pad, caps);
+      GST_DEBUG_OBJECT (trans, "  to: %" GST_PTR_FORMAT, temp);
 
       gst_caps_append (ret, temp);
+    } else {
+      /* we send caps with just one structure to the transform 
+       * function as this is easier for the element */
+      for (i = 0; i < gst_caps_get_size (caps); i++) {
+        GstCaps *nth;
+
+        nth = gst_caps_copy_nth (caps, i);
+        GST_DEBUG_OBJECT (trans, "from[%d]: %" GST_PTR_FORMAT, i, nth);
+        temp = klass->transform_caps (trans, pad, nth);
+        gst_caps_unref (nth);
+        GST_DEBUG_OBJECT (trans, "  to[%d]: %" GST_PTR_FORMAT, i, temp);
+
+        gst_caps_append (ret, temp);
+      }
     }
     gst_caps_do_simplify (ret);
   } else {
@@ -620,6 +629,7 @@ gst_base_transform_handle_buffer (GstBaseTransform * trans, GstBuffer * inbuf,
 
   if (trans->in_place) {
     if (bclass->transform_ip) {
+      /* we do not call make writable here */
       gst_buffer_ref (inbuf);
 
       /* in place transform and subclass supports method */