omxvideodec: fix dmabuf import

When importing dmabuf, UseBuffer() has to be called with the fd as
pBuffer rather than the mapped address of the buffer.
This commit is contained in:
Guillaume Desmottes 2019-08-21 12:25:40 +05:30
parent 7cd929bc87
commit 55ea6d017f

View file

@ -1051,10 +1051,20 @@ gst_omx_video_dec_allocate_output_buffers (GstOMXVideoDec * self)
} else {
/* if downstream pool is 1 n_mem then always try to use buffers
* and retry without using them if it fails */
GstMemory *mem;
buffers = g_list_append (buffers, buffer);
frames = g_list_append (frames, frame);
images =
g_list_append (images, GST_VIDEO_FRAME_PLANE_DATA (frame, 0));
mem = gst_buffer_peek_memory (buffer, 0);
if (self->dmabuf && gst_is_dmabuf_memory (mem))
/* Use the imported fd rather than mapped address in dmabuf mode */
images =
g_list_append (images,
GUINT_TO_POINTER (gst_dmabuf_memory_get_fd (mem)));
else
images =
g_list_append (images, GST_VIDEO_FRAME_PLANE_DATA (frame, 0));
}
}