diff --git a/gst-libs/gst/vaapi/gstvaapisurface_drm.c b/gst-libs/gst/vaapi/gstvaapisurface_drm.c index 121b708772..b6357d306b 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface_drm.c +++ b/gst-libs/gst/vaapi/gstvaapisurface_drm.c @@ -139,21 +139,19 @@ fill_video_info (GstVideoInfo * vip, GstVideoFormat format, guint width, * if creation from DRM PRIME fd failed, or is not supported */ GstVaapiSurface * -gst_vaapi_surface_new_with_dma_buf_handle (GstVaapiDisplay * display, - gint fd, guint size, GstVideoFormat format, guint width, guint height, - gsize offset[GST_VIDEO_MAX_PLANES], gint stride[GST_VIDEO_MAX_PLANES]) +gst_vaapi_surface_new_with_dma_buf_handle (GstVaapiDisplay * display, gint fd, + GstVideoInfo * vi) { GstVaapiBufferProxy *proxy; GstVaapiSurface *surface; - GstVideoInfo vi; proxy = gst_vaapi_buffer_proxy_new ((gintptr) fd, - GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF, size, NULL, NULL); + GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF, GST_VIDEO_INFO_SIZE (vi), NULL, + NULL); if (!proxy) return NULL; - fill_video_info (&vi, format, width, height, offset, stride); - surface = gst_vaapi_surface_new_from_buffer_proxy (display, proxy, &vi); + surface = gst_vaapi_surface_new_from_buffer_proxy (display, proxy, vi); gst_vaapi_buffer_proxy_unref (proxy); return surface; } diff --git a/gst-libs/gst/vaapi/gstvaapisurface_drm.h b/gst-libs/gst/vaapi/gstvaapisurface_drm.h index 5073f55641..1dd637d8e5 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface_drm.h +++ b/gst-libs/gst/vaapi/gstvaapisurface_drm.h @@ -35,9 +35,8 @@ GstVaapiBufferProxy * gst_vaapi_surface_get_gem_buf_handle (GstVaapiSurface * surface); GstVaapiSurface * -gst_vaapi_surface_new_with_dma_buf_handle (GstVaapiDisplay * display, - gint fd, guint size, GstVideoFormat format, guint width, guint height, - gsize offset[GST_VIDEO_MAX_PLANES], gint stride[GST_VIDEO_MAX_PLANES]); +gst_vaapi_surface_new_with_dma_buf_handle (GstVaapiDisplay * display, gint fd, + GstVideoInfo * vi); GstVaapiSurface * gst_vaapi_surface_new_with_gem_buf_handle (GstVaapiDisplay * display, diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 7b91355bd5..b623abd293 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -205,10 +205,8 @@ plugin_bind_dma_to_vaapi_buffer (GstVaapiPluginBase * plugin, meta = gst_buffer_get_vaapi_video_meta (outbuf); g_return_val_if_fail (meta != NULL, FALSE); - surface = gst_vaapi_surface_new_with_dma_buf_handle (plugin->display, fd, - GST_VIDEO_INFO_SIZE (vip), GST_VIDEO_INFO_FORMAT (vip), - GST_VIDEO_INFO_WIDTH (vip), GST_VIDEO_INFO_HEIGHT (vip), - vip->offset, vip->stride); + surface = + gst_vaapi_surface_new_with_dma_buf_handle (plugin->display, fd, vip); if (!surface) goto error_create_surface;