summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-08-28 14:05:16 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-08-28 16:31:58 +0200
commit4dad571526fa1bfdc39f2f91dadca81ffae94e02 (patch)
treec09f94e28e34899be51d6da117cf8ccdf9de22f8
parent112e2b1fe7ed90dd4b7cf24e20c345ccfb97698e (diff)
display: initialize default attribute values.
Ensure the display attribute is actually supported by trying to retrieve its current value during GstVaapiDisplay creation.
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c
index d2fa187..5ae39d7 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay.c
+++ b/gst-libs/gst/vaapi/gstvaapidisplay.c
@@ -50,6 +50,7 @@ typedef struct _GstVaapiProperty GstVaapiProperty;
struct _GstVaapiProperty {
const gchar *name;
VADisplayAttribute attribute;
+ gint old_value;
};
#define DEFAULT_RENDER_MODE GST_VAAPI_RENDER_MODE_TEXTURE
@@ -72,6 +73,12 @@ static GstVaapiDisplayCache *g_display_cache = NULL;
static GParamSpec *g_properties[N_PROPERTIES] = { NULL, };
+static gboolean
+get_attribute(GstVaapiDisplay *display, VADisplayAttribType type, gint *value);
+
+static gboolean
+set_attribute(GstVaapiDisplay *display, VADisplayAttribType type, gint value);
+
static inline GstVaapiDisplayCache *
get_display_cache(void)
{
@@ -607,8 +614,12 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
}
if (!prop.name)
continue;
+
+ /* Assume the attribute is really supported if we can get the
+ * actual and current value */
prop.attribute = *attr;
- g_array_append_val(priv->properties, prop);
+ if (get_attribute(display, attr->type, &prop.old_value))
+ g_array_append_val(priv->properties, prop);
}
/* VA image formats */