vaapivideomemory: add direction to dmabuf allocator
Add GstPadDirection param to gst_vaapi_dmabuf_allocator_new(), thus we later could do different thing when the allocated memory is for upstream or dowstream, as required by VA-API. https://bugzilla.gnome.org/show_bug.cgi?id=755072
This commit is contained in:
parent
a5650e8dc3
commit
fbed3c3366
@ -509,7 +509,7 @@ ensure_sinkpad_allocator (GstVaapiPluginBase * plugin, GstCaps * caps,
|
|||||||
if (has_dmabuf_capable_peer (plugin, plugin->sinkpad)) {
|
if (has_dmabuf_capable_peer (plugin, plugin->sinkpad)) {
|
||||||
plugin->sinkpad_allocator =
|
plugin->sinkpad_allocator =
|
||||||
gst_vaapi_dmabuf_allocator_new (plugin->display, &vinfo,
|
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;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1048,11 +1048,13 @@ gst_vaapi_dmabuf_allocator_init (GstVaapiDmaBufAllocator * allocator)
|
|||||||
GstAllocator *const base_allocator = GST_ALLOCATOR_CAST (allocator);
|
GstAllocator *const base_allocator = GST_ALLOCATOR_CAST (allocator);
|
||||||
|
|
||||||
base_allocator->mem_type = GST_VAAPI_DMABUF_ALLOCATOR_NAME;
|
base_allocator->mem_type = GST_VAAPI_DMABUF_ALLOCATOR_NAME;
|
||||||
|
allocator->direction = GST_PAD_SINK;
|
||||||
}
|
}
|
||||||
|
|
||||||
GstAllocator *
|
GstAllocator *
|
||||||
gst_vaapi_dmabuf_allocator_new (GstVaapiDisplay * display,
|
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;
|
GstVaapiDmaBufAllocator *allocator = NULL;
|
||||||
GstVaapiSurface *surface = 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,
|
gst_allocator_set_vaapi_video_info (base_allocator, &surface_info,
|
||||||
surface_alloc_flags);
|
surface_alloc_flags);
|
||||||
|
|
||||||
|
allocator->direction = direction;
|
||||||
|
|
||||||
return base_allocator;
|
return base_allocator;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
@ -243,6 +243,9 @@ gst_vaapi_dmabuf_memory_new (GstAllocator * allocator,
|
|||||||
struct _GstVaapiDmaBufAllocator
|
struct _GstVaapiDmaBufAllocator
|
||||||
{
|
{
|
||||||
GstDmaBufAllocator parent_instance;
|
GstDmaBufAllocator parent_instance;
|
||||||
|
|
||||||
|
/*< private >*/
|
||||||
|
GstPadDirection direction;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -262,7 +265,8 @@ gst_vaapi_dmabuf_allocator_get_type (void) G_GNUC_CONST;
|
|||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
GstAllocator *
|
GstAllocator *
|
||||||
gst_vaapi_dmabuf_allocator_new (GstVaapiDisplay * display,
|
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
|
G_GNUC_INTERNAL
|
||||||
const GstVideoInfo *
|
const GstVideoInfo *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user