After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630525 - gloverlay: manage ratio for each texture, texture positioning fix
gloverlay: manage ratio for each texture, texture positioning fix
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
git master
Other Linux
: Normal normal
: 0.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-24 15:14 UTC by anthony
Modified: 2012-02-18 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Manage ratio for each texture in gloverlay (24.15 KB, patch)
2010-09-24 15:14 UTC, anthony
none Details | Review

Description anthony 2010-09-24 15:14:15 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.
Comment 1 Julien Isorce 2011-11-17 10:41:47 UTC
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