display: add interface to retrieve the display name.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 25 Jul 2014 09:24:39 +0000 (11:24 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 25 Jul 2014 15:35:56 +0000 (17:35 +0200)
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.

gst-libs/gst/vaapi/gstvaapidisplay.c
gst-libs/gst/vaapi/gstvaapidisplay.h
gst-libs/gst/vaapi/gstvaapidisplay_priv.h

index 64f0245..a3b8a8d 100644 (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;
 }
 
@@ -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
  *
index 182350e..e7e1935 100644 (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);
 
index 747387a..b1e1160 100644 (file)
@@ -144,6 +144,7 @@ struct _GstVaapiDisplayPrivate
   GstVaapiDisplayCache *cache;
   GRecMutex mutex;
   GstVaapiDisplayType display_type;
+  gchar *display_name;
   VADisplay display;
   guint width;
   guint height;