mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
display: install properties in batch.
Use g_object_class_install_properties() to install GstVaapiDisplay properties. It is useful to maintain properties as GParamSpec so that to be able to raise "notify" signals by id instead of by name in the future.
This commit is contained in:
parent
1069ce433f
commit
fe4ad408dc
1 changed files with 31 additions and 33 deletions
|
@ -61,11 +61,15 @@ enum {
|
||||||
PROP_DISPLAY,
|
PROP_DISPLAY,
|
||||||
PROP_DISPLAY_TYPE,
|
PROP_DISPLAY_TYPE,
|
||||||
PROP_WIDTH,
|
PROP_WIDTH,
|
||||||
PROP_HEIGHT
|
PROP_HEIGHT,
|
||||||
|
|
||||||
|
N_PROPERTIES
|
||||||
};
|
};
|
||||||
|
|
||||||
static GstVaapiDisplayCache *g_display_cache = NULL;
|
static GstVaapiDisplayCache *g_display_cache = NULL;
|
||||||
|
|
||||||
|
static GParamSpec *g_properties[N_PROPERTIES] = { NULL, };
|
||||||
|
|
||||||
static inline GstVaapiDisplayCache *
|
static inline GstVaapiDisplayCache *
|
||||||
get_display_cache(void)
|
get_display_cache(void)
|
||||||
{
|
{
|
||||||
|
@ -777,41 +781,35 @@ gst_vaapi_display_class_init(GstVaapiDisplayClass *klass)
|
||||||
dpy_class->lock = gst_vaapi_display_lock_default;
|
dpy_class->lock = gst_vaapi_display_lock_default;
|
||||||
dpy_class->unlock = gst_vaapi_display_unlock_default;
|
dpy_class->unlock = gst_vaapi_display_unlock_default;
|
||||||
|
|
||||||
g_object_class_install_property
|
g_properties[PROP_DISPLAY] =
|
||||||
(object_class,
|
g_param_spec_pointer("display",
|
||||||
PROP_DISPLAY,
|
"VA display",
|
||||||
g_param_spec_pointer("display",
|
"VA display",
|
||||||
"VA display",
|
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
|
||||||
"VA display",
|
|
||||||
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
|
|
||||||
|
|
||||||
g_object_class_install_property
|
g_properties[PROP_DISPLAY_TYPE] =
|
||||||
(object_class,
|
g_param_spec_enum("display-type",
|
||||||
PROP_DISPLAY_TYPE,
|
"VA display type",
|
||||||
g_param_spec_enum("display-type",
|
"VA display type",
|
||||||
"VA display type",
|
GST_VAAPI_TYPE_DISPLAY_TYPE,
|
||||||
"VA display type",
|
GST_VAAPI_DISPLAY_TYPE_ANY,
|
||||||
GST_VAAPI_TYPE_DISPLAY_TYPE,
|
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
|
||||||
GST_VAAPI_DISPLAY_TYPE_ANY,
|
|
||||||
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
|
|
||||||
|
|
||||||
g_object_class_install_property
|
g_properties[PROP_WIDTH] =
|
||||||
(object_class,
|
g_param_spec_uint("width",
|
||||||
PROP_WIDTH,
|
"Width",
|
||||||
g_param_spec_uint("width",
|
"The display width",
|
||||||
"Width",
|
1, G_MAXUINT32, 1,
|
||||||
"The display width",
|
G_PARAM_READABLE);
|
||||||
1, G_MAXUINT32, 1,
|
|
||||||
G_PARAM_READABLE));
|
|
||||||
|
|
||||||
g_object_class_install_property
|
g_properties[PROP_HEIGHT] =
|
||||||
(object_class,
|
g_param_spec_uint("height",
|
||||||
PROP_HEIGHT,
|
"height",
|
||||||
g_param_spec_uint("height",
|
"The display height",
|
||||||
"height",
|
1, G_MAXUINT32, 1,
|
||||||
"The display height",
|
G_PARAM_READABLE);
|
||||||
1, G_MAXUINT32, 1,
|
|
||||||
G_PARAM_READABLE));
|
g_object_class_install_properties(object_class, N_PROPERTIES, g_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue