Commit 8bfbdc28 authored by Guillaume Desmottes's avatar Guillaume Desmottes 🐐

v4l2transform: use alignments from upstream when importing on sink

Try configuring the v4l2 output with the alignments from upstream when
importing its buffers. This allows us to support importing with
non-standard strides and/or heights if supported by the driver.
parent f5dc9811
Pipeline #52405 failed with stages
in 12 minutes and 38 seconds
......@@ -894,6 +894,22 @@ gst_v4l2_transform_prepare_output_buffer (GstBaseTransform * trans,
if (!gst_buffer_pool_is_active (pool)) {
GstStructure *config = gst_buffer_pool_get_config (pool);
gint min = MAX (GST_V4L2_MIN_BUFFERS, self->v4l2output->min_buffers);
if (self->v4l2output->mode == GST_V4L2_IO_USERPTR ||
self->v4l2output->mode == GST_V4L2_IO_DMABUF_IMPORT) {
if (!gst_v4l2_object_try_import (self->v4l2output, inbuf)) {
GST_ERROR_OBJECT (self, "cannot import buffers from upstream");
if (self->v4l2output->need_video_meta) {
/* We may need video meta if imported buffer is using non-standard
* stride/padding */
gst_buffer_pool_config_add_option (config,
gst_buffer_pool_config_set_params (config, self->incaps,
self->v4l2output->info.size, min, min);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment