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 736734 - vaapisink: wayland: add support for wl_viewporter extension
vaapisink: wayland: add support for wl_viewporter extension
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 748634 758397
 
 
Reported: 2014-09-16 09:54 UTC by Gwenole Beauchesne
Modified: 2018-11-03 15:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Build scaler protocol extension source files (12.71 KB, patch)
2014-10-06 13:28 UTC, sreerenj
none Details | Review
wayland: Use wl_scaler extension for surface scaling and cropping (7.37 KB, patch)
2014-10-06 13:28 UTC, sreerenj
needs-work Details | Review
wayland: Build scaler protocol extension source files (13.08 KB, patch)
2014-11-27 12:03 UTC, sreerenj
none Details | Review

Description Gwenole Beauchesne 2014-09-16 09:54:08 UTC
The wl_scaler extension is to be useful for presenting VA surfaces with additional scaling, and possibly cropping information, thus avoiding an ad-hoc VPP pipeline.

It should be worth trying this out. Though, we would still be missing basic support for bob-deinterlacing.
Comment 1 sreerenj 2014-10-01 13:10:45 UTC
This feature requires wayland version >= 1.4.0 . I wonder whether we need to support the older versions (more #if checks in source code!!) or just raise the required version to 1.4.0 ???

I prefer to raise the dependency to 1.4.0.
Comment 2 sreerenj 2014-10-06 13:28:20 UTC
Created attachment 287850 [details] [review]
wayland: Build scaler protocol extension source files
Comment 3 sreerenj 2014-10-06 13:28:41 UTC
Created attachment 287851 [details] [review]
wayland: Use wl_scaler extension for surface scaling and cropping
Comment 4 sreerenj 2014-10-06 13:35:01 UTC
If anyone wants to test, some sample code is here: https://github.com/sreerenjb/playground/blob/master/gst-wayland.c
Comment 5 Gwenole Beauchesne 2014-11-27 06:26:23 UTC
Review of attachment 287850 [details] [review]:

The scaler.xml file should be moved to some ext/wayland/protocol directory. Then the Makefile.am could be updated to point to $(top_srcdir)/ext/wayland/protocol/scaler.xml or probably make the prefix some wayland_protocol_root = $(top_srcdir)/...

Besides, there might be some extra arrangements to be made for make dist in all situations where wayland is available or not, but those could be fixed at a later time.
Comment 6 Gwenole Beauchesne 2014-11-27 06:37:15 UTC
Review of attachment 287851 [details] [review]:

::: gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
@@ +459,3 @@
+      GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window);
+    }
+

need_vpp = TRUE is still needed if dst_rect->x != 0 || dst_rect->y != 0, even if the wl_scaler extension is available.

I suggest you do the other way around, i.e. keep the original block to check for need_vpp, and reset that to FALSE only if wayland_check_version(1,4,0) && (no_cropping_needed || wl_scaler >= 2);

@@ +526,3 @@
   /* XXX: attach to the specified target rectangle */
   GST_VAAPI_OBJECT_LOCK_DISPLAY (window);
+  wl_surface_attach (priv->surface, buffer, dst_rect->x, dst_rect->y);

My understanding is that (x,y) is relative to the previous buffer position. This means that if we originally have no source buffer and crop is (2,2), the new buffer would be put at (2,2). OK. However, if we further need to update the buffer with a new crop (2,2), that'd be relative to the current/previous, which is (2,2), thus making it (4,4). Isn't it?
Comment 7 sreerenj 2014-11-27 11:56:45 UTC
(In reply to comment #6)
> Review of attachment 287851 [details] [review]:
> 
> ::: gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
> @@ +459,3 @@
> +      GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window);
> +    }
> +
> 
> need_vpp = TRUE is still needed if dst_rect->x != 0 || dst_rect->y != 0, even
> if the wl_scaler extension is available.

Why?
see the following comment...

> I suggest you do the other way around, i.e. keep the original block to check
> for need_vpp, and reset that to FALSE only if wayland_check_version(1,4,0) &&
> (no_cropping_needed || wl_scaler >= 2);
> 
> @@ +526,3 @@
>    /* XXX: attach to the specified target rectangle */
>    GST_VAAPI_OBJECT_LOCK_DISPLAY (window);
> +  wl_surface_attach (priv->surface, buffer, dst_rect->x, dst_rect->y);
> 
> My understanding is that (x,y) is relative to the previous buffer position.
> This means that if we originally have no source buffer and crop is (2,2), the
> new buffer would be put at (2,2). OK. However, if we further need to update the
> buffer with a new crop (2,2), that'd be relative to the current/previous, which
> is (2,2), thus making it (4,4). Isn't it?


This is what scaler protocol for setting the destination rectangle is saying
"Arguments x and y do not exist here, use the x and y arguments to
        wl_surface.attach. The x, y, width, and height define the
        surface-local coordinate system irrespective of the attached
        wl_buffer size."
Comment 8 sreerenj 2014-11-27 12:03:55 UTC
Created attachment 291634 [details] [review]
wayland: Build scaler protocol extension source files
Comment 9 sreerenj 2015-01-26 05:08:07 UTC
I will be pushing this unless there is no further comments?..
Comment 10 sreerenj 2015-01-27 14:12:48 UTC
Moving to next release...
Comment 11 Olivier Crête 2015-04-29 13:25:45 UTC
I understand the vpp has a higher performance scaler than just using opengl, could that be done compositor-side, has anyone tried to implement that into weston?
Comment 12 sreerenj 2016-03-24 16:55:07 UTC
Moving to Product:GStreamer, Component:gstreamer-vaapi
Comment 13 Víctor Manuel Jáquez Leal 2016-06-16 11:46:57 UTC
Comment on attachment 287851 [details] [review]
wayland: Use wl_scaler extension for surface scaling and cropping

The scaler protocol from weston got moved to wayland-protcols and renamed to viewporter.
Comment 14 GStreamer system administrator 2018-11-03 15:45:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/23.