These days the xserver seems to give us the same damage regions
over and over for entire windows, and we retrieve them multiple
times, which gives time for more damage to appear. Instead, just
quickly gather all damaged areas into a region list and copy
out once.
Use XQueryPointer to check that the pointer is actually active inside
the capturing region.
This prevents drawing the cursor when the pointer is partially outside
of the captured region but not active inside the region; in particular
this avoids drawing the "window resize" cursor shapes to the captured
image when the mouse pointer crosses a window border.
NOTE that this is not only an optimization, this also happen to fix
a serious problem in multi-screen setups.
Because XFixes gives no information of what screen the pointer is on,
ximagesrc was always drawing the cursor on the captured screen even if
the mouse pointer was on another screen.
For example, when capturing from screen 1 (i.e. display-name=":0.1") the
cursor was drawn in the captured image even when the mouse pointer was
actually on screen 0, which is wrong and visually confusing.
https://bugzilla.gnome.org/show_bug.cgi?id=690646
When the cursor is partially or totally out of the capturing region on
the top side or on the left side, it gets drawn fully inside of the
region with its coordinates rounded up to the left or to the top border.
This is immediately noticeable when using the xid property to capture
a specific window.
To fix the issue, allow negative cx and cx coordinates when checking the
boundaries before drawing the cursor.
NOTE that the boundaries checking calculations still allows the cursor
to be drawn when it is only partially outside of the capturing region,
but this makes sense and gives a more pleasing visual behaviour.
https://bugzilla.gnome.org/show_bug.cgi?id=690646
XFixes provides the cursor coordinates relative to the root window, this
is not taken into account when using the xid property to capture
a specific window, the result is that the cursor gets drawn at the wrong
position.
In order to fix this consider the window location when calculating the
cursor position in the destination image.
https://bugzilla.gnome.org/show_bug.cgi?id=690646
From time to time, when the image_pool list has more then 1 element
and I suppose at start, all but 1 pooled ximage are leaked. This is
due to broken algorithm in gst_ximagesink_src_ximage_get(). There was
also a risk of use after free for the case where the ximage size has
changed.
https://bugzilla.gnome.org/show_bug.cgi?id=728502
When setting timestamps on outgoing buffers, clear the
dts explicitly, otherwise it may end up being set to a
bogus value from last time it was used. Avoids every
second or so buffer's dts being set to 0. Not that it
should matter for raw video.
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We'll change these
over to the new API once we depend on glib >= 2.32.
A particular window may be selected using the new xid (X-Window
XID, eg a pointer) and xname (window title) properties. If both
are specified, the XID is used in preference, falling back to
xname if not found.
Default (if none of xid and xname are specified, or if no such
window is found) is to capture the root window.
https://bugzilla.gnome.org/show_bug.cgi?id=546932
This will ensure a logically new buffer does not keep flags from
a previous use of that buffer (eg, DISCONT would be set on the first
buffer, and mistakenly kept when reused).
https://bugzilla.gnome.org/show_bug.cgi?id=653709
ximagesrc: fix various width/height calculations being off by one,
and make it so a single pixel width/height can be captured (except
the top left one, as 0,0,0,0 is reserved for full screen as per
the property comments).
Instead of using BaseSrc default format GST_FORMAT_BYTES, send it in
GST_FORMAT_TIME.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Fixes#611659