diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-08-21 12:25:40 +0530 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-09-02 09:47:54 +0530 |
commit | 55ea6d017f7f300327dbc6cfcdbcba6667ed0177 (patch) | |
tree | 2fac9738cef0477fb5ce3cc8627bead86ffea3f9 | |
parent | 7cd929bc87b478b18f546c0b37b7315ea5e51ff4 (diff) | |
download | gst-omx-55ea6d017f7f300327dbc6cfcdbcba6667ed0177.tar.gz |
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.
-rw-r--r-- | omx/gstomxvideodec.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 3d30907..5f7370f 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -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)); } } |