summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-09-22 18:59:49 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-09-22 20:06:42 +0200
commitb23ccc69b035dc4d79b7411570debfe538928745 (patch)
tree3e6335ef9667158a2930b0761aef99bd22ba0d71 /gst-libs
parent6b35e00a287bccc2ebc036028e0e6a1b360a5063 (diff)
libs: display: initialize value if they are not yet
This is a difference between the GObject API and the GstVaapi one: the GValue passed to get a property value, in GObject has to be initialized with g_value_init(), but in GstVaapi is has not. In order to overcome this mismatch, this patch call g_value_init() internally only in the passed one is not already initialized. https://bugzilla.gnome.org/show_bug.cgi?id=788058
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c
index de31e017..1d34434a 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay.c
+++ b/gst-libs/gst/vaapi/gstvaapidisplay.c
@@ -1002,14 +1002,16 @@ _get_property (GstVaapiDisplay * display, const GstVaapiProperty * prop,
GstVaapiRenderMode mode;
if (!gst_vaapi_display_get_render_mode (display, &mode))
return FALSE;
- g_value_init (value, GST_VAAPI_TYPE_RENDER_MODE);
+ if (!G_IS_VALUE (value))
+ g_value_init (value, GST_VAAPI_TYPE_RENDER_MODE);
g_value_set_enum (value, mode);
break;
}
case VADisplayAttribRotation:{
GstVaapiRotation rotation;
rotation = gst_vaapi_display_get_rotation (display);
- g_value_init (value, GST_VAAPI_TYPE_ROTATION);
+ if (!G_IS_VALUE (value))
+ g_value_init (value, GST_VAAPI_TYPE_ROTATION);
g_value_set_enum (value, rotation);
break;
}
@@ -1020,7 +1022,8 @@ _get_property (GstVaapiDisplay * display, const GstVaapiProperty * prop,
gfloat val;
if (!get_color_balance (display, find_property_id (prop->name), &val))
return FALSE;
- g_value_init (value, G_TYPE_FLOAT);
+ if (!G_IS_VALUE (value))
+ g_value_init (value, G_TYPE_FLOAT);
g_value_set_float (value, val);
break;
}