After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789384 - glimagesink windows on wayland are created with a fixed window size of 320x240
glimagesink windows on wayland are created with a fixed window size of 320x240
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.12.3
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 796882 797026 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-10-24 07:21 UTC by memeka
Modified: 2018-10-23 07:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix for glimagesink wayland window size (3.38 KB, patch)
2017-10-24 07:22 UTC, memeka
needs-work Details | Review
v2-glimagesink-wayland-add-preffered-window-size (3.36 KB, patch)
2017-10-24 22:54 UTC, memeka
rejected Details | Review
v3-glimagesink-wayland-add-preffered-window-size (3.51 KB, patch)
2017-10-24 23:01 UTC, memeka
none Details | Review
v3-glimagesink-wayland-add-preferred-window-size (3.51 KB, patch)
2017-10-24 23:01 UTC, memeka
committed Details | Review

Description memeka 2017-10-24 07:21:11 UTC
glimagesink windows on wayland are created with a fixed window size of 320x240
Comment 1 memeka 2017-10-24 07:22:59 UTC
Created attachment 362145 [details] [review]
fix for glimagesink wayland window size
Comment 2 Matthew Waters (ystreet00) 2017-10-24 21:13:22 UTC
Review of attachment 362145 [details] [review]:

This would break the set_render_rectangle() use case.

The order for chosen sizes is:
1. set_render_rectangle()
2. preferred size
3. some default fallback

This patch essentially removes 1) from ever happening.

::: gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
@@ +306,3 @@
 
+  if (window_egl->window.preffered_width > 0)
+    width = window_egl->window.preffered_width;

s/preffered/preferred/

@@ -304,3 @@
 
-  if (window_egl->window.window_width > 0)
-    width = window_egl->window.window_width;

This cannot just be removed as it's also used for the set_render_rectangle() case.

@@ +312,3 @@
 
+  if (window_egl->window.preffered_height > 0)
+    height = window_egl->window.preffered_height;

s/preffered/preferred/

@@ +582,3 @@
+  window_egl->window.preffered_height = height;
+  if (window_egl->window.window_height != height || window_egl->window.window_width != width) {
+    window_resize (window_egl, width, height);

Is this call really necessary?  This would also prefer the preferred size rather than a possible set_render_rectangle() size which is not correct.
Comment 3 memeka 2017-10-24 21:52:50 UTC
I'm not sure what is the intended order of events, but this is what happens in reality:

* create_subsurfaces is called before window_width and window_height are set
* create_subsurfaces is called before preferred_height and preferred_width are set from my patch
* window of size 320x240 (defaults) is created
* caps are set, video continues to play in 320x240 window

This is what happens with my patch:

* like above, create_subsurfaces is created with 320x240 default window
* create_subsurfaces sets window_height and window_width to default values
* set_preferred_size is called (from caps?), preferred values are set
* window_height and window_width are checked against preferred vales, then window is resized

> +  if (window_egl->window.window_height != height || window_egl->window.window_width != width) {
> +    window_resize (window_egl, width, height);
> Is this call really necessary?  This would also prefer the preferred size rather than a possible set_render_rectangle() size which is not correct.

so yes, window_resize is really necessary, or else window is again stuck at 320x240 for all videos.

> -  if (window_egl->window.window_width > 0)
> -    width = window_egl->window.window_width;
> This cannot just be removed as it's also used for the set_render_rectangle() case.

Not sure when set_render_rectangle is or should be called, but like i said, window_width and window_height are set by create_subsurfaces to the default values. afterwards, I could detect no resize event, and values remain set the these defaults.
I could check first if window_width && window_height are > 0, if so set width/height to these values; if not then check for preferred values to set, and lastly set default values. Would that be more convenient?
Comment 4 memeka 2017-10-24 22:54:39 UTC
Created attachment 362226 [details] [review]
v2-glimagesink-wayland-add-preffered-window-size
Comment 5 memeka 2017-10-24 22:59:39 UTC
sorry I uploaded the old patch by mistake, uploading the new one now.
Comment 6 memeka 2017-10-24 23:00:37 UTC
Review of attachment 362226 [details] [review]:

old patch uploaded by mistake
Comment 7 memeka 2017-10-24 23:01:34 UTC
Created attachment 362227 [details] [review]
v3-glimagesink-wayland-add-preffered-window-size
Comment 8 memeka 2017-10-24 23:01:46 UTC
Created attachment 362228 [details] [review]
v3-glimagesink-wayland-add-preferred-window-size
Comment 9 Matthew Waters (ystreet00) 2018-07-27 10:03:09 UTC
*** Bug 796882 has been marked as a duplicate of this bug. ***
Comment 10 Matthew Waters (ystreet00) 2018-08-28 03:52:57 UTC
*** Bug 797026 has been marked as a duplicate of this bug. ***
Comment 11 Matthew Waters (ystreet00) 2018-08-28 04:33:28 UTC
commit 090bbd07219a62c0146d9654fd6a3159f1049426
Author: Matthew Waters <matthew@centricular.com>
Date:   Tue Aug 28 14:31:43 2018 +1000

    gl/wayland: correctly use the set_render_rectangle size first
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789384

commit 08ebb8264debb3b03d31a3a66ad61c0ac3e23812
Author: memeka <mihailescu2m@gmail.com>
Date:   Tue Oct 24 17:39:50 2017 +1030

    gl/wayland: add preferred window size, and set it according to video size
    
    The glimagesink wayland backend lacks the implementation of
    gst_gl_window_wayland_egl_set_preferred_size. Because of this, glimagesink windows on
    wayland are created with a fixed window size of 320x240.
    
    [Matthew Waters]: gst-indent sources
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789384
Comment 12 long1.wang 2018-09-25 05:33:49 UTC
Hi, Maintainer,

Could you push this patch into one tag? It should be something like 1.14.3 etc. Because from Clear Linux integration point of view, need merge it from a fixed version by tag.
Comment 13 Matthew Waters (ystreet00) 2018-09-25 05:52:03 UTC
This will become a part of the future 1.16 release.  You are welcome to backport the patch in your distribution if you need it.
Comment 14 long1.wang 2018-10-23 05:44:04 UTC
(In reply to Matthew Waters (ystreet00) from comment #13)
> This will become a part of the future 1.16 release.  You are welcome to
> backport the patch in your distribution if you need it.

In Clear Linux way, it's heavily depends on upstream's tag release. Because just by a tag release, there will be an URL of tarball. Then it can be fetched into Clear Linux spec file to integrate.

So question is when this future 1.16 is released?
Comment 15 Sebastian Dröge (slomo) 2018-10-23 07:21:52 UTC
(In reply to long1.wang from comment #14)
> (In reply to Matthew Waters (ystreet00) from comment #13)
> > This will become a part of the future 1.16 release.  You are welcome to
> > backport the patch in your distribution if you need it.
> 
> In Clear Linux way, it's heavily depends on upstream's tag release. Because
> just by a tag release, there will be an URL of tarball. Then it can be
> fetched into Clear Linux spec file to integrate.

The tarball is not a proper release tarball though, it is going to be missing files and compiling from that is not supported.

I'd recommend backporting this patch for the time being if you don't want to wait for 1.16.