vaapipostproc: update filter before fixate caps

It is requiered to know if postproc is capable to change the video
direction before fixating the source caps.

In order to do it, it'ss required to know if there's a functional VPP,
but that's checked at create() vmethod, which occurs after caps
fixating.

This patch checks for a functional VPP at fixate caps and, if so,
checks for the enabled filtes and later do the caps fixations.
This commit is contained in:
Víctor Manuel Jáquez Leal 2019-07-26 22:05:29 +02:00
parent c06b587819
commit bd175f9956

View file

@ -1255,6 +1255,7 @@ gst_vaapipostproc_fixate_caps (GstBaseTransform * trans,
{
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
GstCaps *outcaps = NULL;
gboolean same_caps, filter_updated = FALSE;
GST_DEBUG_OBJECT (trans, "trying to fixate othercaps %" GST_PTR_FORMAT
" based on caps %" GST_PTR_FORMAT " in direction %s", othercaps, caps,
@ -1267,11 +1268,18 @@ gst_vaapipostproc_fixate_caps (GstBaseTransform * trans,
}
g_mutex_lock (&postproc->postproc_lock);
postproc->has_vpp = gst_vaapipostproc_ensure_filter_caps (postproc);
if (check_filter_update (postproc) && update_filter (postproc)) {
/* check again if changed value is default */
filter_updated = check_filter_update (postproc);
}
outcaps = gst_vaapipostproc_fixate_srccaps (postproc, caps, othercaps);
g_mutex_unlock (&postproc->postproc_lock);
/* set passthrough according to caps changes or filter changes */
gst_vaapipostproc_set_passthrough (trans);
same_caps = gst_caps_is_equal (caps, outcaps);
gst_base_transform_set_passthrough (trans, same_caps && !filter_updated);
done:
GST_DEBUG_OBJECT (trans, "fixated othercaps to %" GST_PTR_FORMAT, outcaps);