Commit 46ffef79 authored by Nicolas Dufresne's avatar Nicolas Dufresne

v4l2object: Ensure size before configuring the pool

parent 5a61fb7f
...@@ -3128,6 +3128,17 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query) ...@@ -3128,6 +3128,17 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
break; break;
} }
/* Size field is mandatory and we have no size if now using our own pool and
* downstream didn't provide one. */
if (size == 0) {
GstVideoInfo info;
gst_video_info_init (&info);
gst_video_info_from_caps (&info, caps);
size = GST_VIDEO_INFO_SIZE (&info);
}
if (pool) { if (pool) {
GstStructure *config; GstStructure *config;
...@@ -3144,17 +3155,6 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query) ...@@ -3144,17 +3155,6 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
gst_buffer_pool_set_config (pool, config); gst_buffer_pool_set_config (pool, config);
} }
/* Size field is mandatory and we have no size if now using our own pool and
* downstream didn't provide one. */
if (size == 0) {
GstVideoInfo info;
gst_video_info_init (&info);
gst_video_info_from_caps (&info, caps);
size = GST_VIDEO_INFO_SIZE (&info);
}
if (update) if (update)
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max); gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment