gst_query_parse_allocation (query, &caps, &need_pool);
+ if (!caps) {
+ GST_WARNING_OBJECT (dfbvideosink, "Missing caps in allocation query.");
+ return FALSE;
+ }
+
+ /* FIXME re-using buffer pool breaks renegotiation */
if ((pool = dfbvideosink->pool))
gst_object_ref (pool);
return FALSE;
}
gst_structure_free (config);
+ } else {
+ GstVideoInfo info;
+
+ if (!gst_video_info_from_caps (caps)) {
+ GST_WARNING_OBJECT (dfbvideosink,
+ "Invalid video caps in allocation query");
+ return FALSE;
+ }
+
+ size = info.size;
}
gst_query_add_allocation_pool (query, pool, size, 1, 0);
GstBufferPool *pool = NULL;
GstStructure *config;
GstCaps *caps;
+ GstVideoInfo info;
guint size;
gboolean need_pool;
if (caps == NULL)
goto no_caps;
- if (need_pool) {
- GstVideoInfo info;
-
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_caps;
+ if (!gst_video_info_from_caps (&info, caps))
+ goto invalid_caps;
- /* the normal size of a frame */
- size = info.size;
+ /* the normal size of a frame */
+ size = info.size;
+ if (need_pool) {
GST_DEBUG_OBJECT (ca_sink, "create new pool");
pool = gst_gl_buffer_pool_new (ca_sink->context);
if (!gst_buffer_pool_set_config (pool, config))
goto config_failed;
+ }
- /* we need at least 2 buffer because we hold on to the last one */
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ /* we need at least 2 buffer because we hold on to the last one */
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
gst_object_unref (pool);
- }
if (ca_sink->context->gl_vtable->FenceSync)
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
GstGLImageSink *glimage_sink = GST_GLIMAGE_SINK (bsink);
GstStructure *config;
GstCaps *caps;
+ GstBufferPool *pool = NULL;
+ GstVideoInfo info;
guint size;
gboolean need_pool;
GstStructure *allocation_meta = NULL;
if (caps == NULL)
goto no_caps;
- if (need_pool) {
- GstBufferPool *pool;
- GstVideoInfo info;
-
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_caps;
+ if (!gst_video_info_from_caps (&info, caps))
+ goto invalid_caps;
- /* the normal size of a frame */
- size = info.size;
+ /* the normal size of a frame */
+ size = info.size;
+ if (need_pool) {
GST_DEBUG_OBJECT (glimage_sink, "create new pool");
pool = gst_gl_buffer_pool_new (glimage_sink->context);
g_object_unref (pool);
goto config_failed;
}
+ }
- /* we need at least 2 buffer because we hold on to the last one */
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ /* we need at least 2 buffer because we hold on to the last one */
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
g_object_unref (pool);
- }
if (glimage_sink->context->gl_vtable->FenceSync)
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
GstBufferPool *pool = NULL;
GstStructure *config;
GstCaps *caps;
+ GstVideoInfo info;
guint size = 0;
gboolean need_pool;
-
if (!GST_AGGREGATOR_CLASS (gst_gl_mixer_parent_class)->propose_allocation
(agg, agg_pad, decide_query, query))
return FALSE;
if (caps == NULL)
goto no_caps;
- if (need_pool) {
- GstVideoInfo info;
+ if (!gst_video_info_from_caps (&info, caps))
+ goto invalid_caps;
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_caps;
+ /* the normal size of a frame */
+ size = info.size;
+ if (need_pool) {
GST_DEBUG_OBJECT (mix, "create new pool");
pool = gst_gl_buffer_pool_new (context);
- /* the normal size of a frame */
- size = info.size;
-
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
g_object_unref (pool);
goto config_failed;
}
+ }
- gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ if (pool)
g_object_unref (pool);
- }
/* we also support various metadata */
if (context->gl_vtable->FenceSync)
GstBufferPool *pool = NULL;
GstStructure *config;
GstCaps *caps;
+ GstVideoInfo info;
guint size;
gboolean need_pool;
GstStructure *allocation_meta = NULL;
if (caps == NULL)
goto no_caps;
- if (need_pool) {
- GstVideoInfo info;
+ if (!gst_video_info_from_caps (&info, caps))
+ goto invalid_caps;
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_caps;
+ /* the normal size of a frame */
+ size = info.size;
+ if (need_pool) {
GST_DEBUG_OBJECT (gtk_sink, "create new pool");
pool = gst_gl_buffer_pool_new (gtk_sink->context);
- /* the normal size of a frame */
- size = info.size;
-
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
gst_buffer_pool_config_add_option (config,
if (!gst_buffer_pool_set_config (pool, config))
goto config_failed;
+ }
- /* we need at least 2 buffer because we hold on to the last one */
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ /* we need at least 2 buffer because we hold on to the last one */
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
gst_object_unref (pool);
- }
GST_OBJECT_LOCK (gtk_sink);
display_width = gtk_sink->display_width;
if (caps == NULL)
goto no_caps;
+ /* FIXME re-using buffer pool breaks renegotiation */
if ((pool = qt_sink->pool))
gst_object_ref (pool);
pool = NULL;
}
gst_structure_free (config);
- }
-
- if (pool == NULL && need_pool) {
+ } else {
GstVideoInfo info;
if (!gst_video_info_from_caps (&info, caps))
goto invalid_caps;
- GST_DEBUG_OBJECT (qt_sink, "create new pool");
- pool = gst_gl_buffer_pool_new (qt_sink->context);
-
/* the normal size of a frame */
size = info.size;
+ }
+
+ if (pool == NULL && need_pool) {
+
+ GST_DEBUG_OBJECT (qt_sink, "create new pool");
+ pool = gst_gl_buffer_pool_new (qt_sink->context);
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
if (!gst_buffer_pool_set_config (pool, config))
goto config_failed;
}
+
/* we need at least 2 buffer because we hold on to the last one */
- if (pool) {
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
gst_object_unref (pool);
- }
/* we also support various metadata */
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
struct BufferUpload *raw = impl;
gboolean need_pool;
GstCaps *caps;
+ GstVideoInfo info;
guint size;
+ GstBufferPool *pool = NULL;
gst_query_parse_allocation (query, &caps, &need_pool);
if (caps == NULL)
return;
- if (need_pool) {
- GstBufferPool *pool;
- GstStructure *config;
- GstVideoInfo info;
+ if (!gst_video_info_from_caps (&info, caps))
+ return;
- if (!gst_video_info_from_caps (&info, caps))
- return;
+ /* the normal size of a frame */
+ size = info.size;
- /* the normal size of a frame */
- size = info.size;
+ if (need_pool) {
+ GstStructure *config;
pool = gst_vulkan_buffer_pool_new (raw->upload->device);
g_object_unref (pool);
return;
}
+ }
- gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ if (pool)
g_object_unref (pool);
- }
return;
}
if (need_pool)
pool = gst_wayland_create_pool (sink, caps);
- if (pool) {
- gst_query_add_allocation_pool (query, pool, sink->video_info.size, 2, 0);
+ gst_query_add_allocation_pool (query, pool, sink->video_info.size, 2, 0);
+ if (pool)
g_object_unref (pool);
- }
gst_query_add_allocation_param (query, gst_wl_shm_allocator_get (), NULL);
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
GstGLFilter *filter = GST_GL_FILTER (trans);
GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
GstCaps *caps;
+ GstVideoInfo info;
guint size;
+ GstBufferPool *pool = NULL;
gboolean need_pool;
gst_query_parse_allocation (query, &caps, &need_pool);
if (caps == NULL)
goto no_caps;
- if (need_pool) {
- GstBufferPool *pool;
- GstStructure *config;
- GstVideoInfo info;
+ if (!gst_video_info_from_caps (&info, caps))
+ goto invalid_caps;
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_caps;
+ /* the normal size of a frame */
+ size = info.size;
- /* the normal size of a frame */
- size = info.size;
+ if (need_pool) {
+ GstStructure *config;
GST_DEBUG_OBJECT (filter, "create new pool");
pool = gst_gl_buffer_pool_new (context);
g_object_unref (pool);
goto config_failed;
}
+ }
- gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ gst_query_add_allocation_pool (query, pool, size, 1, 0);
+ if (pool)
g_object_unref (pool);
- }
if (context->gl_vtable->FenceSync)
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
if (caps == NULL)
goto no_caps;
+ /* FIXME re-using buffer pool breaks renegotiation */
if ((pool = av_sink->pool))
gst_object_ref (pool);
pool = NULL;
}
gst_structure_free (config);
- }
-
- if (pool == NULL && need_pool) {
+ } else {
GstVideoInfo info;
if (!gst_video_info_from_caps (&info, caps))
goto invalid_caps;
- GST_DEBUG_OBJECT (av_sink, "create new pool");
- pool = gst_video_buffer_pool_new ();
-
/* the normal size of a frame */
size = info.size;
+ }
+
+ if (pool == NULL && need_pool) {
+ GST_DEBUG_OBJECT (av_sink, "create new pool");
+ pool = gst_video_buffer_pool_new ();
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
goto config_failed;
}
/* we need at least 2 buffer because we hold on to the last one */
- if (pool) {
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
gst_object_unref (pool);
- }
/* we also support various metadata */
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
return TRUE;
#endif
+ /* FIXME re-using buffer pool breaks renegotiation */
GST_OBJECT_LOCK (sink);
pool = sink->pool ? gst_object_ref (sink->pool) : NULL;
GST_OBJECT_UNLOCK (sink);
pool = NULL;
}
gst_structure_free (config);
- }
-
- if (pool == NULL && need_pool) {
+ } else {
GstVideoInfo info;
if (!gst_video_info_from_caps (&info, caps)) {
return FALSE;
}
- GST_DEBUG_OBJECT (sink, "create new pool");
- pool = gst_d3dsurface_buffer_pool_new (sink);
-
/* the normal size of a frame */
size = info.size;
+ }
+
+ if (pool == NULL && need_pool) {
+ GST_DEBUG_OBJECT (sink, "create new pool");
+ pool = gst_d3dsurface_buffer_pool_new (sink);
config = gst_buffer_pool_get_config (pool);
/* we need at least 2 buffer because we hold on to the last one */
}
}
- if (pool) {
- /* we need at least 2 buffer because we hold on to the last one */
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ /* we need at least 2 buffer because we hold on to the last one */
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
gst_object_unref (pool);
- }
return TRUE;
}
goto no_pool;
}
- if (pool) {
- /* we need at least 2 buffer because we hold on to the last one */
- gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ /* we need at least 2 buffer because we hold on to the last one */
+ gst_query_add_allocation_pool (query, pool, size, 2, 0);
+ if (pool)
gst_object_unref (pool);
- }
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, NULL);