From: Jakub Adam Date: Mon, 24 Jan 2022 15:49:52 +0000 (+0100) Subject: ximagesrc: grab the server while capturing screen image X-Git-Tag: 1.22.0~666 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2125dbbd0b4751277207da45c5bccb4d30f2db20;p=platform%2Fupstream%2Fgstreamer.git ximagesrc: grab the server while capturing screen image Makes sure screen resolution doesn't change in the middle of the process. Part-of: --- diff --git a/subprojects/gst-plugins-good/sys/ximage/gstximagesrc.c b/subprojects/gst-plugins-good/sys/ximage/gstximagesrc.c index 484519f..3e379e1 100644 --- a/subprojects/gst-plugins-good/sys/ximage/gstximagesrc.c +++ b/subprojects/gst-plugins-good/sys/ximage/gstximagesrc.c @@ -911,12 +911,19 @@ gst_ximage_src_create (GstPushSrc * bs, GstBuffer ** buf) s->last_frame_no = next_frame_no; GST_OBJECT_UNLOCK (s); + XGrabServer (s->xcontext->disp); + 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; } image = gst_ximage_src_ximage_get (s); + XUngrabServer (s->xcontext->disp); + XSync (s->xcontext->disp, False); + if (!image) return GST_FLOW_ERROR;