examples: factor dumping code

We can just re-use the new function instead of having two duplicates
This commit is contained in:
Edward Hervey 2014-05-29 11:55:51 +02:00
parent 1db9d6c9df
commit 74681cf00a

View file

@ -61,22 +61,6 @@ gst_info_dump_mem_line (gchar * linebuf, gsize linebuf_size,
(guint) mem_offset, hexstr, ascstr);
}
static void
dump_memory_content (GstMpegTsDescriptor * desc, guint spacing)
{
gsize off = 0;
while (off < desc->length) {
gchar buf[128];
/* gst_info_dump_mem_line will process 16 bytes at most */
gst_info_dump_mem_line (buf, sizeof (buf), desc->data, off + 2,
desc->length - off);
g_printf ("%*s %s\n", spacing, "", buf);
off += 16;
}
}
static void
dump_memory_bytes (guint8 * data, guint len, guint spacing)
{
@ -92,6 +76,8 @@ dump_memory_bytes (guint8 * data, guint len, guint spacing)
}
}
#define dump_memory_content(desc, spacing) dump_memory_bytes((desc)->data + 2, (desc)->length, spacing)
static const gchar *
descriptor_name (gint val)
{