GNOME Bugzilla – Bug 654537
Add container for video textures
Last modified: 2013-11-15 18:04:35 UTC
This is a clone of bug http://bugzilla.clutter-project.org/show_bug.cgi?id=2626 Something similar to the MxAspectFrame that would allow to: - keep the texture's aspect ratio - allow clipping/cropping (similar to the "expand" property in MxAspectFrame) - handles rotation and rotation animations properly (eg. allows for 90 degrees and multiples rotation, make rotation smooth through animation/resize) ------- Comment #1 From Damien Lespiau 2011-04-05 06:24:22 [reply] ------- - Zoom factor (to be on par with totem current features) - Draw the black quads when in pillarbox/letterbox. This is to limit the overdraw in the current solution (clear the color buffer + video on top = we end up touching the pixels of the video twice instead of doing 3 quads, 2 of them with a black material, and one in the center for the video). With this you could set up the "no clear" hint on the stage to disable the glClear(). ------- Comment #2 From Bastien Nocera 2011-04-05 07:30:37 [reply] ------- (In reply to comment #1) > - Zoom factor (to be on par with totem current features) Totem doesn't use it anymore, just the equivalent of the expand property (which is would be awesome to have animated).
(In reply to comment #0) > This is a clone of bug http://bugzilla.clutter-project.org/show_bug.cgi?id=2626 > > > Something similar to the MxAspectFrame that would allow to: > - keep the texture's aspect ratio Done in TotemAspectFrame > - allow clipping/cropping (similar to the "expand" property in MxAspectFrame) Done in TotemAspectFrame > - handles rotation and rotation animations properly (eg. allows for 90 degrees > and multiples rotation, make rotation smooth through animation/resize) Emmanuele mentions that this should be implemented similarly to ClutterScrollActor, overriding apply_transform() and changing cogl_matrix_translate() to cogl_matrix_rotate(). I've implemented this slightly differently, and with a few FIXMEs that we already had in the orientation plugin. > ------- Comment #1 From Damien Lespiau 2011-04-05 06:24:22 [reply] ------- > - Zoom factor (to be on par with totem current features) Removed. > - Draw the black quads when in pillarbox/letterbox. This is to limit the > overdraw in the current solution (clear the color buffer + video on top = we > end up touching the pixels of the video twice instead of doing 3 quads, 2 of > them with a black material, and one in the center for the video). With this you > could set up the "no clear" hint on the stage to disable the glClear(). Damien, do we still have that? Where does the code that does that live? Would be nice to get fixed. > ------- Comment #2 From Bastien Nocera 2011-04-05 07:30:37 [reply] ------- > (In reply to comment #1) > > - Zoom factor (to be on par with totem current features) > > Totem doesn't use it anymore, just the equivalent of the expand property (which > is would be awesome to have animated). It's animated now.
This is all done (and working properly) in TotemAspectFrame, thanks Lionel and Damien.
We have a similar feature on master (aspect ratio + black quads) but still missing the zoom bit. And of course you can rotate the actor in any direction you would like.
As you've seen, rotation isn't exactly trivial.
In the case of Totem, yes. But that's a corner case of being able to rotation an actor :) Have a look at : https://git.gnome.org/browse/clutter-gst/tree/examples/video-flip2.js
Just implemented the "zoom" on master : https://git.gnome.org/browse/clutter-gst/commit/?id=69f3f007e09797902e1a293aa277e758d5757d7b