mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
ximagesrc: grab the server while capturing screen image
Makes sure screen resolution doesn't change in the middle of the process. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1562>
This commit is contained in:
parent
c93afcc99c
commit
2125dbbd0b
1 changed files with 7 additions and 0 deletions
|
@ -911,12 +911,19 @@ gst_ximage_src_create (GstPushSrc * bs, GstBuffer ** buf)
|
||||||
s->last_frame_no = next_frame_no;
|
s->last_frame_no = next_frame_no;
|
||||||
GST_OBJECT_UNLOCK (s);
|
GST_OBJECT_UNLOCK (s);
|
||||||
|
|
||||||
|
XGrabServer (s->xcontext->disp);
|
||||||
|
|
||||||
if (gst_ximage_src_recalc (s) && !gst_base_src_negotiate (GST_BASE_SRC (s))) {
|
if (gst_ximage_src_recalc (s) && !gst_base_src_negotiate (GST_BASE_SRC (s))) {
|
||||||
|
XUngrabServer (s->xcontext->disp);
|
||||||
|
XSync (s->xcontext->disp, False);
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
image = gst_ximage_src_ximage_get (s);
|
image = gst_ximage_src_ximage_get (s);
|
||||||
|
|
||||||
|
XUngrabServer (s->xcontext->disp);
|
||||||
|
XSync (s->xcontext->disp, False);
|
||||||
|
|
||||||
if (!image)
|
if (!image)
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue