mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
va: filter/postproc: move unconditional props to vavpp
Only conditional/dynamic properties should be installed/handled by vafilter. Thus, move and install the unconditional/static properties in vavpp. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>
This commit is contained in:
parent
178f4fcd20
commit
211ba46369
3 changed files with 60 additions and 45 deletions
|
@ -683,37 +683,6 @@ gst_va_filter_install_properties (GstVaFilter * self, GObjectClass * klass)
|
||||||
common_flags));
|
common_flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* GstVaPostProc:disable-passthrough:
|
|
||||||
*
|
|
||||||
* If set to %TRUE the filter will not enable passthrough mode, thus
|
|
||||||
* each frame will be processed. It's useful for cropping, for
|
|
||||||
* example.
|
|
||||||
*
|
|
||||||
* Since: 1.20
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (klass,
|
|
||||||
GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH,
|
|
||||||
g_param_spec_boolean ("disable-passthrough", "Disable Passthrough",
|
|
||||||
"Forces passing buffers through the postprocessor", FALSE,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
|
|
||||||
| GST_PARAM_MUTABLE_READY));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GstVaPostProc:add-borders:
|
|
||||||
*
|
|
||||||
* If set to %TRUE the filter will add black borders if necessary to
|
|
||||||
* keep the display aspect ratio.
|
|
||||||
*
|
|
||||||
* Since: 1.20
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (klass, GST_VA_FILTER_PROP_ADD_BORDERS,
|
|
||||||
g_param_spec_boolean ("add-borders", "Add Borders",
|
|
||||||
"Add black borders if necessary to keep the display aspect ratio",
|
|
||||||
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
|
|
||||||
| GST_PARAM_MUTABLE_PLAYING));
|
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,7 @@ enum {
|
||||||
GST_VA_FILTER_PROP_AUTO_SATURATION,
|
GST_VA_FILTER_PROP_AUTO_SATURATION,
|
||||||
GST_VA_FILTER_PROP_AUTO_BRIGHTNESS,
|
GST_VA_FILTER_PROP_AUTO_BRIGHTNESS,
|
||||||
GST_VA_FILTER_PROP_AUTO_CONTRAST,
|
GST_VA_FILTER_PROP_AUTO_CONTRAST,
|
||||||
GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH,
|
|
||||||
GST_VA_FILTER_PROP_DEINTERLACE_METHOD,
|
GST_VA_FILTER_PROP_DEINTERLACE_METHOD,
|
||||||
GST_VA_FILTER_PROP_ADD_BORDERS,
|
|
||||||
GST_VA_FILTER_PROP_HDR,
|
GST_VA_FILTER_PROP_HDR,
|
||||||
GST_VA_FILTER_PROP_LAST
|
GST_VA_FILTER_PROP_LAST
|
||||||
};
|
};
|
||||||
|
|
|
@ -129,6 +129,17 @@ struct CData
|
||||||
gchar *description;
|
gchar *description;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PROP_DISABLE_PASSTHROUGH = GST_VA_FILTER_PROP_LAST + 1,
|
||||||
|
PROP_ADD_BORDERS,
|
||||||
|
N_PROPERTIES
|
||||||
|
};
|
||||||
|
|
||||||
|
static GParamSpec *properties[N_PROPERTIES - GST_VA_FILTER_PROP_LAST];
|
||||||
|
|
||||||
|
#define PROPERTIES(idx) properties[idx - GST_VA_FILTER_PROP_LAST]
|
||||||
|
|
||||||
/* convertions that disable passthrough */
|
/* convertions that disable passthrough */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -290,7 +301,11 @@ gst_va_vpp_set_property (GObject * object, guint prop_id,
|
||||||
self->auto_contrast = g_value_get_boolean (value);
|
self->auto_contrast = g_value_get_boolean (value);
|
||||||
g_atomic_int_set (&self->rebuild_filters, TRUE);
|
g_atomic_int_set (&self->rebuild_filters, TRUE);
|
||||||
break;
|
break;
|
||||||
case GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH:{
|
case GST_VA_FILTER_PROP_HDR:
|
||||||
|
self->hdr_mapping = g_value_get_boolean (value);
|
||||||
|
g_atomic_int_set (&self->rebuild_filters, TRUE);
|
||||||
|
break;
|
||||||
|
case PROP_DISABLE_PASSTHROUGH:{
|
||||||
gboolean disable_passthrough = g_value_get_boolean (value);
|
gboolean disable_passthrough = g_value_get_boolean (value);
|
||||||
if (disable_passthrough)
|
if (disable_passthrough)
|
||||||
self->op_flags |= VPP_CONVERT_DUMMY;
|
self->op_flags |= VPP_CONVERT_DUMMY;
|
||||||
|
@ -298,13 +313,9 @@ gst_va_vpp_set_property (GObject * object, guint prop_id,
|
||||||
self->op_flags &= ~VPP_CONVERT_DUMMY;
|
self->op_flags &= ~VPP_CONVERT_DUMMY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_VA_FILTER_PROP_ADD_BORDERS:
|
case PROP_ADD_BORDERS:
|
||||||
self->add_borders = g_value_get_boolean (value);
|
self->add_borders = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
case GST_VA_FILTER_PROP_HDR:
|
|
||||||
self->hdr_mapping = g_value_get_boolean (value);
|
|
||||||
g_atomic_int_set (&self->rebuild_filters, TRUE);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -360,15 +371,15 @@ gst_va_vpp_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case GST_VA_FILTER_PROP_AUTO_CONTRAST:
|
case GST_VA_FILTER_PROP_AUTO_CONTRAST:
|
||||||
g_value_set_boolean (value, self->auto_contrast);
|
g_value_set_boolean (value, self->auto_contrast);
|
||||||
break;
|
break;
|
||||||
case GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH:
|
|
||||||
g_value_set_boolean (value, (self->op_flags & VPP_CONVERT_DUMMY));
|
|
||||||
break;
|
|
||||||
case GST_VA_FILTER_PROP_ADD_BORDERS:
|
|
||||||
g_value_set_boolean (value, self->add_borders);
|
|
||||||
break;
|
|
||||||
case GST_VA_FILTER_PROP_HDR:
|
case GST_VA_FILTER_PROP_HDR:
|
||||||
g_value_set_boolean (value, self->hdr_mapping);
|
g_value_set_boolean (value, self->hdr_mapping);
|
||||||
break;
|
break;
|
||||||
|
case PROP_DISABLE_PASSTHROUGH:
|
||||||
|
g_value_set_boolean (value, (self->op_flags & VPP_CONVERT_DUMMY));
|
||||||
|
break;
|
||||||
|
case PROP_ADD_BORDERS:
|
||||||
|
g_value_set_boolean (value, self->add_borders);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -2024,6 +2035,41 @@ gst_va_vpp_sink_event (GstBaseTransform * trans, GstEvent * event)
|
||||||
return GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event);
|
return GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_install_static_properties (GObjectClass * klass)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* GstVaPostProc:disable-passthrough:
|
||||||
|
*
|
||||||
|
* If set to %TRUE the filter will not enable passthrough mode, thus
|
||||||
|
* each frame will be processed. It's useful for cropping, for
|
||||||
|
* example.
|
||||||
|
*
|
||||||
|
* Since: 1.20
|
||||||
|
*/
|
||||||
|
PROPERTIES (PROP_DISABLE_PASSTHROUGH) =
|
||||||
|
g_param_spec_boolean ("disable-passthrough", "Disable Passthrough",
|
||||||
|
"Forces passing buffers through the postprocessor", FALSE,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_MUTABLE_READY);
|
||||||
|
g_object_class_install_property (klass, PROP_DISABLE_PASSTHROUGH,
|
||||||
|
PROPERTIES (PROP_DISABLE_PASSTHROUGH));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstVaPostProc:add-borders:
|
||||||
|
*
|
||||||
|
* If set to %TRUE the filter will add black borders if necessary to
|
||||||
|
* keep the display aspect ratio.
|
||||||
|
*
|
||||||
|
* Since: 1.20
|
||||||
|
*/
|
||||||
|
PROPERTIES (PROP_ADD_BORDERS) = g_param_spec_boolean ("add-borders",
|
||||||
|
"Add Borders",
|
||||||
|
"Add black borders if necessary to keep the display aspect ratio", FALSE,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_MUTABLE_PLAYING);
|
||||||
|
g_object_class_install_property (klass, PROP_ADD_BORDERS,
|
||||||
|
PROPERTIES (PROP_ADD_BORDERS));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_va_vpp_class_init (gpointer g_class, gpointer class_data)
|
gst_va_vpp_class_init (gpointer g_class, gpointer class_data)
|
||||||
{
|
{
|
||||||
|
@ -2130,6 +2176,8 @@ gst_va_vpp_class_init (gpointer g_class, gpointer class_data)
|
||||||
|
|
||||||
gst_va_filter_install_properties (filter, object_class);
|
gst_va_filter_install_properties (filter, object_class);
|
||||||
|
|
||||||
|
_install_static_properties (object_class);
|
||||||
|
|
||||||
g_free (long_name);
|
g_free (long_name);
|
||||||
g_free (cdata->description);
|
g_free (cdata->description);
|
||||||
g_free (cdata->render_device_path);
|
g_free (cdata->render_device_path);
|
||||||
|
|
Loading…
Reference in a new issue