GNOME Bugzilla – Bug 754107
compositor: Inputs are "obscured" when they aren't
Last modified: 2015-08-28 18:27:58 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.
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.
Created attachment 310014 [details] [review] Actually use the output resolution for clamping Fix a copy-paste error in the patch.
Created attachment 310017 [details] [review] Actually use the output resolution for clamping Fix incorrect field in debug log; definitely done this time. ;)
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 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
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.
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