Request minimum buffer even if need_pool is FALSE
When tee is used, it will not request a pool, but still it wants to know how many buffers are required. https://bugzilla.gnome.org/show_bug.cgi?id=730758
This commit is contained in:
parent
e796a7cb97
commit
9b2e28d91d
@ -2273,6 +2273,12 @@ gst_dfbvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
|
|
||||||
gst_query_parse_allocation (query, &caps, &need_pool);
|
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))
|
if ((pool = dfbvideosink->pool))
|
||||||
gst_object_ref (pool);
|
gst_object_ref (pool);
|
||||||
|
|
||||||
@ -2293,6 +2299,16 @@ gst_dfbvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
gst_structure_free (config);
|
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);
|
gst_query_add_allocation_pool (query, pool, size, 1, 0);
|
||||||
|
@ -730,6 +730,7 @@ gst_ca_opengl_layer_sink_propose_allocation (GstBaseSink * bsink, GstQuery * que
|
|||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
GstStructure *config;
|
GstStructure *config;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size;
|
guint size;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
|
|
||||||
@ -741,15 +742,13 @@ gst_ca_opengl_layer_sink_propose_allocation (GstBaseSink * bsink, GstQuery * que
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
if (need_pool) {
|
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
|
||||||
|
if (need_pool) {
|
||||||
GST_DEBUG_OBJECT (ca_sink, "create new pool");
|
GST_DEBUG_OBJECT (ca_sink, "create new pool");
|
||||||
|
|
||||||
pool = gst_gl_buffer_pool_new (ca_sink->context);
|
pool = gst_gl_buffer_pool_new (ca_sink->context);
|
||||||
@ -758,11 +757,12 @@ gst_ca_opengl_layer_sink_propose_allocation (GstBaseSink * bsink, GstQuery * que
|
|||||||
|
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
if (!gst_buffer_pool_set_config (pool, config))
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
|
}
|
||||||
|
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* we need at least 2 buffer because we hold on to the last one */
|
||||||
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);
|
gst_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
if (ca_sink->context->gl_vtable->FenceSync)
|
if (ca_sink->context->gl_vtable->FenceSync)
|
||||||
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
|
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
|
||||||
|
@ -1844,6 +1844,8 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
GstGLImageSink *glimage_sink = GST_GLIMAGE_SINK (bsink);
|
GstGLImageSink *glimage_sink = GST_GLIMAGE_SINK (bsink);
|
||||||
GstStructure *config;
|
GstStructure *config;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstBufferPool *pool = NULL;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size;
|
guint size;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
GstStructure *allocation_meta = NULL;
|
GstStructure *allocation_meta = NULL;
|
||||||
@ -1856,16 +1858,13 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
if (need_pool) {
|
|
||||||
GstBufferPool *pool;
|
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
|
||||||
|
if (need_pool) {
|
||||||
GST_DEBUG_OBJECT (glimage_sink, "create new pool");
|
GST_DEBUG_OBJECT (glimage_sink, "create new pool");
|
||||||
|
|
||||||
pool = gst_gl_buffer_pool_new (glimage_sink->context);
|
pool = gst_gl_buffer_pool_new (glimage_sink->context);
|
||||||
@ -1878,11 +1877,12 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
g_object_unref (pool);
|
g_object_unref (pool);
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* we need at least 2 buffer because we hold on to the last one */
|
||||||
gst_query_add_allocation_pool (query, pool, size, 2, 0);
|
gst_query_add_allocation_pool (query, pool, size, 2, 0);
|
||||||
|
if (pool)
|
||||||
g_object_unref (pool);
|
g_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
if (glimage_sink->context->gl_vtable->FenceSync)
|
if (glimage_sink->context->gl_vtable->FenceSync)
|
||||||
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
|
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
|
||||||
|
@ -140,10 +140,10 @@ gst_gl_mixer_propose_allocation (GstAggregator * agg,
|
|||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
GstStructure *config;
|
GstStructure *config;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size = 0;
|
guint size = 0;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
|
|
||||||
|
|
||||||
if (!GST_AGGREGATOR_CLASS (gst_gl_mixer_parent_class)->propose_allocation
|
if (!GST_AGGREGATOR_CLASS (gst_gl_mixer_parent_class)->propose_allocation
|
||||||
(agg, agg_pad, decide_query, query))
|
(agg, agg_pad, decide_query, query))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -155,18 +155,16 @@ gst_gl_mixer_propose_allocation (GstAggregator * agg,
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
if (need_pool) {
|
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (mix, "create new pool");
|
|
||||||
pool = gst_gl_buffer_pool_new (context);
|
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
|
||||||
|
if (need_pool) {
|
||||||
|
GST_DEBUG_OBJECT (mix, "create new pool");
|
||||||
|
pool = gst_gl_buffer_pool_new (context);
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
|
|
||||||
@ -174,10 +172,11 @@ gst_gl_mixer_propose_allocation (GstAggregator * agg,
|
|||||||
g_object_unref (pool);
|
g_object_unref (pool);
|
||||||
goto config_failed;
|
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);
|
g_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
if (context->gl_vtable->FenceSync)
|
if (context->gl_vtable->FenceSync)
|
||||||
|
@ -202,6 +202,7 @@ gst_gtk_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
GstStructure *config;
|
GstStructure *config;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size;
|
guint size;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
GstStructure *allocation_meta = NULL;
|
GstStructure *allocation_meta = NULL;
|
||||||
@ -215,18 +216,16 @@ gst_gtk_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
if (need_pool) {
|
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (gtk_sink, "create new pool");
|
|
||||||
pool = gst_gl_buffer_pool_new (gtk_sink->context);
|
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
|
||||||
|
if (need_pool) {
|
||||||
|
GST_DEBUG_OBJECT (gtk_sink, "create new pool");
|
||||||
|
pool = gst_gl_buffer_pool_new (gtk_sink->context);
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
gst_buffer_pool_config_add_option (config,
|
gst_buffer_pool_config_add_option (config,
|
||||||
@ -234,11 +233,12 @@ gst_gtk_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
|
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
if (!gst_buffer_pool_set_config (pool, config))
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
|
}
|
||||||
|
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* we need at least 2 buffer because we hold on to the last one */
|
||||||
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);
|
gst_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
GST_OBJECT_LOCK (gtk_sink);
|
GST_OBJECT_LOCK (gtk_sink);
|
||||||
display_width = gtk_sink->display_width;
|
display_width = gtk_sink->display_width;
|
||||||
|
@ -421,6 +421,7 @@ gst_qt_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
|
/* FIXME re-using buffer pool breaks renegotiation */
|
||||||
if ((pool = qt_sink->pool))
|
if ((pool = qt_sink->pool))
|
||||||
gst_object_ref (pool);
|
gst_object_ref (pool);
|
||||||
|
|
||||||
@ -439,30 +440,31 @@ gst_qt_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
pool = NULL;
|
pool = NULL;
|
||||||
}
|
}
|
||||||
gst_structure_free (config);
|
gst_structure_free (config);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (pool == NULL && need_pool) {
|
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_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 */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
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);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
if (!gst_buffer_pool_set_config (pool, config))
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* 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);
|
gst_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
|
||||||
|
@ -109,24 +109,24 @@ _buffer_propose_allocation (gpointer impl, GstQuery * decide_query,
|
|||||||
struct BufferUpload *raw = impl;
|
struct BufferUpload *raw = impl;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size;
|
guint size;
|
||||||
|
GstBufferPool *pool = NULL;
|
||||||
|
|
||||||
gst_query_parse_allocation (query, &caps, &need_pool);
|
gst_query_parse_allocation (query, &caps, &need_pool);
|
||||||
|
|
||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (need_pool) {
|
|
||||||
GstBufferPool *pool;
|
|
||||||
GstStructure *config;
|
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
|
||||||
|
if (need_pool) {
|
||||||
|
GstStructure *config;
|
||||||
|
|
||||||
pool = gst_vulkan_buffer_pool_new (raw->upload->device);
|
pool = gst_vulkan_buffer_pool_new (raw->upload->device);
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
@ -136,10 +136,11 @@ _buffer_propose_allocation (gpointer impl, GstQuery * decide_query,
|
|||||||
g_object_unref (pool);
|
g_object_unref (pool);
|
||||||
return;
|
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);
|
g_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -536,10 +536,9 @@ gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
if (need_pool)
|
if (need_pool)
|
||||||
pool = gst_wayland_create_pool (sink, caps);
|
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);
|
g_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
gst_query_add_allocation_param (query, gst_wl_shm_allocator_get (), NULL);
|
gst_query_add_allocation_param (query, gst_wl_shm_allocator_get (), NULL);
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
||||||
|
@ -774,7 +774,9 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
|
|||||||
GstGLFilter *filter = GST_GL_FILTER (trans);
|
GstGLFilter *filter = GST_GL_FILTER (trans);
|
||||||
GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
|
GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size;
|
guint size;
|
||||||
|
GstBufferPool *pool = NULL;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
|
|
||||||
gst_query_parse_allocation (query, &caps, &need_pool);
|
gst_query_parse_allocation (query, &caps, &need_pool);
|
||||||
@ -782,17 +784,15 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
if (need_pool) {
|
|
||||||
GstBufferPool *pool;
|
|
||||||
GstStructure *config;
|
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
size = info.size;
|
||||||
|
|
||||||
|
if (need_pool) {
|
||||||
|
GstStructure *config;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (filter, "create new pool");
|
GST_DEBUG_OBJECT (filter, "create new pool");
|
||||||
pool = gst_gl_buffer_pool_new (context);
|
pool = gst_gl_buffer_pool_new (context);
|
||||||
|
|
||||||
@ -803,10 +803,11 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
|
|||||||
g_object_unref (pool);
|
g_object_unref (pool);
|
||||||
goto config_failed;
|
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);
|
g_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
if (context->gl_vtable->FenceSync)
|
if (context->gl_vtable->FenceSync)
|
||||||
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
|
gst_query_add_allocation_meta (query, GST_GL_SYNC_META_API_TYPE, 0);
|
||||||
|
@ -782,6 +782,7 @@ gst_av_sample_video_sink_propose_allocation (GstBaseSink * bsink, GstQuery * que
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
|
/* FIXME re-using buffer pool breaks renegotiation */
|
||||||
if ((pool = av_sink->pool))
|
if ((pool = av_sink->pool))
|
||||||
gst_object_ref (pool);
|
gst_object_ref (pool);
|
||||||
|
|
||||||
@ -800,19 +801,19 @@ gst_av_sample_video_sink_propose_allocation (GstBaseSink * bsink, GstQuery * que
|
|||||||
pool = NULL;
|
pool = NULL;
|
||||||
}
|
}
|
||||||
gst_structure_free (config);
|
gst_structure_free (config);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (pool == NULL && need_pool) {
|
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto invalid_caps;
|
goto invalid_caps;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (av_sink, "create new pool");
|
|
||||||
pool = gst_video_buffer_pool_new ();
|
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
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);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, 0, 0);
|
||||||
@ -820,10 +821,9 @@ gst_av_sample_video_sink_propose_allocation (GstBaseSink * bsink, GstQuery * que
|
|||||||
goto config_failed;
|
goto config_failed;
|
||||||
}
|
}
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* 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);
|
gst_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
|
||||||
|
@ -470,6 +470,7 @@ gst_d3dvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* FIXME re-using buffer pool breaks renegotiation */
|
||||||
GST_OBJECT_LOCK (sink);
|
GST_OBJECT_LOCK (sink);
|
||||||
pool = sink->pool ? gst_object_ref (sink->pool) : NULL;
|
pool = sink->pool ? gst_object_ref (sink->pool) : NULL;
|
||||||
GST_OBJECT_UNLOCK (sink);
|
GST_OBJECT_UNLOCK (sink);
|
||||||
@ -489,9 +490,7 @@ gst_d3dvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
pool = NULL;
|
pool = NULL;
|
||||||
}
|
}
|
||||||
gst_structure_free (config);
|
gst_structure_free (config);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (pool == NULL && need_pool) {
|
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps)) {
|
if (!gst_video_info_from_caps (&info, caps)) {
|
||||||
@ -500,11 +499,13 @@ gst_d3dvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (sink, "create new pool");
|
|
||||||
pool = gst_d3dsurface_buffer_pool_new (sink);
|
|
||||||
|
|
||||||
/* the normal size of a frame */
|
/* the normal size of a frame */
|
||||||
size = info.size;
|
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);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* we need at least 2 buffer because we hold on to the last one */
|
||||||
@ -516,11 +517,10 @@ gst_d3dvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pool) {
|
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* we need at least 2 buffer because we hold on to the last one */
|
||||||
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);
|
gst_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -982,11 +982,10 @@ gst_kms_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
goto no_pool;
|
goto no_pool;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pool) {
|
|
||||||
/* we need at least 2 buffer because we hold on to the last one */
|
/* we need at least 2 buffer because we hold on to the last one */
|
||||||
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);
|
gst_object_unref (pool);
|
||||||
}
|
|
||||||
|
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
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);
|
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user