From 3f61394cb03f440774ebbd94f1a023f79a30058e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 19 May 2016 16:34:50 +0200 Subject: [PATCH] vaapivideomemory: use allocator custom alloc flag Instead of a dummy alloc() vmethod, the allocator instance set the flag GST_ALLOCATOR_FLAG_CUSTOM_ALLOC, which is used by the framework to avoid call gst_allocator_alloc() on the allocator. --- gst/vaapi/gstvaapivideomemory.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index c7f8ee1b42..6ece32cfed 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -556,16 +556,6 @@ gst_vaapi_video_memory_is_span (GstVaapiVideoMemory * mem1, G_DEFINE_TYPE (GstVaapiVideoAllocator, gst_vaapi_video_allocator, GST_TYPE_ALLOCATOR); -static GstMemory * -gst_vaapi_video_allocator_alloc (GstAllocator * allocator, gsize size, - GstAllocationParams * params) -{ - g_warning ("use gst_vaapi_video_memory_new() to allocate from " - "GstVaapiVideoMemory allocator"); - - return NULL; -} - static void gst_vaapi_video_allocator_free (GstAllocator * allocator, GstMemory * mem) { @@ -594,7 +584,6 @@ gst_vaapi_video_allocator_class_init (GstVaapiVideoAllocatorClass * klass) "vaapivideomemory", 0, "VA-API video memory allocator"); object_class->finalize = gst_vaapi_video_allocator_finalize; - allocator_class->alloc = gst_vaapi_video_allocator_alloc; allocator_class->free = gst_vaapi_video_allocator_free; } @@ -614,6 +603,8 @@ gst_vaapi_video_allocator_init (GstVaapiVideoAllocator * allocator) gst_vaapi_video_memory_share; base_allocator->mem_is_span = (GstMemoryIsSpanFunction) gst_vaapi_video_memory_is_span; + + GST_OBJECT_FLAG_SET (allocator, GST_ALLOCATOR_FLAG_CUSTOM_ALLOC); } static gboolean