vaapidecodebin: notify if vpp is disabled

When the system is aware that VPP is not available by the VA driver,
it would be useful to notify to the user that the disable-vpp property
has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=749554
This commit is contained in:
Víctor Manuel Jáquez Leal 2015-07-01 14:16:50 +02:00
parent 5c799b35f7
commit b4d9c0a79a

View file

@ -47,9 +47,12 @@ enum
PROP_MAX_SIZE_BYTES, PROP_MAX_SIZE_BYTES,
PROP_MAX_SIZE_TIME, PROP_MAX_SIZE_TIME,
PROP_DEINTERLACE_METHOD, PROP_DEINTERLACE_METHOD,
PROP_DISABLE_VPP PROP_DISABLE_VPP,
PROP_LAST
}; };
static GParamSpec *properties[PROP_LAST];
#define GST_VAAPI_DECODE_BIN_SURFACE_CAPS \ #define GST_VAAPI_DECODE_BIN_SURFACE_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \ GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, I420, YV12, NV12 }") GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, I420, YV12, NV12 }")
@ -275,6 +278,8 @@ gst_vaapi_decode_bin_handle_message (GstBin * bin, GstMessage * message)
GST_WARNING_OBJECT (vaapidecbin, "VA driver doesn't support VPP"); GST_WARNING_OBJECT (vaapidecbin, "VA driver doesn't support VPP");
if (!vaapidecbin->disable_vpp) { if (!vaapidecbin->disable_vpp) {
vaapidecbin->disable_vpp = TRUE; vaapidecbin->disable_vpp = TRUE;
g_object_notify_by_pspec (G_OBJECT (vaapidecbin),
properties[PROP_DISABLE_VPP]);
} }
} }
@ -308,31 +313,28 @@ gst_vaapi_decode_bin_class_init (GstVaapiDecodeBinClass * klass)
GST_PLUGIN_DESC, GST_PLUGIN_DESC,
"Sreerenj Balachandran <sreerenj.balachandran@intel.com>"); "Sreerenj Balachandran <sreerenj.balachandran@intel.com>");
g_object_class_install_property (gobject_class, PROP_MAX_SIZE_BYTES, properties[PROP_MAX_SIZE_BYTES] = g_param_spec_uint ("max-size-bytes",
g_param_spec_uint ("max-size-bytes", "Max. size (kB)", "Max. size (kB)", "Max. amount of data in the queue (bytes, 0=disable)",
"Max. amount of data in the queue (bytes, 0=disable)", 0, G_MAXUINT, DEFAULT_QUEUE_MAX_SIZE_BYTES,
0, G_MAXUINT, DEFAULT_QUEUE_MAX_SIZE_BYTES, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); properties[PROP_MAX_SIZE_BUFFERS] = g_param_spec_uint ("max-size-buffers",
g_object_class_install_property (gobject_class, PROP_MAX_SIZE_BUFFERS, "Max. size (buffers)", "Max. number of buffers in the queue (0=disable)",
g_param_spec_uint ("max-size-buffers", "Max. size (buffers)", 0, G_MAXUINT, DEFAULT_QUEUE_MAX_SIZE_BUFFERS,
"Max. number of buffers in the queue (0=disable)", 0, G_MAXUINT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
DEFAULT_QUEUE_MAX_SIZE_BUFFERS, properties[PROP_MAX_SIZE_TIME] = g_param_spec_uint64 ("max-size-time",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); "Max. size (ns)", "Max. amount of data in the queue (in ns, 0=disable)",
g_object_class_install_property (gobject_class, PROP_MAX_SIZE_TIME, 0, G_MAXUINT64, DEFAULT_QUEUE_MAX_SIZE_TIME,
g_param_spec_uint64 ("max-size-time", "Max. size (ns)", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
"Max. amount of data in the queue (in ns, 0=disable)", 0, G_MAXUINT64, properties[PROP_DEINTERLACE_METHOD] = g_param_spec_enum ("deinterlace-method",
DEFAULT_QUEUE_MAX_SIZE_TIME, "Deinterlace method", "Deinterlace method to use",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); GST_VAAPI_TYPE_DEINTERLACE_METHOD, DEFAULT_DEINTERLACE_METHOD,
g_object_class_install_property (gobject_class, PROP_DEINTERLACE_METHOD, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_param_spec_enum ("deinterlace-method", "Deinterlace method", properties[PROP_DISABLE_VPP] = g_param_spec_boolean ("disable-vpp",
"Deinterlace method to use", GST_VAAPI_TYPE_DEINTERLACE_METHOD, "Disable VPP",
DEFAULT_DEINTERLACE_METHOD, "Disable Video Post Processing (No support for run time disabling)",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (gobject_class, PROP_DISABLE_VPP,
g_param_spec_boolean ("disable-vpp", g_object_class_install_properties (gobject_class, PROP_LAST, properties);
"Disable VPP",
"Disable Video Post Processing(No support for run time disabling)",
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (element_class, gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_vaapi_decode_bin_sink_factory)); gst_static_pad_template_get (&gst_vaapi_decode_bin_sink_factory));