mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
examples: factor dumping code
We can just re-use the new function instead of having two duplicates
This commit is contained in:
parent
1db9d6c9df
commit
74681cf00a
1 changed files with 2 additions and 16 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue