GNOME Bugzilla – Bug 711478
vaapisink: listen to window size changes
Last modified: 2014-07-30 13:48:06 UTC
Hi, when embedding vaapisink into another X11 window (or when using the automatically created window), and resizing it, vaapisink does not react to the window size changes and does not scale the video to fill the complete available area (while preserving the aspect ratio).
The ConfigureNotify event is sent to the window when that happens, check xvimagesink or ximagesink for code that handles it.
We implemented this some months ago. Pushed our changes to my gitorious-clone if it helps you: https://gitorious.org/vaapi/hkaelbers-gstreamer-vaapi/commit/aff531aa53f781050dd054afdf87f7067e10299b https://gitorious.org/vaapi/hkaelbers-gstreamer-vaapi/commit/922f256c2517aebf019dbf60f724c49c57a5cf52 Sorry, we still have not rebased against upstream master, still based on our branching from 0.2 (or 0.3?) :-( Holger
Hi, IIRC sree also had some code for that. I don't really want to have too X11 specific code in vaapisink.
I don't think you can get around that if you want vaapisink to behave properly in applications and not just have it usable for fullscreen mode. Related to that also bug #711479, you'll also need to listen for X11 key events.
I believe we can make it for 0.5.8. Sree, could you please post your updated patch? Note that you'd need to replace the GObject property with an adequate accessor now that GstVaapiWindow objects are no longer based on GObjects. :) Thanks.
Created attachment 263965 [details] [review] Handle the events of internally created xwindow in a separate thread This was the patch i sent to you on Feb 7,2013 :)..Didn't get time to rebase on top of current gstremaer-vaapi master since i am too busy with some other things at the moment :(
Sorry, I changed my mind and would rather handle events in vaapisink only. The trend is to have small enough libgstvaapi* helper libraries and I no longer foresee any usage of those render backends beyond vaapisink at this time. Historically, my interest was directed towards Gnash and we didn't have auto-plugging, neither context propagation at that time. :) I would most likely defer this task once cleaner GstVaapiSinkBackend implementations are in place, and where we could actually stuff in all the relevant event thread handling and friends.
Created attachment 280781 [details] [review] Window: Allow for updating window size from geometry
Created attachment 280782 [details] [review] vaapisink: handle geometry changes of X11 windows Here are the two patches from comment #2 rebased against upstream.
Review of attachment 280781 [details] [review]: Pushed to git master branch. Thanks. Changed the interface to gst_vaapi_window_reconfigure().
Created attachment 281876 [details] [review] vaapisink: listen to window size changes on X11 Changes: - Dropped XInitThreads() - Cleaned up the code a little - Made sure that it still builds with --disable-x11 configure option
Comment on attachment 280782 [details] [review] vaapisink: handle geometry changes of X11 windows Replaced with the attached update. Could you please give it a try? There are additional changes I would like to make in subsequent patches. That's why I postpone that after 0.5.9 release.
Patch from comment #11 works here, thanks!
commit 4b61cc3cd71dcb7671faf43636010fd3b58404fb Author: Holger Kaelberer <hk@getslash.de> Date: Tue Nov 5 14:01:11 2013 +0100 vaapisink: listen to window size changes on X11. Allow dynamic changes to the window, e.g. performed by the user, and make sure to refresh its contents, while preserving aspect ratio. In practice, Expose and ConfigureNotify events are tracked in X11 display mode by default. This occurs in a separte event thread, and this is similar to what xvimagesink does. Any of those events will trigger a reconfiguration of the window "soft" size, subsequently the render-rect when necessary, and finally _expose() the result. The default of handle_events=true can be changed programatically via gst_x_overlay_handle_events(). Thanks to Fabrice Bellet for rebasing the patch. https://bugzilla.gnome.org/show_bug.cgi?id=711478 [dropped XInitThreads(), cleaned up the code a little] Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>