display: add interface to retrieve the display name.

Add gst_vaapi_display_get_display_name() helper function to determine
the name associated with the underlying native display. Note that for
raw DRM backends, the display name is actually the device path.
This commit is contained in:
Gwenole Beauchesne 2014-07-25 11:24:39 +02:00
parent 39ab75becd
commit 7c2c4c7a97
3 changed files with 26 additions and 0 deletions

View file

@ -854,6 +854,9 @@ gst_vaapi_display_destroy (GstVaapiDisplay * display)
klass->close_display (display);
}
g_free (priv->display_name);
priv->display_name = NULL;
g_free (priv->vendor_string);
priv->vendor_string = NULL;
@ -930,6 +933,9 @@ gst_vaapi_display_create_unlocked (GstVaapiDisplay * display,
if (!gst_vaapi_display_cache_add (priv->cache, &info))
return FALSE;
}
g_free (priv->display_name);
priv->display_name = g_strdup (info.display_name);
return TRUE;
}
@ -1288,6 +1294,22 @@ gst_vaapi_display_get_display_type (GstVaapiDisplay * display)
return GST_VAAPI_DISPLAY_GET_PRIVATE (display)->display_type;
}
/**
* gst_vaapi_display_get_display_type:
* @display: a #GstVaapiDisplay
*
* Returns the @display name.
*
* Return value: the display name
*/
const gchar *
gst_vaapi_display_get_display_name (GstVaapiDisplay * display)
{
g_return_val_if_fail (display != NULL, NULL);
return GST_VAAPI_DISPLAY_GET_PRIVATE (display)->display_name;
}
/**
* gst_vaapi_display_get_display:
* @display: a #GstVaapiDisplay

View file

@ -124,6 +124,9 @@ gst_vaapi_display_flush (GstVaapiDisplay * display);
GstVaapiDisplayType
gst_vaapi_display_get_display_type (GstVaapiDisplay * display);
const gchar *
gst_vaapi_display_get_display_name (GstVaapiDisplay * display);
VADisplay
gst_vaapi_display_get_display (GstVaapiDisplay * display);

View file

@ -144,6 +144,7 @@ struct _GstVaapiDisplayPrivate
GstVaapiDisplayCache *cache;
GRecMutex mutex;
GstVaapiDisplayType display_type;
gchar *display_name;
VADisplay display;
guint width;
guint height;