postproc: reconfigure when width or height changes

https://bugzilla.gnome.org/show_bug.cgi?id=754885
This commit is contained in:
Hyunjun Ko 2017-07-12 18:25:15 +09:00 committed by Víctor Manuel Jáquez Leal
parent a9c13a0934
commit 8a04f390c8

View file

@ -1431,6 +1431,7 @@ gst_vaapipostproc_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec) guint prop_id, const GValue * value, GParamSpec * pspec)
{ {
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (object); GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (object);
gboolean do_reconf = FALSE;
g_mutex_lock (&postproc->postproc_lock); g_mutex_lock (&postproc->postproc_lock);
switch (prop_id) { switch (prop_id) {
@ -1438,11 +1439,19 @@ gst_vaapipostproc_set_property (GObject * object,
postproc->format = g_value_get_enum (value); postproc->format = g_value_get_enum (value);
break; break;
case PROP_WIDTH: case PROP_WIDTH:
{
guint prev_width = postproc->width;
postproc->width = g_value_get_uint (value); postproc->width = g_value_get_uint (value);
do_reconf = (prev_width != postproc->width);
break; break;
}
case PROP_HEIGHT: case PROP_HEIGHT:
{
guint prev_height = postproc->height;
postproc->height = g_value_get_uint (value); postproc->height = g_value_get_uint (value);
do_reconf = (prev_height != postproc->height);
break; break;
}
case PROP_FORCE_ASPECT_RATIO: case PROP_FORCE_ASPECT_RATIO:
postproc->keep_aspect = g_value_get_boolean (value); postproc->keep_aspect = g_value_get_boolean (value);
break; break;
@ -1490,7 +1499,7 @@ gst_vaapipostproc_set_property (GObject * object,
} }
g_mutex_unlock (&postproc->postproc_lock); g_mutex_unlock (&postproc->postproc_lock);
if (check_filter_update (postproc)) if (do_reconf || check_filter_update (postproc))
gst_base_transform_reconfigure_src (GST_BASE_TRANSFORM (postproc)); gst_base_transform_reconfigure_src (GST_BASE_TRANSFORM (postproc));
} }