[{"id":25713,"web_url":"https://patchwork.libcamera.org/comment/25713/","msgid":"<adb568ba-932c-d94b-889c-246dc0690d70@ideasonboard.com>","date":"2022-11-02T11:33:28","subject":"Re: [libcamera-devel] [PATCH v5 1/2] gstreamer: Configure the\n\tcamera before exposing the caps.","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Rishi,\n\nThank you for the patch.\n\nOn 9/15/22 5:17 PM, Rishikesh Donadkar wrote:\n> Configure the camera before exposing the caps so that the stream configuration\n> and valid controls values (and bounds) are available, required to expose the new caps.\n> controls::FrameDurationLimits is one such example.\n>\n> Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com>\n\nI would repharse the commit message to expand a bit on why we need to do \nit before caps are exposed.\n\nOther than, code wise looks good to me and I've also tested for no \nregressions so,\n\nTested-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/gstreamer/gstlibcamerasrc.cpp | 19 ++++++++++---------\n>   1 file changed, 10 insertions(+), 9 deletions(-)\n>\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 16d70fea..60032236 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -515,6 +515,16 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>   \t\tgoto done;\n>   \t}\n>   \n> +\tret = state->cam_->configure(state->config_.get());\n> +\tif (ret) {\n> +\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> +\t\t\t\t  (\"Failed to configure camera: %s\", g_strerror(-ret)),\n> +\t\t\t\t  (\"Camera::configure() failed with error code %i\", ret));\n> +\t\tgst_task_stop(task);\n> +\t\tflow_ret = GST_FLOW_NOT_NEGOTIATED;\n> +\t\tgoto done;\n> +\t}\n> +\n>   \t/*\n>   \t * Regardless if it has been modified, create clean caps and push the\n>   \t * caps event. Downstream will decide if the caps are acceptable.\n> @@ -535,15 +545,6 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n>   \t\tgst_pad_push_event(srcpad, gst_event_new_segment(&segment));\n>   \t}\n>   \n> -\tret = state->cam_->configure(state->config_.get());\n> -\tif (ret) {\n> -\t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n> -\t\t\t\t  (\"Failed to configure camera: %s\", g_strerror(-ret)),\n> -\t\t\t\t  (\"Camera::configure() failed with error code %i\", ret));\n> -\t\tgst_task_stop(task);\n> -\t\treturn;\n> -\t}\n> -\n>   \tself->allocator = gst_libcamera_allocator_new(state->cam_, state->config_.get());\n>   \tif (!self->allocator) {\n>   \t\tGST_ELEMENT_ERROR(self, RESOURCE, NO_SPACE_LEFT,","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 C5B4BBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  2 Nov 2022 11:33:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 339E063064;\n\tWed,  2 Nov 2022 12:33:37 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 06DDD63036\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  2 Nov 2022 12:33:36 +0100 (CET)","from [192.168.1.108] (unknown [103.251.226.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B01E31226;\n\tWed,  2 Nov 2022 12:33:33 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1667388817;\n\tbh=h/fdmm640NKCLEocZ+cSFhb+WhYKviPY/UTL0x8Nutg=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=kVtkfxmKvJ86XZMluMYctre8sWv27C666CWZIwpiRLBx3o89yqua0Zk/pDaqksoIS\n\tYnuLoHccFNS+XMkp67RiJxWO4zlusrcXSvZVwoGWC+yWoUizDha5ocXgYQuBbzqXzn\n\tCudeSbVJnwKnJ//e4u2ho5fCMrubOpFIeylixGaTNqpeB3XtP/jcZnT8ckY14DQUeP\n\tNeTW1qcBO68QvWgvgkAIHM2nIS1YeaM4W5d+b6HEvrvnAyIiLOJPaTksZCOxY+x3Fb\n\t4PSvlgCrBuMwKRIJKlIwOCtmv1QkGTdn0/y5WmUSCpDTwgP+5p3eSRC+zhVpfdnnPi\n\tHACkU/fdxMl3w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1667388815;\n\tbh=h/fdmm640NKCLEocZ+cSFhb+WhYKviPY/UTL0x8Nutg=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=WZ1mizKHwl0+IHqXCdM2IB8RqvySriBAY6qD4LrNTWgNIqvkWyfKSB0Tdlt+gZDmd\n\tSt0kMlPrT0OSm07dmU3i44FPGQZ0EiCjw47uitx84BovbZ7XJNbIQKwkZn3CsWdKi1\n\teCKHmMXh53z1/BPxuRKyPD+yl76p13gFVxoSUnTY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WZ1mizKH\"; dkim-atps=neutral","Message-ID":"<adb568ba-932c-d94b-889c-246dc0690d70@ideasonboard.com>","Date":"Wed, 2 Nov 2022 17:03:28 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.2.1","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220915114734.115572-1-rishikeshdonadkar@gmail.com>\n\t<20220915114734.115572-2-rishikeshdonadkar@gmail.com>","Content-Language":"en-US","In-Reply-To":"<20220915114734.115572-2-rishikeshdonadkar@gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v5 1/2] gstreamer: Configure the\n\tcamera before exposing the caps.","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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"nicolas.dufresne@collabora.com, vedantparanjape160201@gmail.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]