diff options
Diffstat (limited to 'recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch')
-rw-r--r-- | recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch new file mode 100644 index 0000000..c0751d8 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch @@ -0,0 +1,101 @@ +From 2f11f9247972d09ba461de10be2398e513764045 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <jared.hu@nxp.com> +Date: Fri, 17 Nov 2017 13:06:56 +0800 +Subject: [PATCH] [MMFMWK-7782] glupload: need upload each plane to single + eglimage when output format is not RGBA + +when glupload out format is not RGBA, need to use single eglimage +upload each plane. + +Upstream-Status: Inappropriate [i.MX specific] +--- + gst-libs/gst/gl/gstglupload.c | 62 ++++++++++++++++++++++--------------------- + 1 file changed, 32 insertions(+), 30 deletions(-) + +diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c +index 5c7eca0..ed5e54b 100644 +--- a/gst-libs/gst/gl/gstglupload.c ++++ b/gst-libs/gst/gl/gstglupload.c +@@ -657,6 +657,7 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps, + gsize mems_skip[GST_VIDEO_MAX_PLANES]; + GstMemory *mems[GST_VIDEO_MAX_PLANES]; + guint i; ++ GstVideoFormat out_fmt; + + n_mem = gst_buffer_n_memory (buffer); + meta = gst_buffer_get_video_meta (buffer); +@@ -773,40 +774,41 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps, + return FALSE; + } + +-#ifdef EGL_DMA_BUF_PLANE1_FD_EXT +- /* Now create one single EGLImage */ +- /* check if one is cached */ +- dmabuf->eglimage[0] = _get_cached_eglimage (mems[0], 0); +- if (dmabuf->eglimage[0]) +- return TRUE; +- +- dmabuf->eglimage[0] = +- gst_egl_image_from_dmabuf_singleplaner (dmabuf->upload->context, +- mems, in_info, n_planes, mems_skip); +- if (!dmabuf->eglimage[0]) +- return FALSE; +- +- _set_cached_eglimage (mems[0], dmabuf->eglimage[0], 0); +-#else +- /* Now create an EGLImage for each dmabufs */ +- for (i = 0; i < n_planes; i++) { ++ out_fmt = GST_VIDEO_INFO_FORMAT (&dmabuf->upload->priv->out_info); ++ if (out_fmt == GST_VIDEO_FORMAT_RGBA) { ++ /* Now create one single EGLImage */ + /* check if one is cached */ +- dmabuf->eglimage[i] = _get_cached_eglimage (mems[i], i); +- if (dmabuf->eglimage[i]) +- continue; +- +- /* otherwise create one and cache it */ +- dmabuf->eglimage[i] = +- gst_egl_image_from_dmabuf (dmabuf->upload->context, +- gst_dmabuf_memory_get_fd (mems[i]), in_info, i, +- mems[i]->offset + mems_skip[i]); +- +- if (!dmabuf->eglimage[i]) ++ dmabuf->eglimage[0] = _get_cached_eglimage (mems[0], 0); ++ if (dmabuf->eglimage[0]) ++ return TRUE; ++ ++ dmabuf->eglimage[0] = ++ gst_egl_image_from_dmabuf_singleplaner (dmabuf->upload->context, ++ mems, in_info, n_planes, mems_skip); ++ if (!dmabuf->eglimage[0]) + return FALSE; + +- _set_cached_eglimage (mems[i], dmabuf->eglimage[i], i); ++ _set_cached_eglimage (mems[0], dmabuf->eglimage[0], 0); ++ } else { ++ /* Now create an EGLImage for each dmabufs */ ++ for (i = 0; i < n_planes; i++) { ++ /* check if one is cached */ ++ dmabuf->eglimage[i] = _get_cached_eglimage (mems[i], i); ++ if (dmabuf->eglimage[i]) ++ continue; ++ ++ /* otherwise create one and cache it */ ++ dmabuf->eglimage[i] = ++ gst_egl_image_from_dmabuf (dmabuf->upload->context, ++ gst_dmabuf_memory_get_fd (mems[i]), in_info, i, ++ mems[i]->offset + mems_skip[i]); ++ ++ if (!dmabuf->eglimage[i]) ++ return FALSE; ++ ++ _set_cached_eglimage (mems[i], dmabuf->eglimage[i], i); ++ } + } +-#endif + + return TRUE; + } +-- +1.9.1 + |