jpegdec: Internal parser map/unmap the same buffer multiple time
@ndufresne
Submitted by Nicolas Dufresne Link to original bug (#767350)
Description
The parse in jpegdec rely on gst_adapter_masked_scan_uint32() to find few 2 bytes sequences in the stream. The problem is that the adapter variant of this function will, for every call, map/unmap the GstBuffer. If you combined with a non-sysmem memory (like dmabuf) this will cause a huge performance hit. With 720p@30 video, I get a full i7 core being used with (if I force parsing obviously):
v4l2src ! jpegdec ! fakesink
I didn't look how to fix it really, one could map the buffer in the adapter before using that function. This would bring the performance to what the byte_scanner version would give. Though, there is probably something even smarter we could do.
Version: 1.8.2