mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
v4l2object: Use proposed allocator as default
This commit is contained in:
parent
aff64af8ad
commit
4aa5d42184
1 changed files with 13 additions and 0 deletions
|
@ -3147,6 +3147,8 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
|
||||||
gboolean has_video_meta;
|
gboolean has_video_meta;
|
||||||
gboolean can_share_own_pool, pushing_from_our_pool = FALSE;
|
gboolean can_share_own_pool, pushing_from_our_pool = FALSE;
|
||||||
struct v4l2_control ctl = { 0, };
|
struct v4l2_control ctl = { 0, };
|
||||||
|
GstAllocator *allocator = NULL;
|
||||||
|
GstAllocationParams params = { 0 };
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (obj->element, "decide allocation");
|
GST_DEBUG_OBJECT (obj->element, "decide allocation");
|
||||||
|
|
||||||
|
@ -3160,6 +3162,9 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
|
||||||
goto pool_failed;
|
goto pool_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gst_query_get_n_allocation_params (query) > 0)
|
||||||
|
gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms);
|
||||||
|
|
||||||
if (gst_query_get_n_allocation_pools (query) > 0) {
|
if (gst_query_get_n_allocation_pools (query) > 0) {
|
||||||
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
|
gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
|
||||||
update = TRUE;
|
update = TRUE;
|
||||||
|
@ -3300,6 +3305,7 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_buffer_pool_config_set_allocator (config, allocator, ¶ms);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, own_min, 0);
|
gst_buffer_pool_config_set_params (config, caps, size, own_min, 0);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (obj->element, "setting own pool config to %"
|
GST_DEBUG_OBJECT (obj->element, "setting own pool config to %"
|
||||||
|
@ -3331,6 +3337,7 @@ setup_other_pool:
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
|
gst_buffer_pool_config_set_allocator (config, allocator, ¶ms);
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, min, max);
|
gst_buffer_pool_config_set_params (config, caps, size, min, max);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (obj->element, "setting other pool config to %"
|
GST_DEBUG_OBJECT (obj->element, "setting other pool config to %"
|
||||||
|
@ -3353,6 +3360,9 @@ done:
|
||||||
else
|
else
|
||||||
gst_query_add_allocation_pool (query, pool, size, min, max);
|
gst_query_add_allocation_pool (query, pool, size, min, max);
|
||||||
|
|
||||||
|
if (allocator)
|
||||||
|
gst_object_unref (allocator);
|
||||||
|
|
||||||
if (pool)
|
if (pool)
|
||||||
gst_object_unref (pool);
|
gst_object_unref (pool);
|
||||||
|
|
||||||
|
@ -3377,6 +3387,9 @@ no_size:
|
||||||
}
|
}
|
||||||
cleanup:
|
cleanup:
|
||||||
{
|
{
|
||||||
|
if (allocator)
|
||||||
|
gst_object_unref (allocator);
|
||||||
|
|
||||||
if (pool)
|
if (pool)
|
||||||
gst_object_unref (pool);
|
gst_object_unref (pool);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue