rpicamsrc: mark buffers as header and keyframe/delta-unit

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 16:35:43 +01:00
parent 9588108d6e
commit 987a332076

View file

@ -989,6 +989,13 @@ raspi_capture_fill_buffer(RASPIVID_STATE *state, GstBuffer **bufp,
/* FIXME: Can we avoid copies and give MMAL our own buffers to fill? */
gst_buffer_fill(buf, 0, buffer->data, buffer->length);
if ((buffer->flags & MMAL_BUFFER_HEADER_FLAG_CONFIG))
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);
else if ((buffer->flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME))
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
else
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
/* NAL_END is bogus and can't be trusted */
if ((buffer->flags & MMAL_BUFFER_HEADER_FLAG_FRAME_END))
ret = GST_FLOW_OK;