videocrop: Don't always re-run the allocation query

When in-place, running an allocation is not useful since videocrop
is not implicated in the allocation. So only force the allocation
query for the case it was in passthrough. This is needed since the
change in the crop region will likely pull us out of this mode. For the
case we where neither in passthrough or in-place, the allocation query
is already ran by the baseclass, so nothing special is needed.

This fixes performance issues when changing the crop region per frame.
This was reproduced using videocrop2-test.
This commit is contained in:
Nicolas Dufresne 2019-11-11 13:19:08 -05:00
parent e09b4e9cde
commit 98a5726eba

View file

@ -798,9 +798,11 @@ gst_video_crop_set_info (GstVideoFilter * vfilter, GstCaps * in,
crop->in_info = *in_info;
crop->out_info = *out_info;
/* Ensure our decide_allocation will be called again */
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (crop), FALSE);
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (crop), FALSE);
/* Ensure our decide_allocation will be called again when needed */
if (gst_base_transform_is_passthrough (GST_BASE_TRANSFORM (crop))) {
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (crop), FALSE);
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (crop), FALSE);
}
return TRUE;