[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-devel
Subject:    Re: Wayland gtk windowing (glimagesink)
From:       Max Weng via gstreamer-devel <gstreamer-devel () lists ! freedesktop ! org>
Date:       2024-04-29 3:28:11
Message-ID: CACWdWrYmYw_qbzfb-0vqHL=nxS2Y+hi6unPaXA7ApDzu01YC0Q () mail ! gmail ! com
[Download RAW message or body]

I understand your situation better now. :) I've noticed that the video
indeed appears in a separate window with other sinks as well. It seems that
in my experience, only waylandsink consistently integrates directly into
the GTK window without issues.

On Mon, 29 Apr 2024 at 10:51, Gregoire Gentil <gregoire@gentil.com> wrote:

> I could have been more precise: the glimageslink pipeline does work and
> the video appears in a separated window if I don't link it to the window
> with the code mentioned below. What I want to do is to insert the video
> inside the gtk window.
>
> Also glimagesink has the unique advantage to work on both wayland and
> non-wayland systems,
>
> Grégoire
>
>
>
>
> On 4/28/24 19:12, Max Weng wrote:
> > try use waylandsink?
> >
> > this work for me "rtspsrc name=rtspsrc location={url} protocols=tcp
> > latency=10 max-rtcp-rtp-time-diff=10 ! errorignore ! rtph265depay
> > name=depay ! h265parse ! avdec_h265 name=avdec ! videoconvert !
> > video/x-raw, format=RGBA ! waylandsink name=sink"
> >
> > On Mon, 29 Apr 2024 at 06:18, Gregoire Gentil via gstreamer-devel
> > <gstreamer-devel@lists.freedesktop.org
> > <mailto:gstreamer-devel@lists.freedesktop.org>> wrote:
> >
> >     Hello,
> >
> >     I had an application with a gtk+-3.0 window and a pipeline "... !
> >     imagesink". The video is rendered inside the gtk window.
> >
> >     I was doing:
> >     static void realize_cb(GtkWidget *widget, CustomData *data) {
> >     GdkWindow *window = gtk_widget_get_window(widget);
> >     data->window_handle = GDK_WINDOW_XID(window);
> >
> >     and then:
> >
> >     static GstBusSyncReply bus_sync_handler(GstBus * bus, GstMessage *
> >     message, CustomData *data) {
> >
>  gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(data->video_sink),
> >     data->window_handle);
> >
> >     Everything was working fine. I want now to support wayland system.
> >
> >     Pipeline becomes: "... ! glimagesink".
> >
> >     in the realize_cb function, I have now:
> >     GdkWindow *window = gtk_widget_get_window(widget);
> >     data->window_handle =
> >     (guintptr)gdk_wayland_window_get_wl_surface(window);
> >
> >
> >     At run-time, I'm getting hundreds of:
> >     "GStreamer-GL-CRITICAL **: 14:06:48.263: Failed to flush Wayland
> >     connection"
> >
> >     What am I doing wrong? Many thanks in advance for any hint,
> >
> >     Grégoire
> >
>

[Attachment #3 (text/html)]

<div dir="ltr"><span \
style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,&quot;Segoe \
UI&quot;,Roboto,Ubuntu,Cantarell,&quot;Noto Sans&quot;,sans-serif,&quot;Helvetica \
Neue&quot;,Arial,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe \
UI Symbol&quot;,&quot;Noto Color Emoji&quot;">I understand your situation better now. \
:) I&#39;ve noticed that the video indeed appears in a separate window with other \
sinks as well.  It seems that in my experience, only </span><code style="border:0px \
solid rgb(227,227,227);box-sizing:border-box;font-feature-settings:normal;color:rgb(13,13,13);font-weight:600;font-family:&quot;S\0000f6hne \
Mono&quot;,Monaco,&quot;Andale Mono&quot;,&quot;Ubuntu \
Mono&quot;,monospace">waylandsink</code><span \
style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,&quot;Segoe \
UI&quot;,Roboto,Ubuntu,Cantarell,&quot;Noto Sans&quot;,sans-serif,&quot;Helvetica \
Neue&quot;,Arial,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe \
UI Symbol&quot;,&quot;Noto Color Emoji&quot;"> consistently integrates directly into \
the GTK window without issues.</span></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Mon, 29 Apr 2024 at 10:51, Gregoire Gentil &lt;<a \
href="mailto:gregoire@gentil.com">gregoire@gentil.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I could have been more \
precise: the glimageslink pipeline does work and <br> the video appears in a \
separated window if I don&#39;t link it to the window <br> with the code mentioned \
below. What I want to do is to insert the video <br> inside the gtk window.<br>
<br>
Also glimagesink has the unique advantage to work on both wayland and <br>
non-wayland systems,<br>
<br>
Grégoire<br>
<br>
<br>
<br>
<br>
On 4/28/24 19:12, Max Weng wrote:<br>
&gt; try use  waylandsink?<br>
&gt; <br>
&gt; this work for me &quot;rtspsrc name=rtspsrc location={url} protocols=tcp <br>
&gt; latency=10 max-rtcp-rtp-time-diff=10 ! errorignore ! rtph265depay <br>
&gt; name=depay ! h265parse ! avdec_h265 name=avdec ! videoconvert ! <br>
&gt; video/x-raw, format=RGBA ! waylandsink name=sink&quot;<br>
&gt; <br>
&gt; On Mon, 29 Apr 2024 at 06:18, Gregoire Gentil via gstreamer-devel <br>
&gt; &lt;<a href="mailto:gstreamer-devel@lists.freedesktop.org" \
target="_blank">gstreamer-devel@lists.freedesktop.org</a> <br> &gt; &lt;mailto:<a \
href="mailto:gstreamer-devel@lists.freedesktop.org" \
target="_blank">gstreamer-devel@lists.freedesktop.org</a>&gt;&gt; wrote:<br> &gt; \
<br> &gt;        Hello,<br>
&gt; <br>
&gt;        I had an application with a gtk+-3.0 window and a pipeline &quot;... \
!<br> &gt;        imagesink&quot;. The video is rendered inside the gtk window.<br>
&gt; <br>
&gt;        I was doing:<br>
&gt;        static void realize_cb(GtkWidget *widget, CustomData *data) {<br>
&gt;        GdkWindow *window = gtk_widget_get_window(widget);<br>
&gt;        data-&gt;window_handle = GDK_WINDOW_XID(window);<br>
&gt; <br>
&gt;        and then:<br>
&gt; <br>
&gt;        static GstBusSyncReply bus_sync_handler(GstBus * bus, GstMessage *<br>
&gt;        message, CustomData *data) {<br>
&gt;        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(data-&gt;video_sink),<br>
 &gt;        data-&gt;window_handle);<br>
&gt; <br>
&gt;        Everything was working fine. I want now to support wayland system.<br>
&gt; <br>
&gt;        Pipeline becomes: &quot;... ! glimagesink&quot;.<br>
&gt; <br>
&gt;        in the realize_cb function, I have now:<br>
&gt;        GdkWindow *window = gtk_widget_get_window(widget);<br>
&gt;        data-&gt;window_handle =<br>
&gt;        (guintptr)gdk_wayland_window_get_wl_surface(window);<br>
&gt; <br>
&gt; <br>
&gt;        At run-time, I&#39;m getting hundreds of:<br>
&gt;        &quot;GStreamer-GL-CRITICAL **: 14:06:48.263: Failed to flush Wayland<br>
&gt;        connection&quot;<br>
&gt; <br>
&gt;        What am I doing wrong? Many thanks in advance for any hint,<br>
&gt; <br>
&gt;        Grégoire<br>
&gt; <br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic