vaapisink: check for display's color-balance properties

Check for display's color-balance properties, available by the VA-API
driver, before setting them.

Also logs an info message of those unavailable properties.

https://bugzilla.gnome.org/show_bug.cgi?id=792638
This commit is contained in:
Víctor Manuel Jáquez Leal 2018-01-18 13:10:59 +01:00
parent 6efce291f6
commit f3650381c3

View file

@ -680,8 +680,10 @@ cb_sync_values_from_display (GstVaapiSink * sink, GstVaapiDisplay * display)
for (i = 0; i < G_N_ELEMENTS (sink->cb_values); i++) { for (i = 0; i < G_N_ELEMENTS (sink->cb_values); i++) {
const guint cb_id = CB_HUE + i; const guint cb_id = CB_HUE + i;
if (!gst_vaapi_display_has_property (display, cb_map[i].prop_name)) if (!gst_vaapi_display_has_property (display, cb_map[i].prop_name)) {
GST_INFO_OBJECT (sink, "backend does not handle %s", cb_map[i].prop_name);
continue; continue;
}
value = 0.0; value = 0.0;
g_object_get (display, cb_map[i].prop_name, &value, NULL); g_object_get (display, cb_map[i].prop_name, &value, NULL);
@ -700,6 +702,10 @@ cb_sync_values_to_display (GstVaapiSink * sink, GstVaapiDisplay * display)
const guint cb_id = CB_HUE + i; const guint cb_id = CB_HUE + i;
if (!(sink->cb_changed & (1U << cb_id))) if (!(sink->cb_changed & (1U << cb_id)))
continue; continue;
if (!gst_vaapi_display_has_property (display, cb_map[i].prop_name)) {
GST_INFO_OBJECT (sink, "backend does not handle %s", cb_map[i].prop_name);
continue;
}
g_object_set_property (G_OBJECT (display), cb_map[i].prop_name, g_object_set_property (G_OBJECT (display), cb_map[i].prop_name,
cb_get_gvalue (sink, cb_id)); cb_get_gvalue (sink, cb_id));