<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">Hi,
</span><br>
<br>
<span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">Thank you for the replay
 , however I was trying the same approach using gst-overlay.</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<span data-gramm_editor="false" style="width:100%;word-break:break-word"><span style="opacity:1" class="article-sentence"><span class="jss809 jss810"><span class="first-sentence-half" style="display:inline"><span class=" jss821 jss822"><span class="jss823 jss824" style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">I've
</span></span><span class=" jss821 jss825"><span class="jss823 jss826" style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">attached
</span></span><span class=" jss821 jss827"><span class="jss823 jss828" style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">the
</span></span><span class=" jss821 jss829"><span class="jss823 jss830" style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">code </span></span><span class=" jss821 jss831"><span class="jss823 jss833" style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">for
 reference, executing this does not give favorable response </span></span></span></span></span><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">(actual
 result attached in the image below).</span><span><br>
</span><span><br>
</span><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">Can you advice on
 the missing part ?</span><span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">
</span><span><br>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);" itemscope="" itemtype="https://schemas.microsoft.com/QuotedText">
<div>    static GstBusSyncReply
<div>    bus_sync_handler (GstBus * bus, GstMessage * message, gpointer user_data)</div>
<div>    {</div>
<div>      DemoApp *app = user_data;</div>
<div><br>
</div>
<div>      if (gst_is_wayland_display_handle_need_context_message (message)) {</div>
<div>        app->context = gst_wayland_display_handle_context_new (app->display);</div>
<div>        gst_element_set_context (GST_ELEMENT (GST_MESSAGE_SRC (message)),</div>
<div>            app->context);</div>
<div><br>
</div>
<div>        goto drop;</div>
<div>      } else if (gst_is_wayland_display_handle_need_context_message (message)) {</div>
<div>        gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC</div>
<div>                (message)), (guintptr) subsurface1);</div>
<div>        gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC</div>
<div>                (message)), 0, 0, 200, 200);</div>
<div>        wl_surface_commit (subsurface1);</div>
<div>        printf ("commiting surface from bus sync\n");</div>
<div>        goto drop;</div>
<div>      }</div>
<div>      return GST_BUS_PASS;</div>
<div><br>
</div>
<br>
</div>
</blockquote>
</span><span><br>
</span><span>Appreciate if any (offline?) hacks are also available. Any links ?<br>
<br>
Thanks, in advance.<br>
</span><span><br>
</span><span style="opacity:1" class="article-sentence"><span class="jss809 jss813">
<div class="first-sentence-half" style="display:inline"><span class=" jss821 jss899"><span class="jss823 jss900">We
</span></span><span class=" jss821 jss901"><span class="jss823 jss902">currently </span>
<span class="jss823 jss903">have </span></span><span class=" jss821 jss911"><span class="jss823 jss912">main
</span></span><span class=" jss821 jss913"><span class="jss823 jss914">surface </span>
</span><span class=" jss821 jss915"><span class="jss823 jss916">(black), </span></span><span class=" jss821 jss917"><span class="jss823 jss918">subsurface
</span></span><span class=" jss821 jss919"><span class="jss823 jss920">(silver), </span>
</span><span class=" jss821 jss921"><span class="jss823 jss922">and </span></span><span class=" jss821 jss923"><span class="jss823 jss924">gstreamer Video.
</span></span></div>
</span></span><span><br>
</span><span style="opacity:1" class="article-sentence"><span class="jss809 jss814">
<div class="first-sentence-half" style="display:inline"><span class=" jss821 jss973"><span class="jss823 jss974">The
</span></span><span class=" jss821 jss975"><span class="jss823 jss976">main </span>
</span><span class=" jss821 jss977"><span class="jss823 jss978">surface </span></span><span class=" jss821 jss979"><span class="jss823 jss980">is
</span></span><span class=" jss821 jss981"><span class="jss823 jss982">rendered </span>
</span><span class=" jss821 jss983"><span class="jss823 jss984">in </span><span class="jss823 jss985">a
</span></span><span class=" jss821 jss986"><span class="jss823 jss987">random </span>
<span class="jss823 jss988">location, </span></span><span class=" jss821 jss989"><span class="jss823 jss990">the
</span></span><span class=" jss821 jss991"><span class="jss823 jss992">subsurface
</span></span><span class=" jss821 jss993"><span class="jss823 jss994">is </span>
</span><span class=" jss821 jss995"><span class="jss823 jss996">rendered </span></span><span class=" jss821 jss997"><span class="jss823 jss998">in
</span><span class="jss823 jss999">a </span></span><span class=" jss821 jss1000"><span class="jss823 jss1001">fixed
</span><span class="jss823 jss1002">location relative</span></span><span class=" jss821 jss1003"><span class="jss823 jss1004">
</span></span><span class=" jss821 jss1005"><span class="jss823 jss1006">to </span>
<span class="jss823 jss1007">the </span></span><span class=" jss821 jss1008"><span class="jss823 jss1009">main
</span><span class="jss823 jss1010">surface, </span></span><span class=" jss821 jss1011"><span class="jss823 jss1012">and
</span><span class="jss823 jss1013">the </span></span><span class=" jss821 jss1014"><span class="jss823 jss1015">Gstreamer
</span></span><span class=" jss821 jss1016"><span class="jss823 jss1017">Video </span>
</span><span class=" jss821 jss1022"><span class="jss823 jss1023">rendered </span>
</span><span class=" jss821 jss1024"><span class="jss823 jss1025">out </span><span class="jss823 jss1026">of
</span><span class="jss823 jss1027">the </span></span><span class=" jss821 jss1028"><span class="jss823 jss1029">main
</span><span class="jss823 jss1030">surface. </span></span></div>
</span></span><span><br>
</span></span>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<img style="max-width: 100%;" class="w-2467 h-1541" size="144160" contenttype="image/png" data-outlook-trace="F:1|T:1" src="cid:bcd4fe83-eb86-434c-a17b-0267f983de60">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nicolas Dufresne <nicolas@ndufresne.ca><br>
<b>Sent:</b> Wednesday, June 8, 2022 5:13 AM<br>
<b>To:</b> Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org><br>
<b>Cc:</b> gstreamer-embedded@lists.freedesktop.org <gstreamer-embedded@lists.freedesktop.org>; Kishan Dudhatra <kishan.dudhatra@sisignals.com><br>
<b>Subject:</b> Re: Render Gstreamer video on Wayland subsurface.</font>
<div> </div>
</div>
<div>
<div dir="auto">
<div><br>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">Le mar. 7 juin 2022, 06 h 30, Kishan Dudhatra via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>> a écrit :<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<p dir="auto">hello;<br>
</p>
<p dir="auto"><br>
</p>
<p dir="auto">issue posted : <a href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1722" title="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1722" target="_blank" rel="noreferrer">
gst-plugins-bad</a><br>
</p>
<p dir="auto"><br>
</p>
<p dir="auto">I want to render GStreamer video on Wayland subsurface and using waylandsink.</p>
<p dir="auto"><br>
</p>
<p dir="auto">Currently i have created 1.main surface 2.Subsurface as shown in attached image.<br>
</p>
<p dir="auto"><br>
</p>
<div dir="auto" style="margin-top:0px; margin-bottom:0px">
<p dir="auto">I want to render the GStreamer video on subsurface.</p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">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().</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="x_gmail_quote">
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div dir="auto" style="margin-top:0px; margin-bottom:0px">
<p dir="auto"><br>
</p>
<p dir="auto">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.</p>
</div>
<div dir="auto" style="margin-top:0px; margin-bottom:0px"><br>
</div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>