summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2018-04-27 18:35:30 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2018-06-06 17:39:15 +0200
commit55a14e39e17f415f1e2b3ef68cf18089fe6fa77b (patch)
treed2fdfbe6d99a5520ab5c5921567ad0d8bd06fdda
parentfa54262a9a06b7a1c739d0d47c174e8024497bc8 (diff)
libs: display: egl: initialize params structure
Statically initialise the internal params structure.
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay_egl.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_egl.c b/gst-libs/gst/vaapi/gstvaapidisplay_egl.c
index 47fb6936..3bb84720 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay_egl.c
+++ b/gst-libs/gst/vaapi/gstvaapidisplay_egl.c
@@ -362,16 +362,14 @@ gst_vaapi_display_egl_class_init (GstVaapiDisplayEGLClass * klass)
GstVaapiDisplay *
gst_vaapi_display_egl_new (GstVaapiDisplay * display, guint gles_version)
{
- InitParams params;
+ InitParams params = {
+ .gles_version = gles_version,
+ };
if (display) {
params.display = gst_object_ref (display);
params.display_type = GST_VAAPI_DISPLAY_VADISPLAY_TYPE (display);
- } else {
- params.display = NULL;
- params.display_type = GST_VAAPI_DISPLAY_TYPE_ANY;
}
- params.gles_version = gles_version;
return gst_vaapi_display_new (g_object_new (GST_TYPE_VAAPI_DISPLAY_EGL, NULL),
GST_VAAPI_DISPLAY_INIT_FROM_NATIVE_DISPLAY, &params);
}
@@ -396,13 +394,14 @@ GstVaapiDisplay *
gst_vaapi_display_egl_new_with_native_display (gpointer native_display,
GstVaapiDisplayType display_type, guint gles_version)
{
- InitParams params = { NULL, };
+ InitParams params = {
+ .display_type = display_type,
+ .gl_display = native_display,
+ .gles_version = gles_version,
+ };
g_return_val_if_fail (native_display != NULL, NULL);
- params.display_type = display_type;
- params.gles_version = gles_version;
- params.gl_display = native_display;
return gst_vaapi_display_new (g_object_new (GST_TYPE_VAAPI_DISPLAY_EGL, NULL),
GST_VAAPI_DISPLAY_INIT_FROM_NATIVE_DISPLAY, &params);
}