<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">Le mar. 10 juil. 2018 17:56, tom <<a href="mailto:ttustonic@outlook.com">ttustonic@outlook.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br>
<br>
I don't quite understand how VideoOverlayAdapter.SetRenderRectangle (from<br>
gstreamer-sharp) and gst_video_overlay_set_render_rectangle works.<br>
<br>
I have modified<br>
<a href="https://github.com/GStreamer/gstreamer-sharp/blob/master/samples/BasicTutorial5.cs" rel="noreferrer noreferrer" target="_blank">https://github.com/GStreamer/gstreamer-sharp/blob/master/samples/BasicTutorial5.cs</a><br>
to set the render rectangle, like this:<br>
<br>
            VideoOverlayAdapter adapter = new<br>
VideoOverlayAdapter(overlay.Handle);<br>
            adapter.WindowHandle = windowHandle;<br>
            adapter.SetRenderRectangle(50, 50, 427, 240);<br>
            adapter.HandleEvents(true);<br>
<br>
I expected that the video will be rendered in the 427x240 rectangle, at the<br>
position 50,50, but there is a correct rectangle at the position, and video<br>
is moved to the 50,50 inside this rectangle. The same happens in the<br>
WinForms version of the sample.<br>
<br>
See the image<br>
<<a href="http://gstreamer-devel.966125.n4.nabble.com/file/t378393/renderrect.jpg" rel="noreferrer noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/file/t378393/renderrect.jpg</a>> <br>
<br>
Is this the correct behavior or a bug ?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes and no, if the display sink can scale, the video should be scaled to the width/height of the rectangle. If the display can crop, it should minimally crop to that rectangle. It seems that these two feature are not supported or not implemented.</div><div dir="auto"><br></div><div dir="auto">To deal with non-scaling sink, you can add video scale in front. The non-scaling sink are supposed to prefix the caps with the preferred width and height so that videoscale will do the right thing. If this is not the case, then is a big in the non-scaling sink implementation.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I'm using GStreamer 1.14.1 32bit on Windows 10.<br>
<br>
Thanks, <br>
Tom<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="noreferrer noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div></div></div>