[{"id":28245,"web_url":"https://patchwork.libcamera.org/comment/28245/","msgid":"<9e50275a864dce95590a39700919ff427be51331.camel@ndufresne.ca>","date":"2023-12-05T16:06:57","subject":"Re: [libcamera-devel] [PATCH v2 0/3] gstreamer: Implement\n\trenegotiation","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Hi Jaslo,\n\nLe jeudi 30 novembre 2023 à 16:43 +0100, Jaslo Ziska via libcamera-devel a\nécrit :\n> Hi,\n> \n> in this revision I mostly implemented Nicolas' suggestions namely\n> writing a comment on the locking behaviour for\n> gst_libcamera_src_negotiate and using the correct types and putting\n> the addition of the clearRequests function into a seperate commit.\n> Also the gst_libcamera_src_negotiate function now clears the\n> reconfigure flag and thus not all pads need to be iterated when\n> checking for this flag in the running task.\n> \n> Another thing I changed is that in processRequest in the\n> GST_FLOW_NOT_NEGOTIATED case it is now checked whether any pad\n> actually requested a renegotiation and if not an error is returned.\n\nVery nice work. For the entire series:\n\nTested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\nThe test I have conducted is fairly minimal. I have tested the simple pipeline\nwith UVC camera, and a single pad for now. For this purpose, I have patched\nGStreamer v4l2src test software:\n\n\ndiff --git a/subprojects/gst-plugins-good/tests/examples/v4l2/v4l2src-\nrenegotiate.c b/subprojects/gst-plugins-good/tests/examples/v4l2/v4l2src-\nrenegotiate.c\nindex cae28d2d66..d31fe08a1f 100644\n--- a/subprojects/gst-plugins-good/tests/examples/v4l2/v4l2src-renegotiate.c\n+++ b/subprojects/gst-plugins-good/tests/examples/v4l2/v4l2src-renegotiate.c\n@@ -136,8 +136,8 @@ main (gint argc, gchar ** argv)\n \n   loop = g_main_loop_new (NULL, FALSE);\n \n-  desc = g_strdup_printf (\"v4l2src name=src device=\\\"%s\\\" io-mode=\\\"%s\\\" \"\n-      \"! capsfilter name=cf ! %s\", device, io_mode, videosink);\n+  desc = g_strdup_printf (\"libcamerasrc name=src \"\n+      \"! capsfilter name=cf ! %s\", videosink);\n   pipeline = gst_parse_launch (desc, &error);\n   g_free (desc);\n   if (!pipeline) {\n\n\nWith good visual output and serial showing:\n\n$> v4l2src-renegotiate -s glimagesink\nSetting resolution to '320x240'\n[122:15:30.282196360] [691281]  INFO IPAManager ipa_manager.cpp:143 libcamera is\nnot installed. Adding '/home/nicolas/Sources/libcamera/build/src/ipa' to the IPA\nsearch path\n[122:15:30.282921702] [691281]  INFO Camera camera_manager.cpp:284 libcamera\nv0.1.0+130-be11e882-dirty (2023-12-04T16:20:46-05:00)\n[122:15:30.803772071] [691293]  INFO Camera camera.cpp:1183 configuring streams:\n(0) 320x240-YUYV\nSetting resolution to '1280x720'\n[122:15:34.232874025] [691293]  INFO Camera camera.cpp:1183 configuring streams:\n(0) 1280x720-YUYV\nSetting resolution to '640x480'\n[122:15:37.238145227] [691293]  INFO Camera camera.cpp:1183 configuring streams:\n(0) 640x480-YUYV\n[122:15:37.920471727] [691292]  INFO V4L2 v4l2_videodevice.cpp:1820\n/dev/video2[20:cap]: Zero sequence expected for first frame (got 2)\n\n\nWe probably want a similar tool or test in libcamera itself though. It just a\nlittle difficult, since it so tied to the capabilities of the underneath\nhardware. If anyone have suggestions, this would be welcome, I would probably\nnot block this meanwhile. If C is not a problem to folks here, I'd be happy to\njust copy over that modified example. Or I suppose its simple enough that it\ncould be ported to C++.\n\nregards,\nNicolas\n\n> \n> Regards,\n> \n> Jaslo\n> \n> Jaslo Ziska (3):\n>   gstreamer: Move negotiation logic to separate function\n>   gstreamer: Add GstLibcameraSrcState::clearRequests method\n>   gstreamer: Implement renegotiation\n> \n>  src/gstreamer/gstlibcamerasrc.cpp | 263 ++++++++++++++++++------------\n>  1 file changed, 158 insertions(+), 105 deletions(-)\n> \n> --\n> 2.43.0","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 016ABC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Dec 2023 16:07:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5C5AA61D9F;\n\tTue,  5 Dec 2023 17:07:03 +0100 (CET)","from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com\n\t[IPv6:2607:f8b0:4864:20::f2b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 20D6161D9B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Dec 2023 17:07:01 +0100 (CET)","by mail-qv1-xf2b.google.com with SMTP id\n\t6a1803df08f44-67ad531686eso12989676d6.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Dec 2023 08:07:01 -0800 (PST)","from nicolas-tpx395.localdomain ([2606:6d00:17:b5c::7a9])\n\tby smtp.gmail.com with ESMTPSA id\n\t15-20020ad45b8f000000b0067aa31371ddsm3823947qvp.80.2023.12.05.08.06.59\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 05 Dec 2023 08:06:59 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701792423;\n\tbh=VwNmA5KToHKdNOixBD51QvMDjidQP+FD9cIOTGqeku0=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=ca0cbREYUcn+DP7kWVvsWilk2/TQspw5BOx1yzncMa2wivDvPMn4cXOLBDcb2EbWy\n\tmlZhHhZmNH1Y7xWk0w78JL93vhgxpAqQqg5tozwn4KWXH+55oB33ciT7kPYoi77bBJ\n\tZhNVgc3DvBkr8fdmDwxCaEld65XgdK9sMOy8JZofaVlfAQxx9JGftD+Nw0+ys4ifuv\n\tASaZ9yYWFJCQ6eKeKMBLmIEgC4Qyf2UeZSUOSHcqhokt1Sz8lb4wK9Sn2i45nDilIE\n\tApbOV8eN6dfWnYHqdPSGPAxA0MOcXFemQylLsTV8uVWdAN4vcqyryAbrAQrjoeMg4P\n\tq6Lvtk4OzW3/g==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1701792420;\n\tx=1702397220; darn=lists.libcamera.org; \n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=mch1PK80tn//wi+LUXonCgdVvCoSJQoCzObgPkFaK+8=;\n\tb=aU4LNO5O+0d0dpkCOZyJLtM39BCNnEXWOIwFQ7o7fO31LC1J8Xlnm+xA4iwJU79aEQ\n\tDQgRBk7YXBL8duPIapP1mXQfmmwae9Vdn1zg9LHlJvImyA2hVwK9jlBzBDDNwLJhrHcL\n\tx5OtlJFgrZhKjiPAV67DW72/Ou78Bagyd5vi6AI6Lozf502mDN/iEXoSYnT1JbcEwvPm\n\tJGL472AFA+DARgYGKZB1iqEGI7dvqMVON9QmS1Y+4LNXrPVSp0aExa3CY9Mva3/af+C5\n\tO4UOyUMdqJaec2xkscV1d5qOVxLiGyeM8+t70vmjylwqIqubnOZ6LbtMcCHk4mLN0mwL\n\t5BsA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ndufresne-ca.20230601.gappssmtp.com\n\theader.i=@ndufresne-ca.20230601.gappssmtp.com header.b=\"aU4LNO5O\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1701792420; x=1702397220;\n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=mch1PK80tn//wi+LUXonCgdVvCoSJQoCzObgPkFaK+8=;\n\tb=vZk7OaX4MOp5I+oNIwA8LiomDe+K4ro8cpK5j2kBOEDqSkQNcNniMgIUGUhbctM0B9\n\tQ2axESAEyVHwFvTUpY6J7fBCi7sIL/3LYNnRp3wEyLF9nQgm6av3hnwtU8iKhuEZ1dVG\n\tE8n7dYhfIZSnFc/FCZX/9LqyjTWcMaWKxjo0Kd+mILdsV4hY3f3dzkqlA56+7yCBbfRN\n\tdRhKpPy2OtavXfMPtBRXyz0+wnb2YtP2j7Rz9uYX97ZrDjc+51vi2BeMCtu2nIEXM399\n\tmSK+hBSpWf5K7Opa67wFFMeW7x2Ec1gS1bxI8Gw+H3RZJnWZYYZeNBf5HlAnDbffzL4p\n\tiVEA==","X-Gm-Message-State":"AOJu0Ywi31uIURt3vM3ijgHc2Z4YHFg5FOI+mhiREZfc5om0nfk9i/yd\n\tnfKEZd9d6bQXvw3jLGvuqLMVII70rYTz/vm2pZ0=","X-Google-Smtp-Source":"AGHT+IHPUOIY3p2YdFOsA68IakSHLsG2VoCdoO5hOgQ5IQTakVGjnf0r1NuhZnwHHOcMuaoyNk0nNw==","X-Received":"by 2002:a05:6214:e6f:b0:67a:d96a:d6f9 with SMTP id\n\tjz15-20020a0562140e6f00b0067ad96ad6f9mr2095344qvb.33.1701792419790; \n\tTue, 05 Dec 2023 08:06:59 -0800 (PST)","Message-ID":"<9e50275a864dce95590a39700919ff427be51331.camel@ndufresne.ca>","To":"Jaslo Ziska <jaslo@ziska.de>, libcamera-devel@lists.libcamera.org","Date":"Tue, 05 Dec 2023 11:06:57 -0500","In-Reply-To":"<20231130155323.13259-1-jaslo@ziska.de>","References":"<20231130155323.13259-1-jaslo@ziska.de>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.48.4 (3.48.4-1.fc38) ","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [PATCH v2 0/3] gstreamer: Implement\n\trenegotiation","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]