After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345444 - Linking to an audioconvert (pad-added callback) multiple times in a pipeline takes a very long time
Linking to an audioconvert (pad-added callback) multiple times in a pipeline ...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal major
: 0.10.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-20 16:19 UTC by Jono Bacon
Modified: 2006-08-20 19:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Test script to demo the bug (4.41 KB, text/plain)
2006-06-20 16:19 UTC, Jono Bacon
Details
Glade file for use with test script (2.75 KB, text/plain)
2006-06-20 16:20 UTC, Jono Bacon
Details

Description Jono Bacon 2006-06-20 16:19:05 UTC
Please describe the problem:
In Jokosher we have been experience problems with a delay before playback. After some investigation, the delay is when the gnlcomposition is linked to an audioconvert when responding to pad-added.

Attached is a sample script that outlines the problem. The script prints out the link time.

Steps to reproduce:
1. Run the script.
2. 
3. 


Actual results:
It takes ages to play.

Expected results:
It plays straight away.

Does this happen every time?
Yes.

Other information:
Comment 1 Jono Bacon 2006-06-20 16:19:52 UTC
Created attachment 67719 [details]
Test script to demo the bug
Comment 2 Jono Bacon 2006-06-20 16:20:27 UTC
Created attachment 67720 [details]
Glade file for use with test script
Comment 3 Edward Hervey 2006-07-02 17:55:05 UTC
It's caps negotiation going crazy in basetransform.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2006-08-18 18:57:03 UTC
> opreport -l /opt/gnome/lib/libgstbase-0.10.so
CPU: AMD64 processors, speed 1800.38 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit mask of 0x00 (No unit mask) count 100000
samples  %        symbol name
6        26.0870  gst_base_transform_transform_caps
4        17.3913  gst_base_transform_getcaps
3        13.0435  .plt
2         8.6957  gst_base_transform_prepare_output_buffer
1         4.3478  __i686.get_pc_thunk.bx
1         4.3478  gst_base_sink_perform_qos
1         4.3478  gst_base_src_change_state
1         4.3478  gst_base_src_get_type
1         4.3478  gst_base_src_start
1         4.3478  gst_base_transform_handle_buffer
1         4.3478  gst_collect_pads_flush
1         4.3478  gst_collect_pads_set_flushing_unlocked

what the heck is .plt ?

gst_base_transform_transform_caps:
               :      /* we send caps with just one structure to the transform
               :       * function as this is easier for the element */
     3 13.0435 :      for (i = 0; i < gst_caps_get_size (caps); i++) {
               :        GstCaps *nth;
               :
     1  4.3478 :        nth = gst_caps_copy_nth (caps, i);
               :        GST_DEBUG_OBJECT (trans, "from[%d]: %" GST_PTR_FORMAT, i, nth);
     1  4.3478 :        temp = klass->transform_caps (trans, direction, nth);
               :        gst_caps_unref (nth);
     1  4.3478 :        GST_DEBUG_OBJECT (trans, "  to[%d]: %" GST_PTR_FORMAT, i, temp);
               :
               :        temp = gst_caps_make_writable (temp);
               :        gst_caps_append (ret, temp);
               :      }


gst_base_transform_getcaps:
               :    /* filtered against our padtemplate */
               :    templ = gst_pad_get_pad_template_caps (otherpad);
               :    GST_DEBUG_OBJECT (pad, "our template  %" GST_PTR_FORMAT, templ);
               :    temp = gst_caps_intersect (caps, templ);
               :    GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
     2  8.6957 :    gst_caps_unref (caps);
               :    /* then see what we can transform this to */
               :    caps = gst_base_transform_transform_caps (trans,
               :        GST_PAD_DIRECTION (otherpad), temp);
               :    GST_DEBUG_OBJECT (pad, "transformed  %" GST_PTR_FORMAT, caps);
               :    gst_caps_unref (temp);
     1  4.3478 :    if (caps == NULL)
               :      goto done;
               :
               :    /* and filter against the template again */
               :    templ = gst_pad_get_pad_template_caps (pad);
               :    GST_DEBUG_OBJECT (pad, "our template  %" GST_PTR_FORMAT, templ);
               :    temp = gst_caps_intersect (caps, templ);
               :    GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
               :    gst_caps_unref (caps);
               :    /* this is what we can do */
               :    caps = temp;
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2006-08-18 19:07:25 UTC
this seems to be one of the culprits:
               :int
               :gst_value_compare (const GValue * value1, const GValue * value2)
   170  0.3831 :{ /* gst_value_compare total:   5895 13.2854 */
               :  GstValueTable *table, *best = NULL;
               :  guint i;
               :
   482  1.0863 :  if (G_VALUE_TYPE (value1) != G_VALUE_TYPE (value2))
               :    return GST_VALUE_UNORDERED;
               :
  1802  4.0611 :  for (i = 0; i < gst_value_table->len; i++) {
   455  1.0254 :    table = &g_array_index (gst_value_table, GstValueTable, i);
  1189  2.6796 :    if (table->type == G_VALUE_TYPE (value1) && table->compare != NULL) {
               :      best = table;
               :      break;
               :    }
  1429  3.2205 :    if (g_type_is_a (G_VALUE_TYPE (value1), table->type)) {
               :      if (!best || g_type_is_a (table->type, best->type))
               :        best = table;
               :    }
               :  }
               :  if (best) {
   101  0.2276 :    return best->compare (value1, value2);
               :  }
               :
               :  g_critical ("unable to compare values of type %s\n",
               :      g_type_name (G_VALUE_TYPE (value1)));
               :  return GST_VALUE_UNORDERED;
   267  0.6017 :}
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2006-08-20 19:30:57 UTC
2006-08-20  Stefan Kost  <ensonic@users.sf.net>

	* libs/gst/base/gstbasetransform.c:
	(gst_base_transform_transform_caps):
          Simplify caps to get rid of duplicates, fixes #345444