gst_video_info_align (&v_info, &v_align);
mem_allocator =
- GST_GL_BASE_MEMORY_ALLOCATOR (gst_allocator_find
- (GST_GL_MEMORY_PBO_ALLOCATOR_NAME));
+ GST_GL_BASE_MEMORY_ALLOCATOR (gst_gl_memory_allocator_get_default
+ (GST_GL_BASE_FILTER (overlay)->context));
params =
gst_gl_video_allocation_params_new (GST_GL_BASE_FILTER (overlay)->context,
NULL, &v_info, 0, &v_align, GST_GL_TEXTURE_TARGET_2D);
gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, width, height);
mem_allocator =
- GST_GL_BASE_MEMORY_ALLOCATOR (gst_allocator_find
- (GST_GL_MEMORY_PBO_ALLOCATOR_NAME));
+ GST_GL_BASE_MEMORY_ALLOCATOR (gst_gl_memory_allocator_get_default
+ (GST_GL_BASE_FILTER (overlay)->context));
params =
gst_gl_video_allocation_params_new (GST_GL_BASE_FILTER (overlay)->context,
NULL, &v_info, 0, NULL, GST_GL_TEXTURE_TARGET_2D);
if (allocator /* && GST_IS_GL_MEMORY_ALLOCATOR (allocator) FIXME EGLImage */ ) {
priv->allocator = gst_object_ref (allocator);
} else {
- priv->allocator = gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
+ priv->allocator =
+ GST_ALLOCATOR (gst_gl_memory_allocator_get_default (glpool->context));
g_assert (priv->allocator);
}
return TRUE;
}
+
+GstGLMemoryAllocator *
+gst_gl_memory_allocator_get_default (GstGLContext * context)
+{
+ GstGLMemoryAllocator *allocator = NULL;
+
+ g_return_val_if_fail (GST_IS_GL_CONTEXT (context), NULL);
+
+ if (USING_OPENGL (context) || USING_OPENGL3 (context)
+ || USING_GLES3 (context)) {
+ allocator = (GstGLMemoryAllocator *)
+ gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
+ } else {
+ allocator = (GstGLMemoryAllocator *)
+ gst_allocator_find (GST_GL_MEMORY_ALLOCATOR_NAME);
+ }
+
+ return allocator;
+}
GstBuffer * buffer,
GstGLVideoAllocationParams * params);
+
+GstGLMemoryAllocator * gst_gl_memory_allocator_get_default (GstGLContext *context);
+
G_END_DECLS
#endif /* _GST_GL_MEMORY_H_ */
GstGLBaseMemoryAllocator *mem_allocator;
GstAllocator *allocator;
- allocator = gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
+ allocator =
+ GST_ALLOCATOR (gst_gl_memory_allocator_get_default (overlay->context));
mem_allocator = GST_GL_BASE_MEMORY_ALLOCATOR (allocator);
gst_gl_composition_overlay_add_transformation (overlay, buf);
GstAllocationParams params;
gst_allocation_params_init (¶ms);
- allocator = gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
+ allocator =
+ GST_ALLOCATOR (gst_gl_memory_allocator_get_default (upload->
+ upload->context));
gst_query_add_allocation_param (query, allocator, ¶ms);
gst_object_unref (allocator);
}
guint max_planes = GST_VIDEO_INFO_N_PLANES (in_info);
GstGLMemoryAllocator *allocator;
- allocator =
- GST_GL_MEMORY_ALLOCATOR (gst_allocator_find
- (GST_GL_MEMORY_PBO_ALLOCATOR_NAME));
+ allocator = gst_gl_memory_allocator_get_default (upload->upload->context);
/* Support stereo views for separated multiview mode */
if (GST_VIDEO_INFO_MULTIVIEW_MODE (in_info) ==
guint n_mem = GST_VIDEO_INFO_N_PLANES (in_info);
allocator =
- GST_GL_BASE_MEMORY_ALLOCATOR (gst_allocator_find
- (GST_GL_MEMORY_PBO_ALLOCATOR_NAME));
+ GST_GL_BASE_MEMORY_ALLOCATOR (gst_gl_memory_allocator_get_default
+ (raw->upload->context));
/* FIXME Use a buffer pool to cache the generated textures */
/* FIXME: multiview support with separated left/right frames? */
*target = gst_buffer_new ();
- allocator = gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
+ allocator =
+ GST_ALLOCATOR (gst_gl_memory_allocator_get_default
+ (viewconvert->context));
mem_allocator = GST_GL_MEMORY_ALLOCATOR (allocator);
params = gst_gl_video_allocation_params_new (viewconvert->context, NULL,
&viewconvert->out_info, 0, NULL, viewconvert->to_texture_target);
gst_video_info_set_format (&temp_info, GST_VIDEO_FORMAT_RGBA, out_width,
out_height);
- allocator = gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
+ allocator =
+ GST_ALLOCATOR (gst_gl_memory_allocator_get_default (context));
base_mem_allocator = GST_GL_BASE_MEMORY_ALLOCATOR (allocator);
params = gst_gl_video_allocation_params_new (context, NULL, &temp_info,
0, NULL, viewconvert->to_texture_target);