gboolean foreign;
gboolean init;
GstVaImplementation impl;
+ gchar *vendor_desc;
};
#define gst_va_display_parent_class parent_class
enum
{
PROP_VA_DISPLAY = 1,
+ PROP_DESC,
N_PROPERTIES
};
priv->foreign = TRUE;
}
priv->impl = _get_implementation (vendor);
+ priv->vendor_desc = g_strdup (vendor);
return TRUE;
}
case PROP_VA_DISPLAY:
g_value_set_pointer (value, priv->display);
break;
+ case PROP_DESC:
+ g_value_set_string (value, priv->vendor_desc);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
static void
gst_va_display_finalize (GObject * object)
{
+ GstVaDisplayPrivate *priv = GET_PRIV (object);
+
+ g_free (priv->vendor_desc);
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
g_param_spec_pointer ("va-display", "VADisplay", "VA Display handler",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+ g_properties[PROP_DESC] =
+ g_param_spec_string ("description", "Description",
+ "Vendor specific VA implementation description", NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
g_object_class_install_properties (gobject_class, N_PROPERTIES, g_properties);
}
g_return_if_fail (context != NULL);
+ s = gst_context_writable_structure (context);
+ gst_structure_set (s, "gst-display", GST_TYPE_OBJECT, display, NULL);
+
if (display) {
+ GObjectClass *klass = G_OBJECT_GET_CLASS (display);
+ gchar *vendor_desc = NULL;
+ gchar *path = NULL;
+
+ g_object_get (display, "description", &vendor_desc, NULL);
+ if (g_object_class_find_property (klass, "path"))
+ g_object_get (display, "path", &path, NULL);
+
GST_CAT_LOG (GST_CAT_CONTEXT,
"setting GstVaDisplay (%" GST_PTR_FORMAT ") on context (%"
- GST_PTR_FORMAT ")", display, context);
- }
+ GST_PTR_FORMAT "), description: \"%s\", path: %s", display, context,
+ GST_STR_NULL (vendor_desc), GST_STR_NULL (path));
- s = gst_context_writable_structure (context);
- gst_structure_set (s, "gst-display", GST_TYPE_OBJECT, display, NULL);
+ if (vendor_desc) {
+ gst_structure_set (s, "description", G_TYPE_STRING, vendor_desc, NULL);
+ g_free (vendor_desc);
+ }
+
+ if (path) {
+ gst_structure_set (s, "path", G_TYPE_STRING, path, NULL);
+ g_free (path);
+ }
+ }
}