glbufferpool: add the GstVideoGLTextureUploadMeta buffer pool option

This commit is contained in:
Matthew Waters 2014-10-18 10:03:43 +02:00 committed by Tim-Philipp Müller
parent 3cccd77d5d
commit 0806de5c75
4 changed files with 17 additions and 2 deletions

View file

@ -822,6 +822,8 @@ gst_gl_mixer_decide_allocation (GstGLMixer * mix, GstQuery * query)
gst_buffer_pool_config_set_params (config, caps, size, min, max); gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META); gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
gst_buffer_pool_set_config (pool, config); gst_buffer_pool_set_config (pool, config);

View file

@ -857,6 +857,8 @@ gst_gl_test_src_decide_allocation (GstBaseSrc * basesrc, GstQuery * query)
config = gst_buffer_pool_get_config (pool); config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, min, max); gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META); gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
gst_buffer_pool_set_config (pool, config); gst_buffer_pool_set_config (pool, config);
if (update_pool) if (update_pool)

View file

@ -51,6 +51,7 @@ struct _GstGLBufferPoolPrivate
gint im_format; gint im_format;
GstVideoInfo info; GstVideoInfo info;
gboolean add_videometa; gboolean add_videometa;
gboolean add_uploadmeta;
gboolean want_eglimage; gboolean want_eglimage;
GstBuffer *last_buffer; GstBuffer *last_buffer;
}; };
@ -71,7 +72,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLBufferPool, gst_gl_buffer_pool,
static const gchar ** static const gchar **
gst_gl_buffer_pool_get_options (GstBufferPool * pool) gst_gl_buffer_pool_get_options (GstBufferPool * pool)
{ {
static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META, NULL static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META,
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META, NULL
}; };
return options; return options;
@ -128,6 +130,8 @@ gst_gl_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
priv->add_videometa = gst_buffer_pool_config_has_option (config, priv->add_videometa = gst_buffer_pool_config_has_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_META); GST_BUFFER_POOL_OPTION_VIDEO_META);
priv->add_uploadmeta = gst_buffer_pool_config_has_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
#if GST_GL_HAVE_PLATFORM_EGL #if GST_GL_HAVE_PLATFORM_EGL
g_assert (priv->allocator != NULL); g_assert (priv->allocator != NULL);
@ -217,6 +221,7 @@ gst_gl_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
if (!gst_gl_memory_setup_buffer (glpool->context, info, buf)) if (!gst_gl_memory_setup_buffer (glpool->context, info, buf))
goto mem_create_failed; goto mem_create_failed;
if (priv->add_uploadmeta)
gst_gl_upload_meta_add_to_buffer (glpool->upload, buf); gst_gl_upload_meta_add_to_buffer (glpool->upload, buf);
*buffer = buf; *buffer = buf;

View file

@ -24,6 +24,8 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/video/gstvideometa.h>
#include "gstglfilter.h" #include "gstglfilter.h"
#if GST_GL_HAVE_PLATFORM_EGL #if GST_GL_HAVE_PLATFORM_EGL
@ -1130,8 +1132,12 @@ gst_gl_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
pool = gst_gl_buffer_pool_new (filter->context); pool = gst_gl_buffer_pool_new (filter->context);
config = gst_buffer_pool_get_config (pool); config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, min, max); gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META); gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
gst_buffer_pool_set_config (pool, config); gst_buffer_pool_set_config (pool, config);
if (filter->upload) { if (filter->upload) {