diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c index 1e137938d6..7b61daf831 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c @@ -644,45 +644,9 @@ get_egl_stride (const GstVideoInfo * info, gint plane) GstEGLImage * gst_egl_image_from_dmabuf (GstGLContext * context, gint dmabuf, const GstVideoInfo * in_info, gint plane, gsize offset) -{ - GstVideoInfoDmaDrm in_info_dma; - - if (!gst_video_info_dma_drm_from_video_info (&in_info_dma, in_info, - DRM_FORMAT_MOD_LINEAR)) - return FALSE; - - return gst_egl_image_from_dmabuf_with_dma_drm (context, dmabuf, - &in_info_dma, plane, offset); -} - -/** - * gst_egl_image_from_dmabuf_with_dma_drm: - * @context: a #GstGLContext (must be an EGL context) - * @dmabuf: the DMA-Buf file descriptor - * @in_info_dma: the #GstVideoInfoDmaDrm in @dmabuf - * @plane: the plane in @in_info to create and #GstEGLImage for - * @offset: the byte-offset in the data - * - * Creates an EGL image that imports the dmabuf FD. The dmabuf data - * is passed as RGBA data. Shaders later take this "RGBA" data and - * convert it from its true format (described by in_info) to actual - * RGBA output. For example, with I420, three EGL images are created, - * one for each @plane, each EGL image with a single-channel R format. - * With NV12, two EGL images are created, one with R format, one - * with RG format etc. User can specify the modifier in @in_info_dma - * for non-linear dmabuf. - * - * Returns: (nullable): a #GstEGLImage wrapping @dmabuf or %NULL on failure - * - * Since: 1.24 - */ -GstEGLImage * -gst_egl_image_from_dmabuf_with_dma_drm (GstGLContext * context, gint dmabuf, - const GstVideoInfoDmaDrm * in_info_dma, gint plane, gsize offset) { gint comp[GST_VIDEO_MAX_COMPONENTS]; GstGLFormat format = 0; - const GstVideoInfo *in_info = &in_info_dma->vinfo; guintptr attribs[17]; EGLImageKHR img; gint atti = 0; @@ -713,11 +677,11 @@ gst_egl_image_from_dmabuf_with_dma_drm (GstGLContext * context, gint dmabuf, attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; attribs[atti++] = get_egl_stride (in_info, plane); - if (with_modifiers && in_info_dma->drm_modifier != DRM_FORMAT_MOD_INVALID) { + if (with_modifiers) { attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT; - attribs[atti++] = in_info_dma->drm_modifier & 0xffffffff; + attribs[atti++] = DRM_FORMAT_MOD_LINEAR & 0xffffffff; attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT; - attribs[atti++] = (in_info_dma->drm_modifier >> 32) & 0xffffffff; + attribs[atti++] = (DRM_FORMAT_MOD_LINEAR >> 32) & 0xffffffff; } attribs[atti] = EGL_NONE; diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.h b/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.h index 5b8cb5f54c..5d333b8eb6 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.h @@ -88,12 +88,7 @@ GstEGLImage * gst_egl_image_from_dmabuf (GstGLContext * const GstVideoInfo * in_info, gint plane, gsize offset); -GST_GL_API -GstEGLImage * gst_egl_image_from_dmabuf_with_dma_drm (GstGLContext * context, - gint dmabuf, - const GstVideoInfoDmaDrm * in_info_dma, - gint plane, - gsize offset); + GST_GL_API GstEGLImage * gst_egl_image_from_dmabuf_direct (GstGLContext * context, gint *fd, diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c index 4e491e993e..c8f4eecda6 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c @@ -1390,11 +1390,6 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps, if (_filter_caps_with_features (in_caps, filter_features, NULL)) { in_info_drm->drm_fourcc = gst_video_dma_drm_fourcc_from_format (GST_VIDEO_INFO_FORMAT (in_info)); - if (in_info_drm->drm_fourcc == DRM_FORMAT_INVALID) { - gst_caps_features_free (filter_features); - return FALSE; - } - in_info_drm->drm_modifier = DRM_FORMAT_MOD_LINEAR; } else if (!gst_caps_features_contains (gst_caps_get_features (in_caps, 0), GST_CAPS_FEATURE_MEMORY_DMABUF)) { @@ -1538,8 +1533,8 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps, dmabuf->eglimage[i] = gst_egl_image_from_dmabuf_direct_target_with_dma_drm (dmabuf->upload->context, fd, offset, in_info_drm, dmabuf->target); } else { - dmabuf->eglimage[i] = gst_egl_image_from_dmabuf_with_dma_drm - (dmabuf->upload->context, fd[i], in_info_drm, i, offset[i]); + dmabuf->eglimage[i] = gst_egl_image_from_dmabuf + (dmabuf->upload->context, fd[i], in_info, i, offset[i]); } if (!dmabuf->eglimage[i]) {