utils: Avoid memory merge in gst_util_dump_buffer()
authorJohan Sternerup <johast@axis.com>
Tue, 20 Aug 2019 15:18:31 +0000 (17:18 +0200)
committerJohan Sternerup <johast@axis.com>
Wed, 21 Aug 2019 06:37:50 +0000 (08:37 +0200)
commita4d5c95638b0783124e983d5ba063bb38c6f53a3
tree8ccefc4e67bfc86cc2040c8434f2070621e87f03
parent74797e962feb8ec9c3875c3766d107886d2a1b47
utils: Avoid memory merge in gst_util_dump_buffer()

For buffers with multiple memory chunks, gst_buffer_map() has the side
effect of merging the memory chunks into one contiguous
chunk. Since gst_util_dump_mem() used gst_buffer_map() the internals
of the buffer could actually change as a result of printing it.

For the case of a buffer containing several memory chunks,
gst_memory_map() is now used to obtain the memory address and each
memory chunk is dumped separately preceded by a header line. The
behaviour for a buffer containing a single memory chunk is left unchanged.
gst/gstutils.c