summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-08-28 16:24:15 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-08-28 16:24:15 +0200
commitfe4ad408dce29cfbbec20d9871b8f71cced1d5c3 (patch)
treeb293be5ce6d30425fe5bf83bebf2fcad3a69271a /gst-libs/gst/vaapi
parent1069ce433fa37bdc80e284c21010b48e4122f6f9 (diff)
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.
Diffstat (limited to 'gst-libs/gst/vaapi')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay.c70
1 files changed, 34 insertions, 36 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c
index 6ef4ae9b..ae52b867 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay.c
+++ b/gst-libs/gst/vaapi/gstvaapidisplay.c
@@ -61,11 +61,15 @@ enum {
PROP_DISPLAY,
PROP_DISPLAY_TYPE,
PROP_WIDTH,
- PROP_HEIGHT
+ PROP_HEIGHT,
+
+ N_PROPERTIES
};
static GstVaapiDisplayCache *g_display_cache = NULL;
+static GParamSpec *g_properties[N_PROPERTIES] = { NULL, };
+
static inline GstVaapiDisplayCache *
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->unlock = gst_vaapi_display_unlock_default;
- g_object_class_install_property
- (object_class,
- PROP_DISPLAY,
- g_param_spec_pointer("display",
- "VA display",
- "VA display",
- G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
-
- g_object_class_install_property
- (object_class,
- PROP_DISPLAY_TYPE,
- g_param_spec_enum("display-type",
- "VA display type",
- "VA display type",
- GST_VAAPI_TYPE_DISPLAY_TYPE,
- GST_VAAPI_DISPLAY_TYPE_ANY,
- G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
-
- g_object_class_install_property
- (object_class,
- PROP_WIDTH,
- g_param_spec_uint("width",
- "Width",
- "The display width",
- 1, G_MAXUINT32, 1,
- G_PARAM_READABLE));
-
- g_object_class_install_property
- (object_class,
- PROP_HEIGHT,
- g_param_spec_uint("height",
- "height",
- "The display height",
- 1, G_MAXUINT32, 1,
- G_PARAM_READABLE));
+ g_properties[PROP_DISPLAY] =
+ g_param_spec_pointer("display",
+ "VA display",
+ "VA display",
+ G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
+
+ g_properties[PROP_DISPLAY_TYPE] =
+ g_param_spec_enum("display-type",
+ "VA display type",
+ "VA display type",
+ GST_VAAPI_TYPE_DISPLAY_TYPE,
+ GST_VAAPI_DISPLAY_TYPE_ANY,
+ G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
+
+ g_properties[PROP_WIDTH] =
+ g_param_spec_uint("width",
+ "Width",
+ "The display width",
+ 1, G_MAXUINT32, 1,
+ G_PARAM_READABLE);
+
+ g_properties[PROP_HEIGHT] =
+ g_param_spec_uint("height",
+ "height",
+ "The display height",
+ 1, G_MAXUINT32, 1,
+ G_PARAM_READABLE);
+
+ g_object_class_install_properties(object_class, N_PROPERTIES, g_properties);
}
static void