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
5d6fbcb0af
commit
2bf665486e
@ -1463,6 +1463,7 @@ gst_x_image_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (bsink);
|
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (bsink);
|
||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size;
|
guint size;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
|
|
||||||
@ -1471,26 +1472,23 @@ gst_x_image_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
|
goto invalid_caps;
|
||||||
|
|
||||||
|
/* the normal size of a frame */
|
||||||
|
size = info.size;
|
||||||
|
|
||||||
if (need_pool) {
|
if (need_pool) {
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
|
||||||
goto invalid_caps;
|
|
||||||
|
|
||||||
pool = gst_x_image_sink_create_pool (ximagesink, caps, info.size, 0);
|
pool = gst_x_image_sink_create_pool (ximagesink, caps, info.size, 0);
|
||||||
|
|
||||||
/* the normal size of a frame */
|
|
||||||
size = info.size;
|
|
||||||
|
|
||||||
if (pool == NULL)
|
if (pool == NULL)
|
||||||
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);
|
||||||
}
|
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
||||||
|
@ -1051,6 +1051,7 @@ gst_xv_image_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
||||||
GstBufferPool *pool = NULL;
|
GstBufferPool *pool = NULL;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
GstVideoInfo info;
|
||||||
guint size;
|
guint size;
|
||||||
gboolean need_pool;
|
gboolean need_pool;
|
||||||
|
|
||||||
@ -1059,27 +1060,24 @@ gst_xv_image_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
|||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
goto no_caps;
|
goto no_caps;
|
||||||
|
|
||||||
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
|
goto invalid_caps;
|
||||||
|
|
||||||
|
/* the normal size of a frame */
|
||||||
|
size = info.size;
|
||||||
|
|
||||||
if (need_pool) {
|
if (need_pool) {
|
||||||
GstVideoInfo info;
|
|
||||||
|
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
|
||||||
goto invalid_caps;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (xvimagesink, "create new pool");
|
GST_DEBUG_OBJECT (xvimagesink, "create new pool");
|
||||||
pool = gst_xv_image_sink_create_pool (xvimagesink, caps, info.size, 0);
|
pool = gst_xv_image_sink_create_pool (xvimagesink, caps, info.size, 0);
|
||||||
|
|
||||||
/* the normal size of a frame */
|
|
||||||
size = info.size;
|
|
||||||
|
|
||||||
if (pool == NULL)
|
if (pool == NULL)
|
||||||
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);
|
||||||
}
|
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user