GstVideoOverlay SetRenderRectangle question
Nicolas Dufresne
nicolas at ndufresne.ca
Tue Jul 10 23:35:39 UTC 2018
Le mar. 10 juil. 2018 17:56, tom <ttustonic at outlook.com> a écrit :
> Hello
>
> I don't quite understand how VideoOverlayAdapter.SetRenderRectangle (from
> gstreamer-sharp) and gst_video_overlay_set_render_rectangle works.
>
> I have modified
>
> https://github.com/GStreamer/gstreamer-sharp/blob/master/samples/BasicTutorial5.cs
> to set the render rectangle, like this:
>
> VideoOverlayAdapter adapter = new
> VideoOverlayAdapter(overlay.Handle);
> adapter.WindowHandle = windowHandle;
> adapter.SetRenderRectangle(50, 50, 427, 240);
> adapter.HandleEvents(true);
>
> I expected that the video will be rendered in the 427x240 rectangle, at the
> position 50,50, but there is a correct rectangle at the position, and video
> is moved to the 50,50 inside this rectangle. The same happens in the
> WinForms version of the sample.
>
> See the image
> <http://gstreamer-devel.966125.n4.nabble.com/file/t378393/renderrect.jpg>
>
> Is this the correct behavior or a bug ?
>
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.
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.
> I'm using GStreamer 1.14.1 32bit on Windows 10.
>
> Thanks,
> Tom
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180710/c6ff9db8/attachment.html>
More information about the gstreamer-devel
mailing list