mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
display: initialize default attribute values.
Ensure the display attribute is actually supported by trying to retrieve its current value during GstVaapiDisplay creation.
This commit is contained in:
parent
112e2b1fe7
commit
4dad571526
1 changed files with 12 additions and 1 deletions
|
@ -50,6 +50,7 @@ typedef struct _GstVaapiProperty GstVaapiProperty;
|
||||||
struct _GstVaapiProperty {
|
struct _GstVaapiProperty {
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
VADisplayAttribute attribute;
|
VADisplayAttribute attribute;
|
||||||
|
gint old_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEFAULT_RENDER_MODE GST_VAAPI_RENDER_MODE_TEXTURE
|
#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 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 *
|
static inline GstVaapiDisplayCache *
|
||||||
get_display_cache(void)
|
get_display_cache(void)
|
||||||
{
|
{
|
||||||
|
@ -607,8 +614,12 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
|
||||||
}
|
}
|
||||||
if (!prop.name)
|
if (!prop.name)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Assume the attribute is really supported if we can get the
|
||||||
|
* actual and current value */
|
||||||
prop.attribute = *attr;
|
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 */
|
/* VA image formats */
|
||||||
|
|
Loading…
Reference in a new issue