rpicamsrc: hypothetical fix for data pointer calculation

mmal buffer header docs say data is valid for length bytes
from offset. In practice offset always seems to be 0 so
far though.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
This commit is contained in:
Tim-Philipp Müller 2020-07-24 17:13:04 +01:00
parent 987a332076
commit 435c2acdc5

View file

@ -987,7 +987,7 @@ raspi_capture_fill_buffer(RASPIVID_STATE *state, GstBuffer **bufp,
if (config->useSTC)
GST_BUFFER_DTS(buf) = GST_BUFFER_PTS(buf) = gst_pts;
/* FIXME: Can we avoid copies and give MMAL our own buffers to fill? */
gst_buffer_fill(buf, 0, buffer->data, buffer->length);
gst_buffer_fill(buf, 0, buffer->data + buffer->offset, buffer->length);
if ((buffer->flags & MMAL_BUFFER_HEADER_FLAG_CONFIG))
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);