Closed AdminXVII closed 6 months ago
Thanks for providing the PR.
In chunked mode the image will always start at byte 0 of the buffer.
Checking the NVMM path, we don't have the problem here, as we simply transfer base buffer pointer and the shape/type. So memory size will fit.
Yes, this only changes the non-NVMM path.
The offset is 0 and is correct, however the problem is with the buffer passed to GStreamer. The pipeline expects only the image data in the buffer (GetImageSize()
), but currently the plugin passes the framegrabber buffer size (GetBufferSize()
), which is GetImageSize() + the size of the chunks
(the latter being already passed as metas).
When chunk data is active, GetBufferSize() returns the size of the image itself plus the chunk data. However, the GstBuffer should only contain the image data since the metadata is already parsed and put into the buffer's "Meta"s.
Tested using the pipeline
pylonsrc user-set=UserSet1 | bayer2rgb | filesink location=<...>
where UserSet1 has chunk data enabled. Previous behaviour was for bayer2rgb to fail because the buffer size did not match the expected size (width * height), now it works as expected.