[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 6:53:21
Message-ID: CACWdWravS5sj-op972fEz70LsPJh-HjFi9K1V239jmykocdo0A () mail ! gmail ! com
[Download RAW message or body]

I forgot to mention that handling window operations in Wayland is a bit
different from X11.there is a c example for wayland gtk in the gstreamer
repo, but I can not find it now.
here is my python code, shall be easy convert to C++

libgdk = ctypes.CDLL(find_library("libgdk-3"))
libgst = ctypes.CDLL(find_library("libgstreamer-1.0"))

def get_wayland_window_handle(widget):
return libgdk.gdk_wayland_window_get_wl_surface(hash(widget.get_window()))


def get_default_wayland_display_context():
wl_display = libgdk.gdk_wayland_display_get_wl_display(
hash(Gdk.Display.get_default())
)
context = Gst.Context.new("GstWaylandDisplayHandleContextType", True)
structure = libgst.gst_context_writable_structure(hash(context))
libgst.gst_structure_set(
structure,
ctypes.c_char_p("display".encode()),
hash(GObject.TYPE_POINTER),
wl_display,
0,
)
return context

def set_window(self):
if self.window is not None:
# window already set, when refresh/update, do not create new window
return
window = Gtk.Window()
window.set_title("Video Streaming")
self.window = window
self.window.connect("destroy", Gtk.main_quit, "WM destroy")
window.set_default_size(1200, 800)
self.window.show_all()
self.window.fullscreen()

def set_stream(self, url):
command = f"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"
self.logger.info(f"command {command}")
self.pipeline = Gst.parse_launch(command)

bus = self.pipeline.get_bus()
bus.add_signal_watch()
bus.connect("message", self.on_message)

if self.drawing_area is not None:
self.window.remove(self.drawing_area)
self.drawing_area = Gtk.DrawingArea()
# set background color
self.drawing_area.modify_bg(
Gtk.StateType.NORMAL, Gdk.color_parse(self.background_color_str)
)

glsink = self.pipeline.get_by_name("sink")

# Wayland display context wrapped as a GStreamer context.
wl_display = get_default_wayland_display_context()
glsink.set_context(wl_display)

self.window.connect("delete-event", Gtk.main_quit)
self.window.add(self.drawing_area)
self.drawing_area.realize()

self.window.show_all()

bus.enable_sync_message_emission()
bus.connect("sync-message", self.on_sync_message)

def on_sync_message(self, bus: Gst.Bus, message: Gst.Message):
if message.get_structure() is None:
return 1

if message.get_structure().get_name() == "prepare-window-handle":
self.logger.info(f"[on_sync_message] {message.get_structure().get_name()}")
sink = message.src
self.logger.info(f"[on_sync_message] sink: {sink}")

# Wayland window handle.
wl_handle = get_wayland_window_handle(self.drawing_area)
sink.set_window_handle(wl_handle)

allocation = self.drawing_area.get_allocation()
sink.set_render_rectangle(
allocation.x, allocation.y, allocation.width, allocation.height
)

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

> Thanks for helping. Still not working.
>
> I have replaced glimagesink by waylandsink. If I don't call
> "gst_video_overlay_set_window_handle", the video appears in the back. So
> at least, waylandsink is working. But note that the video is appearing
> without being part of any window at all.
>
> If I call "gst_video_overlay_set_window_handle", the video doesn't
> appear and doesn't play. I also receive the following message:
>
> waylandsink cannot use an externally-supplied surface without an
> externally-supplied display handle. Consider providing a display handle
> from your application with GstContext
>
> Am I missing another API call?
>
> Grégoire
>
>
> On 4/28/24 20:28, Max Weng wrote:
> > 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
> > <mailto: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>
> >      > <mailto: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 forgot to mention that handling \
window operations in Wayland is a bit different from X11</span>.there is a c example \
for wayland gtk in the gstreamer repo, but I can not find it now.<br>here is my \
python code, shall be easy convert to C++<div><br></div><div><div \
style="color:rgb(214,214,221);background-color:rgb(24,24,24);font-family:&quot;Droid \
Sans Mono&quot;,&quot;monospace&quot;,monospace;font-size:16px;line-height:22px;white-space:pre"><div><div \
style="line-height:22px"><div></div><div><span \
style="color:rgb(148,193,250)">libgdk</span> = <span \
style="color:rgb(209,209,209)">ctypes</span>.<span \
style="color:rgb(235,200,141)">CDLL</span>(<span \
style="color:rgb(235,200,141)">find_library</span>(<span \
style="color:rgb(227,148,220)">&quot;libgdk-3&quot;</span>))</div><div><div \
style="line-height:22px"><div><span style="color:rgb(148,193,250)">libgst</span> = \
<span style="color:rgb(209,209,209)">ctypes</span>.<span \
style="color:rgb(235,200,141)">CDLL</span>(<span \
style="color:rgb(235,200,141)">find_library</span>(<span \
style="color:rgb(227,148,220)">&quot;libgstreamer-1.0&quot;</span>))</div><div><br></div></div></div></div></div><div><span \
style="color:rgb(130,210,206)">def</span> <span \
style="color:rgb(239,176,128);font-weight:bold">get_wayland_window_handle</span>(<span \
style="font-style:italic">widget</span>):</div><div>    <span \
style="color:rgb(131,214,197);font-style:italic">return</span> <span \
style="color:rgb(148,193,250)">libgdk</span>.<span \
style="color:rgb(170,160,250)">gdk_wayland_window_get_wl_surface</span>(<span \
style="color:rgb(130,210,206)">hash</span>(<span \
style="font-style:italic">widget</span>.<span \
style="color:rgb(170,160,250)">get_window</span>()))</div><br><br><div><span \
style="color:rgb(130,210,206)">def</span> <span \
style="color:rgb(239,176,128);font-weight:bold">get_default_wayland_display_context</span>():</div><div> \
<span style="color:rgb(148,193,250)">wl_display</span> = <span \
style="color:rgb(148,193,250)">libgdk</span>.<span \
style="color:rgb(170,160,250)">gdk_wayland_display_get_wl_display</span>(</div><div>  \
<span style="color:rgb(130,210,206)">hash</span>(Gdk.Display.<span \
style="color:rgb(170,160,250)">get_default</span>())</div><div>    )</div><div>    \
<span style="color:rgb(148,193,250)">context</span> = Gst.Context.<span \
style="color:rgb(170,160,250)">new</span>(<span \
style="color:rgb(227,148,220)">&quot;GstWaylandDisplayHandleContextType&quot;</span>, \
<span style="color:rgb(130,210,206)">True</span>)</div><div>    <span \
style="color:rgb(148,193,250)">structure</span> = <span \
style="color:rgb(148,193,250)">libgst</span>.<span \
style="color:rgb(170,160,250)">gst_context_writable_structure</span>(<span \
style="color:rgb(130,210,206)">hash</span>(<span \
style="color:rgb(148,193,250)">context</span>))</div><div>    <span \
style="color:rgb(148,193,250)">libgst</span>.<span \
style="color:rgb(170,160,250)">gst_structure_set</span>(</div><div>        <span \
style="color:rgb(148,193,250)">structure</span>,</div><div>        <span \
style="color:rgb(209,209,209)">ctypes</span>.<span \
style="color:rgb(235,200,141)">c_char_p</span>(<span \
style="color:rgb(227,148,220)">&quot;display&quot;</span>.<span \
style="color:rgb(235,200,141)">encode</span>()),</div><div>        <span \
style="color:rgb(130,210,206)">hash</span>(GObject.TYPE_POINTER),</div><div>        \
<span style="color:rgb(148,193,250)">wl_display</span>,</div><div>        <span \
style="color:rgb(235,200,141)">0</span>,</div><div>    )</div><div>    <span \
style="color:rgb(131,214,197);font-style:italic">return</span> <span \
style="color:rgb(148,193,250)">context</span></div><div><span \
style="color:rgb(148,193,250)"><br></span></div><div><div \
style="line-height:22px"><div><span style="color:rgb(130,210,206)">def</span> <span \
style="color:rgb(239,176,128);font-weight:bold">set_window</span>(<span \
style="color:rgb(204,124,138);font-style:italic">self</span>):</div><div>        \
<span style="color:rgb(131,214,197);font-style:italic">if</span> <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span> <span \
style="color:rgb(131,214,197)">is</span> <span \
style="color:rgb(131,214,197)">not</span> <span \
style="color:rgb(130,210,206)">None</span>:</div><div>            <span \
style="color:rgb(109,109,109);font-style:italic"># window already set, when \
refresh/update, do not create new window</span></div><div>            <span \
style="color:rgb(131,214,197);font-style:italic">return</span></div><div>        \
<span style="color:rgb(148,193,250)">window</span> = Gtk.<span \
style="color:rgb(170,160,250)">Window</span>()</div><div>        <span \
style="color:rgb(148,193,250)">window</span>.<span \
style="color:rgb(170,160,250)">set_title</span>(<span \
style="color:rgb(227,148,220)">&quot;Video Streaming&quot;</span>)</div><div>        \
<span style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span> = <span \
style="color:rgb(148,193,250)">window</span></div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span>.<span \
style="color:rgb(170,160,250)">connect</span>(<span \
style="color:rgb(227,148,220)">&quot;destroy&quot;</span>, Gtk.main_quit, <span \
style="color:rgb(227,148,220)">&quot;WM destroy&quot;</span>)</div><div>        <span \
style="color:rgb(148,193,250)">window</span>.<span \
style="color:rgb(170,160,250)">set_default_size</span>(<span \
style="color:rgb(235,200,141)">1200</span>, <span \
style="color:rgb(235,200,141)">800</span>)</div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span>.<span \
style="color:rgb(170,160,250)">show_all</span>()</div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span>.<span \
style="color:rgb(170,160,250)">fullscreen</span>()</div></div></div><div><span \
style="color:rgb(148,193,250)"><br></span></div><div><div \
style="line-height:22px"><div><span style="color:rgb(130,210,206)">def</span> <span \
style="color:rgb(239,176,128);font-weight:bold">set_stream</span>(<span \
style="color:rgb(204,124,138);font-style:italic">self</span>, <span \
style="font-style:italic">url</span>):</div><div>        <span \
style="color:rgb(148,193,250)">command</span> = <span \
style="color:rgb(130,210,206)">f</span><span \
style="color:rgb(227,148,220)">&quot;rtspsrc name=rtspsrc location=</span><span \
style="color:rgb(248,199,98)">{</span><span style="font-style:italic">url</span><span \
style="color:rgb(248,199,98)">}</span><span style="color:rgb(227,148,220)"> \
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&quot;</span></div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">logger</span>.<span \
style="color:rgb(235,200,141)">info</span>(<span \
style="color:rgb(130,210,206)">f</span><span \
style="color:rgb(227,148,220)">&quot;command </span><span \
style="color:rgb(248,199,98)">{</span><span \
style="color:rgb(148,193,250)">command</span><span \
style="color:rgb(248,199,98)">}</span><span \
style="color:rgb(227,148,220)">&quot;</span>)</div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">pipeline</span> = Gst.<span \
style="color:rgb(170,160,250)">parse_launch</span>(<span \
style="color:rgb(148,193,250)">command</span>)</div><br><div>        <span \
style="color:rgb(148,193,250)">bus</span> = <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">pipeline</span>.<span \
style="color:rgb(170,160,250)">get_bus</span>()</div><div>        <span \
style="color:rgb(148,193,250)">bus</span>.<span \
style="color:rgb(170,160,250)">add_signal_watch</span>()</div><div>        <span \
style="color:rgb(148,193,250)">bus</span>.<span \
style="color:rgb(170,160,250)">connect</span>(<span \
style="color:rgb(227,148,220)">&quot;message&quot;</span>, <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(235,200,141)">on_message</span>)</div><br><div>        <span \
style="color:rgb(131,214,197);font-style:italic">if</span> <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">drawing_area</span> <span \
style="color:rgb(131,214,197)">is</span> <span \
style="color:rgb(131,214,197)">not</span> <span \
style="color:rgb(130,210,206)">None</span>:</div><div>            <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span>.<span \
style="color:rgb(170,160,250)">remove</span>(<span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">drawing_area</span>)</div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">drawing_area</span> = Gtk.<span \
style="color:rgb(170,160,250)">DrawingArea</span>()</div><div>        <span \
style="color:rgb(109,109,109);font-style:italic"># set background \
color</span></div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">drawing_area</span>.<span \
style="color:rgb(170,160,250)">modify_bg</span>(</div><div>            \
Gtk.StateType.NORMAL, Gdk.<span \
style="color:rgb(170,160,250)">color_parse</span>(<span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">background_color_str</span>)</div><div>        \
)</div><br><div>        <span style="color:rgb(148,193,250)">glsink</span> = <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">pipeline</span>.<span \
style="color:rgb(170,160,250)">get_by_name</span>(<span \
style="color:rgb(227,148,220)">&quot;sink&quot;</span>)</div><br><div>        <span \
style="color:rgb(109,109,109);font-style:italic"># Wayland display context wrapped as \
a GStreamer context.</span></div><div>        <span \
style="color:rgb(148,193,250)">wl_display</span> = <span \
style="color:rgb(235,200,141)">get_default_wayland_display_context</span>()</div><div> \
<span style="color:rgb(148,193,250)">glsink</span>.<span \
style="color:rgb(170,160,250)">set_context</span>(<span \
style="color:rgb(148,193,250)">wl_display</span>)</div><br><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span>.<span \
style="color:rgb(170,160,250)">connect</span>(<span \
style="color:rgb(227,148,220)">&quot;delete-event&quot;</span>, \
Gtk.main_quit)</div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span>.<span \
style="color:rgb(170,160,250)">add</span>(<span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">drawing_area</span>)</div><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">drawing_area</span>.<span \
style="color:rgb(170,160,250)">realize</span>()</div><br><div>        <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(170,155,245)">window</span>.<span \
style="color:rgb(170,160,250)">show_all</span>()</div><br><div>        <span \
style="color:rgb(148,193,250)">bus</span>.<span \
style="color:rgb(170,160,250)">enable_sync_message_emission</span>()</div><div>       \
<span style="color:rgb(148,193,250)">bus</span>.<span \
style="color:rgb(170,160,250)">connect</span>(<span \
style="color:rgb(227,148,220)">&quot;sync-message&quot;</span>, <span \
style="color:rgb(204,124,138);font-style:italic">self</span>.<span \
style="color:rgb(235,200,141)">on_sync_message</span>)</div><div><br></div><div><div \
style="line-height:22px"><div><span style="color:rgb(130,210,206)">def</span> <span \
style="color:rgb(239,176,128);font-weight:bold">on_sync_message</span>(<span \
style="color:rgb(204,124,138);font-style:italic">self</span>, <span \
style="font-style:italic">bus</span>: Gst.Bus, <span \
style="font-style:italic">message</span>: Gst.Message):</div><div>        <span \
style="color:rgb(131,214,197);font-style:italic">if</span> <span \
style="font-style:italic">message</span>.<span \
style="color:rgb(170,160,250)">get_structure</span>() <span \
style="color:rgb(131,214,197)">is</span> <span \
style="color:rgb(130,210,206)">None</span>:</div><div>            <span \
style="color:rgb(131,214,197);font-style:italic">return</span> <span \
style="color:rgb(235,200,141)">1</span></div><br><div>        <span \
style="color:rgb(131,214,197);font-style:italic">if</span> <span \
<br>
I have replaced glimagesink by waylandsink. If I don&#39;t call <br>
&quot;gst_video_overlay_set_window_handle&quot;, the video appears in the back. So \
<br> at least, waylandsink is working. But note that the video is appearing <br>
without being part of any window at all.<br>
<br>
If I call &quot;gst_video_overlay_set_window_handle&quot;, the video doesn&#39;t <br>
appear and doesn&#39;t play. I also receive the following message:<br>
<br>
waylandsink cannot use an externally-supplied surface without an <br>
externally-supplied display handle. Consider providing a display handle <br>
from your application with GstContext<br>
<br>
Am I missing another API call?<br>
<br>
Grégoire<br>
<br>
<br>
On 4/28/24 20:28, Max Weng wrote:<br>
&gt; I understand your situation better now. :) I&#39;ve noticed that the video <br>
&gt; indeed appears in a separate window with other sinks as well. It seems <br>
&gt; that in my experience, only |waylandsink|consistently integrates <br>
&gt; directly into the GTK window without issues.<br>
&gt; <br>
&gt; On Mon, 29 Apr 2024 at 10:51, Gregoire Gentil &lt;<a \
href="mailto:gregoire@gentil.com" target="_blank">gregoire@gentil.com</a> <br> &gt; \
&lt;mailto:<a href="mailto:gregoire@gentil.com" \
target="_blank">gregoire@gentil.com</a>&gt;&gt; wrote:<br> &gt; <br>
&gt;        I could have been more precise: the glimageslink pipeline does work \
and<br> &gt;        the video appears in a separated window if I don&#39;t link it to \
the<br> &gt;        window<br>
&gt;        with the code mentioned below. What I want to do is to insert the \
video<br> &gt;        inside the gtk window.<br>
&gt; <br>
&gt;        Also glimagesink has the unique advantage to work on both wayland and<br>
&gt;        non-wayland systems,<br>
&gt; <br>
&gt;        Grégoire<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt;        On 4/28/24 19:12, Max Weng wrote:<br>
&gt;         &gt; try use  waylandsink?<br>
&gt;         &gt;<br>
&gt;         &gt; this work for me &quot;rtspsrc name=rtspsrc location={url} \
protocols=tcp<br> &gt;         &gt; latency=10 max-rtcp-rtp-time-diff=10 ! \
errorignore ! rtph265depay<br> &gt;         &gt; name=depay ! h265parse ! avdec_h265 \
name=avdec ! videoconvert !<br> &gt;         &gt; video/x-raw, format=RGBA ! \
waylandsink name=sink&quot;<br> &gt;         &gt;<br>
&gt;         &gt; On Mon, 29 Apr 2024 at 06:18, Gregoire Gentil via \
gstreamer-devel<br> &gt;         &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;<br> &gt;         &gt; \
&lt;mailto:<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;&gt; wrote:<br> &gt; \
&gt;<br> &gt;         &gt;        Hello,<br>
&gt;         &gt;<br>
&gt;         &gt;        I had an application with a gtk+-3.0 window and a pipeline \
&quot;... !<br> &gt;         &gt;        imagesink&quot;. The video is rendered \
inside the gtk window.<br> &gt;         &gt;<br>
&gt;         &gt;        I was doing:<br>
&gt;         &gt;        static void realize_cb(GtkWidget *widget, CustomData *data) \
{<br> &gt;         &gt;        GdkWindow *window = gtk_widget_get_window(widget);<br>
&gt;         &gt;        data-&gt;window_handle = GDK_WINDOW_XID(window);<br>
&gt;         &gt;<br>
&gt;         &gt;        and then:<br>
&gt;         &gt;<br>
&gt;         &gt;        static GstBusSyncReply bus_sync_handler(GstBus * bus,<br>
&gt;        GstMessage *<br>
&gt;         &gt;        message, CustomData *data) {<br>
&gt;         &gt;     <br>
&gt;           gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(data-&gt;video_sink),<br>
 &gt;         &gt;        data-&gt;window_handle);<br>
&gt;         &gt;<br>
&gt;         &gt;        Everything was working fine. I want now to support \
wayland<br> &gt;        system.<br>
&gt;         &gt;<br>
&gt;         &gt;        Pipeline becomes: &quot;... ! glimagesink&quot;.<br>
&gt;         &gt;<br>
&gt;         &gt;        in the realize_cb function, I have now:<br>
&gt;         &gt;        GdkWindow *window = gtk_widget_get_window(widget);<br>
&gt;         &gt;        data-&gt;window_handle =<br>
&gt;         &gt;        (guintptr)gdk_wayland_window_get_wl_surface(window);<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;        At run-time, I&#39;m getting hundreds of:<br>
&gt;         &gt;        &quot;GStreamer-GL-CRITICAL **: 14:06:48.263: Failed to \
flush Wayland<br> &gt;         &gt;        connection&quot;<br>
&gt;         &gt;<br>
&gt;         &gt;        What am I doing wrong? Many thanks in advance for any \
hint,<br> &gt;         &gt;<br>
&gt;         &gt;        Grégoire<br>
&gt;         &gt;<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