GNOME Bugzilla – Bug 630525
gloverlay: manage ratio for each texture, texture positioning fix
Last modified: 2012-02-18 20:02:38 UTC
Created attachment 171037 [details] [review] Manage ratio for each texture in gloverlay Fixes the following bugs: * the video and the image textures could not be positioned in the whole opengl window * allows changing the rendering's ratio without original textures deformation (both video and overlay image) by forcing their ratio The 2 bugs are linked to the addition of original opengl caps usage, therefore the unified patch. About textures positioning ========================= Textures positioning calculations were originally based on the overlay image's original size, whereas now it uses the real opengl caps's width and height. Example issue (before patch): with an 1024x768 png overlay and 1280x720 input video resolution, when xpos-png=100 the overlay texture was not positioned at the right of the rendering. About ratios ============ The opengl window's dimensions are the video texture's, thus preventing changing the rendering's ratio without deforming the video texture itself. The patch adds: * a ratio-video property which forces back the video texture's ratio in the opengl rendering; supported values are: original, 4:3, 16:9, 16:10 * overlay image ratio conservation by using the original file's ratio Example usage, where the file.mkv original ratio is 4:3 : gst-launch filesrc location=file.mkv ! decodebin ! ffmpegcolorspace ! videorate ! videoscale ! "video/x-raw-yuv, format=(fourcc)I420, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1, width=(int)1280, height=(int)720" ! glupload ! gloverlay location=test.png proportion-png=50 xpos-png=100 ypos-png=100 proportion-video=50 xpos-video=0 ypos-video=100 ratio-video=1 video-top=true ! glimagesink The trick is that the caps allow to modify the opengl window's dimensions to 1280x720, and the ratio-video property reverts the ratio changes by resizing the texture inside the rendering back to the specified ratio.
commit 6c8fd809d4bfe4adff64c173714934a0fd7e6371 Author: Anthony Violo <anthony.violo@ubicast.eu> Date: Thu Nov 17 11:39:50 2011 +0100 gloverlay: manage ratio texture Fix bug #630525