[Libva] Scale of vaapisink
Holger Kaelberer
hk at elberer.de
Thu Sep 17 08:33:14 PDT 2015
Hi,
On 16.09.2015 13:56, Engin Firat wrote:
> Hello all,
>
> I render decoded frames on a QtWidget with the help of a vaapisink with the following code:
> *
> *
> *gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(videoSink), widget->winId());*
> *
> *
> here videosink is a vaapisink and widget is a pointer to QWidget.
>
> The rendering is successful but whenever I change the size of widget programmatically I expect to
> see the vaapisink scales the video accordingly. For example, starting with a 100x100 pixels widget
> when I change to 200x200 pixels I expect to see vaapisink scales the video to 200*200.
>
> The same pipeline when run through gst-launch command line tool shows the behaviour that I have
> expected, ie. vaapisink scales the video automatically.
>
> How could one get the specified behavior with a QWidget?
vaapisink needs to get informed of size changes to reconfigure its viewport and render its last
surface again.
If resizing of your widget means resizing your window this should happen automatically via X11
Expose/ConfigureNotify events (since 4b61cc3cd71dcb7671faf43636010fd3b58404fb). IIRC we had problems
with Qt's own widget refresh dynamics and dropped all Expose and ConfigureNotify events on app layer
and called into gst_video_overlay_expose () instead. Plus something like
QWidget::setUpdatesEnabled(false).
If your widget is part of a bigger scene, you might have success with something like
resize/show/paintEvent: catch and drop them and call gst_video_overlay_expose() instead which in
turn reconfigures vaapinsink's window geometry.
Holger
More information about the Libva
mailing list