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 754107 - compositor: Inputs are "obscured" when they aren't
compositor: Inputs are "obscured" when they aren't
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.5.90
Other Linux
: Normal blocker
: 1.5.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-26 08:28 UTC by Jan Alexander Steffens (heftig)
Modified: 2015-08-28 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Actually use the output resolution for clamping (4.52 KB, patch)
2015-08-26 10:47 UTC, Nirbheek Chauhan
none Details | Review
Actually use the output resolution for clamping (4.20 KB, patch)
2015-08-26 10:48 UTC, Nirbheek Chauhan
none Details | Review
Actually use the output resolution for clamping (4.34 KB, patch)
2015-08-26 10:52 UTC, Nirbheek Chauhan
none Details | Review
Actually use the output resolution for clamping (4.35 KB, patch)
2015-08-26 11:00 UTC, Nirbheek Chauhan
none Details | Review
Actually use the output resolution for clamping (5.17 KB, patch)
2015-08-26 11:56 UTC, Nirbheek Chauhan
committed Details | Review

Description Jan Alexander Steffens (heftig) 2015-08-26 08:28:12 UTC
compositor 1.5.90 determines inputs are obscured when they are in fact disjoint.

GST_DEBUG=compositor:DEBUG gst-launch-1.0 videotestsrc ! comp.sink_0 videotestsrc ! comp.sink_1 compositor name=comp sink_0::width=640 sink_0::height=360 sink_1::width=640 sink_1::height=360 sink_1::xpos=640 sink_1::ypos=360 sink_1::zorder=0 ! video/x-raw,width=1280,height=720 ! autovideosink

I've augmented the debug message with the frame rect values:

compositor.c:494:gst_compositor_pad_prepare_frame:<comp:sink_1> (640+0,360+0) obscured by sink_0 (0+640,0+360), skipping frame

Seems the size of sink_1 isn't being calculated properly, ending up as 0x0.
Comment 1 Nirbheek Chauhan 2015-08-26 10:47:15 UTC
Created attachment 310013 [details] [review]
Actually use the output resolution for clamping

The obscured check in compositor was using the dimensions of the pad to clamp
the h/w of the pad instead of the output resolution, and was doing an incorrect
calculation to do so. Fix that by simplifying the whole calculation by using
corner coordinates.
Comment 2 Nirbheek Chauhan 2015-08-26 10:48:50 UTC
Created attachment 310014 [details] [review]
Actually use the output resolution for clamping

Fix a copy-paste error in the patch.
Comment 3 Nirbheek Chauhan 2015-08-26 10:52:04 UTC
Created attachment 310017 [details] [review]
Actually use the output resolution for clamping

Fix incorrect field in debug log; definitely done this time. ;)
Comment 4 Nirbheek Chauhan 2015-08-26 11:00:09 UTC
Created attachment 310019 [details] [review]
Actually use the output resolution for clamping

Did you believe me? I lied! Ha ha.

Sebastian pointed this out:

-  clamped.w = CLAMP (x2, 0, outer_width) - x;
-  clamped.h = CLAMP (y2, 0, outer_width) - y;
+  clamped.w = CLAMP (x2, 0, outer_width) - clamped.x;
+  clamped.h = CLAMP (y2, 0, outer_width) - clamped.y;

Probably done now.
Comment 5 Sebastian Dröge (slomo) 2015-08-26 11:14:20 UTC
Comment on attachment 310019 [details] [review]
Actually use the output resolution for clamping

Actually the test fails

elements/compositor.c:1335:F:general:test_obscured_skipped:0: Assertion 'buffer_mapped == FALSE' failed
Comment 6 Nirbheek Chauhan 2015-08-26 11:56:57 UTC
Created attachment 310026 [details] [review]
Actually use the output resolution for clamping

(In reply to Sebastian Dröge (slomo) from comment #5)
> Comment on attachment 310019 [details] [review] [review]
> Actually use the output resolution for clamping
> 
> Actually the test fails
> 
> elements/compositor.c:1335:F:general:test_obscured_skipped:0: Assertion
> 'buffer_mapped == FALSE' failed

Sorry for missing that. This was happening because zero-width/height frames were not being skipped. While doing that, I also made it so that the alpha == 0.0 check bails before all the obscured checks.
Comment 7 Sebastian Dröge (slomo) 2015-08-26 12:03:50 UTC
commit 9b59bb8630c8574da2a3b0db9c5cc530e7daa535
Author: Nirbheek Chauhan <nirbheek@centricular.com>
Date:   Wed Aug 26 15:40:16 2015 +0530

    compositor: Actually use the output resolution for clamping
    
    The obscured check in compositor was using the dimensions of the pad to clamp
    the h/w of the pad instead of the output resolution, and was doing an incorrect
    calculation to do so. Fix that by simplifying the whole calculation by using
    corner coordinates. Also add a test for this bug which fell through the cracks,
    and just skip all the obscured tests if the pad's alpha is 0.0.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754107