glupload: dmabuf: use out_info to create allocation params for non-direct dmabuf uploads as well

Non-direct dmabuf uploads, just as direct dmabuf uploads, create EGL
images and thus GL textures of the same width as the imported image.
The input dmabuf line stride is not relevant to the resulting texture
in both cases.

This fixes the case where non-direct uploads of input dmabufs with line
stride larger than the width will for example cause glcolorconvert to
sample only the left part (width * bytes per pixel / stride) of the
image, causing a horizontally stretched and cropped output image.
This commit is contained in:
Philipp Zabel 2018-12-12 15:48:09 +01:00 committed by Philipp Zabel
parent cfae8bd6c1
commit 18c9babef9

View file

@ -609,7 +609,7 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
{
struct DmabufUpload *dmabuf = impl;
GstVideoInfo *in_info = &dmabuf->upload->priv->in_info;
GstVideoInfo *out_info = in_info;
GstVideoInfo *out_info = &dmabuf->out_info;
guint n_planes = GST_VIDEO_INFO_N_PLANES (in_info);
GstVideoMeta *meta;
guint n_mem;
@ -649,13 +649,10 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
}
}
if (dmabuf->direct) {
if (out_caps != dmabuf->out_caps) {
dmabuf->out_caps = out_caps;
if (!gst_video_info_from_caps (&dmabuf->out_info, out_caps))
return FALSE;
}
out_info = &dmabuf->out_info;
if (out_caps != dmabuf->out_caps) {
dmabuf->out_caps = out_caps;
if (!gst_video_info_from_caps (out_info, out_caps))
return FALSE;
}
if (dmabuf->params)