diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index d951aa4e65..f2929db818 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -509,7 +509,7 @@ ensure_sinkpad_allocator (GstVaapiPluginBase * plugin, GstCaps * caps, if (has_dmabuf_capable_peer (plugin, plugin->sinkpad)) { plugin->sinkpad_allocator = gst_vaapi_dmabuf_allocator_new (plugin->display, &vinfo, - GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE); + GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE, GST_PAD_SINK); goto bail; } diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 9945b4b547..ed1fdf757e 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -1048,11 +1048,13 @@ gst_vaapi_dmabuf_allocator_init (GstVaapiDmaBufAllocator * allocator) GstAllocator *const base_allocator = GST_ALLOCATOR_CAST (allocator); base_allocator->mem_type = GST_VAAPI_DMABUF_ALLOCATOR_NAME; + allocator->direction = GST_PAD_SINK; } GstAllocator * gst_vaapi_dmabuf_allocator_new (GstVaapiDisplay * display, - const GstVideoInfo * alloc_info, guint surface_alloc_flags) + const GstVideoInfo * alloc_info, guint surface_alloc_flags, + GstPadDirection direction) { GstVaapiDmaBufAllocator *allocator = NULL; GstVaapiSurface *surface = NULL; @@ -1081,6 +1083,8 @@ gst_vaapi_dmabuf_allocator_new (GstVaapiDisplay * display, gst_allocator_set_vaapi_video_info (base_allocator, &surface_info, surface_alloc_flags); + allocator->direction = direction; + return base_allocator; /* ERRORS */ diff --git a/gst/vaapi/gstvaapivideomemory.h b/gst/vaapi/gstvaapivideomemory.h index c95ff3221a..342ca65802 100644 --- a/gst/vaapi/gstvaapivideomemory.h +++ b/gst/vaapi/gstvaapivideomemory.h @@ -243,6 +243,9 @@ gst_vaapi_dmabuf_memory_new (GstAllocator * allocator, struct _GstVaapiDmaBufAllocator { GstDmaBufAllocator parent_instance; + + /*< private >*/ + GstPadDirection direction; }; /** @@ -262,7 +265,8 @@ gst_vaapi_dmabuf_allocator_get_type (void) G_GNUC_CONST; G_GNUC_INTERNAL GstAllocator * gst_vaapi_dmabuf_allocator_new (GstVaapiDisplay * display, - const GstVideoInfo * alloc_info, guint surface_alloc_flags); + const GstVideoInfo * alloc_info, guint surface_alloc_flags, + GstPadDirection direction); G_GNUC_INTERNAL const GstVideoInfo *