mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
libs: change gst_vaapi_surface_new_with_dma_buf_handle()
Instead of passing the data already in GstVideoInfo, let's just pass the GstVideoInfo structure. https://bugzilla.gnome.org/show_bug.cgi?id=765435
This commit is contained in:
parent
ad4c38b36f
commit
73d1228896
3 changed files with 9 additions and 14 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue