* - use labels like : element [ label="{element | <src> src | <sink> sink}"]
* - point to record-connectors : element1:src -> element2:sink
* - we use head/tail labels for pad-caps right now
- * - this does not work well, as dot seems to not llok at their sizen when
+ * - this does not work well, as dot seems to not look at their size when
* doing the layout
* - we could add the caps to the pad itself, then we should use one line per
* caps (simple caps = one line)
{
gchar *state_name = NULL;
const gchar *state_icons = "~0-=>";
- GstState state = 0, pending = 0;
+ GstState state = GST_STATE_VOID_PENDING, pending = GST_STATE_VOID_PENDING;
gst_element_get_state (element, &state, &pending, 0);
if (pending == GST_STATE_VOID_PENDING) {
}
}
if (details & GST_DEBUG_GRAPH_SHOW_STATES) {
- gchar pad_flags[6];
+ gchar pad_flags[5];
const gchar *activation_mode = "-><";
/* check if pad flags */
pad_flags[0] = GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKED) ? 'B' : 'b';
pad_flags[1] = GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_FLUSHING) ? 'F' : 'f';
pad_flags[2] = GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_GETCAPS) ? 'G' : 'g';
- pad_flags[3] = GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_IN_SETCAPS) ? 's' : 's';
- pad_flags[4] = GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKING) ? 'B' : 'b';
- pad_flags[5] = '\0';
+ pad_flags[3] = GST_OBJECT_FLAG_IS_SET (pad, GST_PAD_BLOCKING) ? 'B' : 'b';
+ pad_flags[4] = '\0';
fprintf (out,
"%s %s_%s [color=black, fillcolor=\"%s\", label=\"%s\\n[%c][%s]\", height=\"0.2\", style=\"%s\"];\n",
{
GString *str = (GString *) ptr;
gchar *value_str = gst_value_serialize (value);
+ gchar *esc_value_str;
/* some enums can become really long */
if (strlen (value_str) > 25) {
/* truncate */
value_str[25] = '\0';
- /* mirror any brackets */
+ /* mirror any brackets and quotes */
if (value_str[0] == '<')
value_str[pos--] = '>';
if (value_str[0] == '[')
value_str[pos--] = ')';
if (value_str[0] == '{')
value_str[pos--] = '}';
+ if (value_str[0] == '"')
+ value_str[pos--] = '"';
if (pos != 24)
value_str[pos--] = ' ';
/* elippsize */
value_str[pos--] = '.';
value_str[pos--] = '.';
}
+ esc_value_str = g_strescape (value_str, NULL);
+
g_string_append_printf (str, " %18s: %s\\l", g_quark_to_string (field),
- value_str);
+ esc_value_str);
g_free (value_str);
+ g_free (esc_value_str);
return TRUE;
}
if ((details & GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE) ||
(details & GST_DEBUG_GRAPH_SHOW_CAPS_DETAILS)
) {
- caps = gst_pad_get_negotiated_caps (pad);
+ caps = gst_pad_get_current_caps (pad);
if (!caps)
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
- peer_caps = gst_pad_get_negotiated_caps (peer_pad);
+ peer_caps = gst_pad_get_current_caps (peer_pad);
if (!peer_caps)
peer_caps = gst_caps_copy (gst_pad_get_pad_template_caps (peer_pad));
}
}
+static void
+debug_dump_element_pads (GstIterator * pad_iter, GstPad * pad,
+ GstElement * element, GstDebugGraphDetails details, FILE * out,
+ const gint indent, guint * src_pads, guint * sink_pads)
+{
+ GValue item = { 0, };
+ gboolean pads_done;
+ GstPadDirection dir;
+
+ pads_done = FALSE;
+ while (!pads_done) {
+ switch (gst_iterator_next (pad_iter, &item)) {
+ case GST_ITERATOR_OK:
+ pad = g_value_get_object (&item);
+ debug_dump_element_pad (pad, element, details, out, indent);
+ dir = gst_pad_get_direction (pad);
+ if (dir == GST_PAD_SRC)
+ (*src_pads)++;
+ else if (dir == GST_PAD_SINK)
+ (*sink_pads)++;
+ g_value_reset (&item);
+ break;
+ case GST_ITERATOR_RESYNC:
+ gst_iterator_resync (pad_iter);
+ break;
+ case GST_ITERATOR_ERROR:
+ case GST_ITERATOR_DONE:
+ pads_done = TRUE;
+ break;
+ }
+ }
+}
+
/*
* debug_dump_element:
* @bin: the bin that should be analyzed
{
GstIterator *element_iter, *pad_iter;
gboolean elements_done, pads_done;
+ GValue item = { 0, };
+ GValue item2 = { 0, };
GstElement *element;
- GstPad *pad;
- GstPadDirection dir;
+ GstPad *pad = NULL;
guint src_pads, sink_pads;
gchar *element_name;
gchar *state_name = NULL;
element_iter = gst_bin_iterate_elements (bin);
elements_done = FALSE;
while (!elements_done) {
- switch (gst_iterator_next (element_iter, (gpointer) & element)) {
+ switch (gst_iterator_next (element_iter, &item)) {
case GST_ITERATOR_OK:
+ element = g_value_get_object (&item);
element_name = debug_dump_make_object_name (GST_OBJECT (element));
if (details & GST_DEBUG_GRAPH_SHOW_STATES) {
g_free (element_name);
src_pads = sink_pads = 0;
- if ((pad_iter = gst_element_iterate_pads (element))) {
- pads_done = FALSE;
- while (!pads_done) {
- switch (gst_iterator_next (pad_iter, (gpointer) & pad)) {
- case GST_ITERATOR_OK:
- debug_dump_element_pad (pad, element, details, out, indent);
- dir = gst_pad_get_direction (pad);
- if (dir == GST_PAD_SRC)
- src_pads++;
- else if (dir == GST_PAD_SINK)
- sink_pads++;
- gst_object_unref (pad);
- break;
- case GST_ITERATOR_RESYNC:
- gst_iterator_resync (pad_iter);
- break;
- case GST_ITERATOR_ERROR:
- case GST_ITERATOR_DONE:
- pads_done = TRUE;
- break;
- }
- }
+ if ((pad_iter = gst_element_iterate_sink_pads (element))) {
+ debug_dump_element_pads (pad_iter, pad, element, details, out, indent,
+ &src_pads, &sink_pads);
+ gst_iterator_free (pad_iter);
+ }
+ if ((pad_iter = gst_element_iterate_src_pads (element))) {
+ debug_dump_element_pads (pad_iter, pad, element, details, out, indent,
+ &src_pads, &sink_pads);
gst_iterator_free (pad_iter);
}
if (GST_IS_BIN (element)) {
if ((pad_iter = gst_element_iterate_pads (element))) {
pads_done = FALSE;
while (!pads_done) {
- switch (gst_iterator_next (pad_iter, (gpointer) & pad)) {
+ switch (gst_iterator_next (pad_iter, &item2)) {
case GST_ITERATOR_OK:
+ pad = g_value_get_object (&item2);
if (gst_pad_is_linked (pad)
&& gst_pad_get_direction (pad) == GST_PAD_SRC) {
debug_dump_element_pad_link (pad, element, details, out,
indent);
}
- gst_object_unref (pad);
+ g_value_reset (&item2);
break;
case GST_ITERATOR_RESYNC:
gst_iterator_resync (pad_iter);
break;
}
}
+ g_value_unset (&item2);
gst_iterator_free (pad_iter);
}
- gst_object_unref (element);
+ g_value_reset (&item);
break;
case GST_ITERATOR_RESYNC:
gst_iterator_resync (element_iter);
break;
}
}
+ g_value_unset (&item);
gst_iterator_free (element_iter);
}