Render Gstreamer video on Wayland subsurface.

Kishan Dudhatra kishan.dudhatra at sisignals.com
Wed Jun 8 07:23:08 UTC 2022


Hi,

Thank you for the replay , however I was trying the same approach using gst-overlay.

I've attached the code for reference, executing this does not give favorable response (actual result attached in the image below).

Can you advice on the missing part ?
    static GstBusSyncReply
    bus_sync_handler (GstBus * bus, GstMessage * message, gpointer user_data)
    {
      DemoApp *app = user_data;

      if (gst_is_wayland_display_handle_need_context_message (message)) {
        app->context = gst_wayland_display_handle_context_new (app->display);
        gst_element_set_context (GST_ELEMENT (GST_MESSAGE_SRC (message)),
            app->context);

        goto drop;
      } else if (gst_is_wayland_display_handle_need_context_message (message)) {
        gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC
                (message)), (guintptr) subsurface1);
        gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC
                (message)), 0, 0, 200, 200);
        wl_surface_commit (subsurface1);
        printf ("commiting surface from bus sync\n");
        goto drop;
      }
      return GST_BUS_PASS;



Appreciate if any (offline?) hacks are also available. Any links ?

Thanks, in advance.

We currently have main surface (black), subsurface (silver), and gstreamer Video.

The main surface is rendered in a random location, the subsurface is rendered in a fixed location relative to the main surface, and the Gstreamer Video rendered out of the main surface.

[cid:bcd4fe83-eb86-434c-a17b-0267f983de60]
________________________________
From: Nicolas Dufresne <nicolas at ndufresne.ca>
Sent: Wednesday, June 8, 2022 5:13 AM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Cc: gstreamer-embedded at lists.freedesktop.org <gstreamer-embedded at lists.freedesktop.org>; Kishan Dudhatra <kishan.dudhatra at sisignals.com>
Subject: Re: Render Gstreamer video on Wayland subsurface.



Le mar. 7 juin 2022, 06 h 30, Kishan Dudhatra via gstreamer-devel <gstreamer-devel at lists.freedesktop.org<mailto:gstreamer-devel at lists.freedesktop.org>> a écrit :

hello;


issue posted : gst-plugins-bad<https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1722>


I want to render GStreamer video on Wayland subsurface and using waylandsink.


Currently i have created 1.main surface 2.Subsurface as shown in attached image.


I want to render the GStreamer video on subsurface.

As subsurface have no framebuffer or size, this is pretty inconvenient way. I would rather suggest to use the existing mechanism. through the sync message handler reply to the message the query a window handle. Pass your top level surface handle, and position that using gst_video_overlay_set_render_rectangle().



I checked the Waylandsink source and discovered that it creates the surface itself and renders video on that surface. So, what I'm trying to figure out is how to render video on my own applications subsurface.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220608/592b8c83/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MicrosoftTeams-image.png
Type: image/png
Size: 144160 bytes
Desc: MicrosoftTeams-image.png
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220608/592b8c83/attachment-0001.png>


More information about the gstreamer-devel mailing list