From 5ffafdb34a093127251e774a8702abad0a3ccfe8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 22 Aug 2005 19:48:46 +0000 Subject: [PATCH] gst/base/gstbasetransform.c: Also call the transform function if we have ANY caps. 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 | 9 +++++++++ gst/base/gstbasetransform.c | 30 ++++++++++++++++++++---------- gst/gstpipeline.c | 2 +- libs/gst/base/gstbasetransform.c | 30 ++++++++++++++++++++---------- 4 files changed, 50 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 211187d9e8..e2e8c32804 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-08-22 Wim Taymans + + * 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 * gst/base/gstbasesrc.c: (gst_base_src_event_handler) diff --git a/gst/base/gstbasetransform.c b/gst/base/gstbasetransform.c index aa867715d4..b912d8b23e 100644 --- a/gst/base/gstbasetransform.c +++ b/gst/base/gstbasetransform.c @@ -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 */ diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index b95e2ba7e8..b9f207a7bc 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -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); } diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index aa867715d4..b912d8b23e 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -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 */