glbuffer: remove unneeded gst_gl_buffer_alloc()

Replaced by gst_gl_base_memory_alloc()
This commit is contained in:
Matthew Waters 2015-12-16 18:38:19 +11:00 committed by Tim-Philipp Müller
parent 65afaf7e84
commit c870a9cdd5
2 changed files with 18 additions and 11 deletions

View file

@ -442,11 +442,3 @@ gst_is_gl_buffer (GstMemory * mem)
g_type_is_a (G_OBJECT_TYPE (mem->allocator),
GST_TYPE_GL_BUFFER_ALLOCATOR);
}
GstGLBuffer *
gst_gl_buffer_alloc (GstGLContext * context, guint gl_target, guint gl_usage,
GstAllocationParams * params, gsize maxsize)
{
return _gl_buffer_new (_gl_buffer_allocator, NULL, context, gl_target,
gl_usage, params, maxsize);
}

View file

@ -234,12 +234,27 @@ _gl_mem_create (GstGLMemoryPBO * gl_mem, GError ** error)
if (USING_OPENGL (context) || USING_OPENGL3 (context)
|| USING_GLES3 (context)) {
GstAllocationParams params = { 0, GST_MEMORY_CAST (gl_mem)->align, 0, 0 };
GstAllocationParams alloc_params =
{ 0, GST_MEMORY_CAST (gl_mem)->align, 0, 0 };
GstGLBaseMemoryAllocator *buf_allocator;
GstGLBufferAllocationParams *params;
buf_allocator =
GST_GL_BASE_MEMORY_ALLOCATOR (gst_allocator_find
(GST_GL_BUFFER_ALLOCATOR_NAME));
params =
gst_gl_buffer_allocation_params_new (context,
GST_MEMORY_CAST (gl_mem)->size, &alloc_params, GL_PIXEL_UNPACK_BUFFER,
GL_STREAM_DRAW);
/* FIXME: lazy init this for resource constrained platforms
* Will need to fix pbo detection based on the existence of the mem.id then */
gl_mem->pbo = gst_gl_buffer_alloc (context, GL_PIXEL_UNPACK_BUFFER,
GL_STREAM_DRAW, &params, GST_MEMORY_CAST (gl_mem)->size);
gl_mem->pbo = (GstGLBuffer *) gst_gl_base_memory_alloc (buf_allocator,
(GstGLAllocationParams *) params);
gst_gl_allocation_params_free ((GstGLAllocationParams *) params);
gst_object_unref (buf_allocator);
GST_CAT_LOG (GST_CAT_GL_MEMORY, "generated pbo %u", gl_mem->pbo->id);
}