X11 window resizing problem with nveglglessink plugin

Hi,
I have a problem with nveglglessink plugin (R21.5 release).

It seems that the plugin doesn’t correctly resize the image when I resize the X11 window and the stream is in “pause”. Note that the xvimagesink and glimagesink plugins work correctly, the resizing is always ok.

To simulate this, you can use those commands:

gst-launch-1.0 tcpserversrc host=0.0.0.0 port=8000 ! gdpdepay ! nveglglessink async=0 sync=0 & → command a)

gst-launch-1.0 videotestsrc ! video/x-raw,width=1920,height=1080 ! gdppay ! tcpclientsink host=127.0.0.1 port=8000 & → command b)

kill -STOP 15222 → 15222 is the b) command process pid

wmctrl -i -r 0x01000001 -e 0,0,0,960,1080 → 0x01000001 is the process a) X11 window id

→ the image doesn’t resize, it is simply cutted in the 960x1080 window

kill -CONT 15222 → 15222 is the b) command process pid

→ the image is now correctly resized to the 960x1080 window

If I repeat the same commands replacing nveglglessink with xvimagesink or glimagesink the resizing is ok also when the b) process is stopped.

Can you help me?

Thank you, best regards.

Ivan

Hi,
I think I have found a solution. I modifed “gstegl_src” in this way:

--- gstegl_src/gst-egl/ext/eglgles/gsteglglessink.c	2016-06-08 06:17:32.000000000 +0200
+++ gstegl_src_mod/gst-egl/ext/eglgles/gsteglglessink.c	2018-09-14 16:55:53.816358388 +0200
@@ -518,6 +518,7 @@
   }
 
   eglglessink->egl_started = TRUE;
+  eglglessink->stream_started = FALSE;
 
   eglglessink->glEGLImageTargetTexture2DOES =
       (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)
@@ -611,6 +612,7 @@
     } else if (!object) {
       if (eglglessink->configured_caps) {
         last_flow = gst_eglglessink_render (eglglessink);
+        eglglessink->stream_started = TRUE;
       } else {
         last_flow = GST_FLOW_OK;
         GST_DEBUG_OBJECT (eglglessink,
@@ -793,6 +795,11 @@
                 ("Output window was closed"), (NULL));
             return NULL;
           }
+        case ConfigureNotify:
+          /* Render from last seen buffer if queue is empty */
+          if (eglglessink->stream_started && gst_data_queue_is_empty(eglglessink->queue)) {
+            gst_eglglessink_queue_object (eglglessink, NULL);
+          }
       }
     }
     g_usleep (G_USEC_PER_SEC / 20);
diff -u -r gstegl_src/gst-egl/ext/eglgles/gsteglglessink.h gstegl_src_mod/gst-egl/ext/eglgles/gsteglglessink.h
--- gstegl_src/gst-egl/ext/eglgles/gsteglglessink.h	2016-06-08 06:17:32.000000000 +0200
+++ gstegl_src_mod/gst-egl/ext/eglgles/gsteglglessink.h	2018-09-14 12:47:38.276346696 +0200
@@ -97,6 +97,7 @@
   gboolean using_own_window;
   gboolean egl_started;
   gboolean is_reconfiguring;
+  gboolean stream_started;
 
   gpointer own_window_data;
 
diff -u -r gstegl_src/gst-egl/ext/eglgles/video_platform_wrapper.c gstegl_src_mod/gst-egl/ext/eglgles/video_platform_wrapper.c
--- gstegl_src/gst-egl/ext/eglgles/video_platform_wrapper.c	2016-06-08 06:17:32.000000000 +0200
+++ gstegl_src_mod/gst-egl/ext/eglgles/video_platform_wrapper.c	2018-09-14 16:46:58.904029539 +0200
@@ -99,6 +99,7 @@
     app_name = "eglglessink";
   XStoreName (d, w, app_name);
 
+  XSelectInput (d, w, StructureNotifyMask);
   XMapWindow (d, w);
 
   Atom wmDeleteMessage = XInternAtom (d, "WM_DELETE_WINDOW", False);

Now the image is correctly resized also when the stream is in “pause”.

Do you think this solution is ok?

Thank you, best regards.

Ivan

Hi IvanGolob,
We have gstegl_src open source and you can make your own implementation. Thanks for sharing solution.