GNOME Bugzilla – Bug 766538
glimagesink: New signal for after redraw has happened
Last modified: 2016-09-22 07:48:04 UTC
Created attachment 328030 [details] [review] Draw-final callback in glimagesink Here is a patch against head to add a callback to the glimagesink plugin after redraw has occurred. It seems to be a no-risk patch and add a very handy feature if one wants to add a complex overlay in opengl after the redraw has occurred - for instance an overlay that can't be done with the gstreamer overlay feature which is great but very basic.
You probably also want to add this to glsinkbin and others. Why can't your use-case be done with client-draw?
My case is really to add an overlay after the frame has been rendered. I don't touch the frame content and its rendering. So I prefer to let Gstreamer does the frame rendering (it's well optimized and if something changes in the future, it will be in the glimagesink code) and once it's done, I paint my opengles stuff. In a sense, my use case is very similar to this gstreamer feature that can do overlay on top of glimagesink (I don't recall the name and I can't find it). I experimented but my overlay is pure opengles so it was too limiting.
That doesn't sound very different to how the client-draw signal is used elsewhere, e.g. in the examples to render the video on a cube. Maybe a name like client-draw-finished would make it more explicit though when this is called.
client-draw-finished naming would make more sense indeed.
For overlay's I would strongly suggest you implement/use an overlay element in your pipeline with the meta:GstVideoOverlayCompositionMeta which glimagesink understands. If overlaying is the only reason you want this signal, IMHO this is not really necessary and will be marked WONTFIX.
That's exactly my point! In comment #2, I was searching for this name: GstVideoOverlayCompositionMeta. I tried to use GstVideoOverlayCompositionMeta but you can't do a complex overlay involving opengles. You can insert a png file and stuff like that which is great, but you can't overlay code that involves opengles. This signal is to extend GstVideoOverlayCompositionMeta when this feature is too limited.
You can create your own element that will create the overlay for the stream. Another more extensible option is to use glvideomixer and compose your stream that way. Adding another signal is not the right way to approach this when there are multiple other mechanisms for this exact problem.
Marking as WONTFIX. If a use case can be created for this that isn't covered by the above comment, then please reopen.