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 757292 - gdkpixbufoverlay: relative-x/y properties
gdkpixbufoverlay: relative-x/y properties
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.10.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-29 09:55 UTC by Nicola
Modified: 2016-11-24 11:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
image that show the problem (242.93 KB, image/png)
2015-10-29 09:55 UTC, Nicola
  Details
Patch file (2.08 KB, patch)
2016-10-17 11:48 UTC, Baby octopus
needs-work Details | Review
Updated patch (2.56 KB, patch)
2016-10-26 06:50 UTC, Baby octopus
none Details | Review
Reworked patch (2.72 KB, patch)
2016-10-26 07:17 UTC, Baby octopus
committed Details | Review

Description Nicola 2015-10-29 09:55:26 UTC
Created attachment 314373 [details]
image that show the problem

please test this pipeline using the provide png

videotestsrc ! gdkpixbufoverlay location=/tmp/pipeline.png overlay-width=200 overlay-height=120 relative-x=0.1 relative-y=0.1 ! xvimagesink

the logs says something like this:

0:00:00.128700446  4858      0x10040a0 DEBUG       gdkpixbufoverlay gstgdkpixbufoverlay.c:588:gst_gdk_pixbuf_overlay_update_composition:<gdkpixbufoverlay0> overlay rendered: 200 x 120 @ 494,66 (onto 320 x 240)

and no overlay is rendered

changing 

overlay->offset_x + (overlay->relative_x * overlay_meta->width);

with 

overlay->offset_x + (overlay->relative_x * video_width);

here:

http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/ext/gdk_pixbuf/gstgdkpixbufoverlay.c#n569

and doing the same for the y 

this log is showed

0:00:00.143735692  4866       0xc930a0 DEBUG       gdkpixbufoverlay gstgdkpixbufoverlay.c:591:gst_gdk_pixbuf_overlay_update_composition:<gdkpixbufoverlay0> overlay rendered: 200 x 120 @ 32,24 (onto 320 x 240)

and the overlay is rendered as expected,

I'm not sure if I have correctly understand how these properties are supposed to work

please advise if you want a patch or update the docs to be more clear,

thanks
Comment 1 Baby octopus 2016-10-17 11:48:59 UTC
Created attachment 337833 [details] [review]
Patch file
Comment 2 Baby octopus 2016-10-17 11:49:39 UTC
There were multiple issues

width and height(overlay_width, overlay_height) to be used instead of Overlay Image's width and height

video_width and video_height to be used while multiplying with relative_* properties

The attached patch works for me
Comment 3 Sebastian Dröge (slomo) 2016-10-20 11:03:16 UTC
Comment on attachment 337833 [details] [review]
Patch file

Please provide a patch in "git format-patch" format with an appropriate commit message to explain what this fixes and how and how it was wrong.
Comment 4 Baby octopus 2016-10-26 06:50:21 UTC
Created attachment 338472 [details] [review]
Updated patch

Hi, the git format-patch is updated with appropriate commit message
Comment 5 Sebastian Dröge (slomo) 2016-10-26 07:10:21 UTC
Comment on attachment 338472 [details] [review]
Updated patch

The commit message should be in the format:

> gdkpixbufoverlay: one line summary
> [empty line]
> multi-line explanation what was wrong, how it was fixed
> and why the fix is correct
> [empty line]
> https://bugzilla.gnome.org/.... [link to this bug]


Otherwise seems to make sense to me
Comment 6 Baby octopus 2016-10-26 07:17:51 UTC
Created attachment 338473 [details] [review]
Reworked patch

Here it is :)
Comment 7 Sebastian Dröge (slomo) 2016-11-01 18:09:46 UTC
commit bb21c885168f934a52cff4ee86ae2b2652449f16
Author: Jagadish <jagadishkamathk@gmail.com>
Date:   Wed Oct 26 12:46:28 2016 +0530

    gdkpixbufoverlay: Fixing x and y offset computation
    
    While computing the x and y offsets, it's the video resolution and
    resized overlay resolution to be used instead of actual overlay image
    resoltuion. Due to this, the overlay image used to get wrongly overlayed
    in undesired location
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757292