va: allocator: remove unused public functions

Deleted the public functions:

gst_va_dmabuf_allocator_wait_for_memory()
gst_va_allocator_wait_for_memory()

And all the support for wait, cond in allocator's pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2013>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-02-12 15:40:33 +01:00
parent 1ee9b202a6
commit 0ec17904e1
2 changed files with 0 additions and 65 deletions

View file

@ -368,9 +368,6 @@ struct _GstVaMemoryPool
gint surface_count;
GMutex lock;
GCond cond;
gboolean flushing;
};
#define GST_VA_MEMORY_POOL_CAST(obj) ((GstVaMemoryPool *)obj)
@ -383,9 +380,7 @@ gst_va_memory_pool_init (GstVaMemoryPool * self)
self->queue = gst_atomic_queue_new (2);
g_mutex_init (&self->lock);
g_cond_init (&self->cond);
self->flushing = FALSE;
self->surface_count = 0;
}
@ -393,7 +388,6 @@ static void
gst_va_memory_pool_finalize (GstVaMemoryPool * self)
{
g_mutex_clear (&self->lock);
g_cond_clear (&self->cond);
gst_atomic_queue_unref (self->queue);
}
@ -433,25 +427,14 @@ static void
gst_va_memory_pool_flush (GstVaMemoryPool * self, GstVaDisplay * display)
{
GST_VA_MEMORY_POOL_LOCK (self);
self->flushing = TRUE;
gst_va_memory_pool_flush_unlocked (self, display);
self->flushing = FALSE;
g_cond_broadcast (&self->cond);
GST_VA_MEMORY_POOL_UNLOCK (self);
}
static inline void
gst_va_memory_pool_push (GstVaMemoryPool * self, GstMemory * mem)
{
GST_VA_MEMORY_POOL_LOCK (self);
gst_atomic_queue_push (self->queue, gst_memory_ref (mem));
g_cond_signal (&self->cond);
GST_VA_MEMORY_POOL_UNLOCK (self);
}
static inline GstMemory *
@ -466,15 +449,6 @@ gst_va_memory_pool_peek (GstVaMemoryPool * self)
return gst_atomic_queue_peek (self->queue);
}
static gboolean
gst_va_memory_pool_wait_unlocked (GstVaMemoryPool * self)
{
while (gst_atomic_queue_length (self->queue) == 0 && !self->flushing)
g_cond_wait (&self->cond, &self->lock);
return !self->flushing;
}
static inline guint
gst_va_memory_pool_surface_count (GstVaMemoryPool * self)
{
@ -790,24 +764,6 @@ gst_va_dmabuf_allocator_prepare_buffer (GstAllocator * allocator,
return (surface != VA_INVALID_ID);
}
gboolean
gst_va_dmabuf_allocator_wait_for_memory (GstAllocator * allocator,
GstBuffer * buffer)
{
GstVaDmabufAllocator *self = GST_VA_DMABUF_ALLOCATOR (allocator);
VASurfaceID surface;
GST_VA_MEMORY_POOL_LOCK (&self->pool);
if (!gst_va_memory_pool_wait_unlocked (&self->pool)) {
GST_VA_MEMORY_POOL_LOCK (&self->pool);
return FALSE;
}
surface = gst_va_dmabuf_allocator_prepare_buffer_unlocked (self, buffer);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
return (surface != VA_INVALID_ID);
}
void
gst_va_dmabuf_allocator_flush (GstAllocator * allocator)
{
@ -1433,23 +1389,6 @@ gst_va_allocator_prepare_buffer (GstAllocator * allocator, GstBuffer * buffer)
return (surface != VA_INVALID_ID);
}
gboolean
gst_va_allocator_wait_for_memory (GstAllocator * allocator, GstBuffer * buffer)
{
GstVaAllocator *self = GST_VA_ALLOCATOR (allocator);
VASurfaceID surface;
GST_VA_MEMORY_POOL_LOCK (&self->pool);
if (!gst_va_memory_pool_wait_unlocked (&self->pool)) {
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
return FALSE;
}
surface = gst_va_allocator_prepare_buffer_unlocked (self, buffer);
GST_VA_MEMORY_POOL_UNLOCK (&self->pool);
return (surface != VA_INVALID_ID);
}
void
gst_va_allocator_flush (GstAllocator * allocator)
{

View file

@ -36,8 +36,6 @@ gboolean gst_va_dmabuf_allocator_setup_buffer (GstAllocator * alloc
GstBuffer * buffer);
gboolean gst_va_dmabuf_allocator_prepare_buffer (GstAllocator * allocator,
GstBuffer * buffer);
gboolean gst_va_dmabuf_allocator_wait_for_memory (GstAllocator * allocator,
GstBuffer * buffer);
void gst_va_dmabuf_allocator_flush (GstAllocator * allocator);
gboolean gst_va_dmabuf_allocator_set_format (GstAllocator * allocator,
GstVideoInfo * info,
@ -68,8 +66,6 @@ gboolean gst_va_allocator_setup_buffer (GstAllocator * alloca
GstBuffer * buffer);
gboolean gst_va_allocator_prepare_buffer (GstAllocator * allocator,
GstBuffer * buffer);
gboolean gst_va_allocator_wait_for_memory (GstAllocator * allocator,
GstBuffer * buffer);
void gst_va_allocator_flush (GstAllocator * allocator);
gboolean gst_va_allocator_set_format (GstAllocator * allocator,
GstVideoInfo * info,