From: Gwenole Beauchesne Date: Fri, 25 Jul 2014 09:24:39 +0000 (+0200) Subject: display: add interface to retrieve the display name. X-Git-Tag: 0.5.9~19 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fgstreamer-vaapi.git;a=commitdiff_plain;h=7c2c4c7a971680309c0b479b496a2e210e7149fd 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. --- diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 64f0245..a3b8a8d 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -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; } @@ -1289,6 +1295,22 @@ gst_vaapi_display_get_display_type (GstVaapiDisplay * display) } /** + * 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 * diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.h b/gst-libs/gst/vaapi/gstvaapidisplay.h index 182350e..e7e1935 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay.h @@ -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); diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h index 747387a..b1e1160 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h @@ -144,6 +144,7 @@ struct _GstVaapiDisplayPrivate GstVaapiDisplayCache *cache; GRecMutex mutex; GstVaapiDisplayType display_type; + gchar *display_name; VADisplay display; guint width; guint height;