{"id":17369,"url":"https://patchwork.libcamera.org/api/patches/17369/?format=json","web_url":"https://patchwork.libcamera.org/patch/17369/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220915114734.115572-2-rishikeshdonadkar@gmail.com>","date":"2022-09-15T11:47:33","name":"[libcamera-devel,v5,1/2] gstreamer: Configure the camera before exposing the caps.","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"d78143dd95fdd32b1dd3e4c27b716ad6df5c4303","submitter":{"id":118,"url":"https://patchwork.libcamera.org/api/people/118/?format=json","name":"Rishikesh Donadkar","email":"rishikeshdonadkar@gmail.com"},"delegate":{"id":12,"url":"https://patchwork.libcamera.org/api/users/12/?format=json","username":"uajain","first_name":"Umang","last_name":"Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/17369/mbox/","series":[{"id":3487,"url":"https://patchwork.libcamera.org/api/series/3487/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3487","date":"2022-09-15T11:47:32","name":"Provide framerate support for libcamerasrc","version":5,"mbox":"https://patchwork.libcamera.org/series/3487/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17369/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17369/checks/","tags":{},"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 463A9C327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Sep 2022 11:47:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8FAF061FB3;\n\tThu, 15 Sep 2022 13:47:55 +0200 (CEST)","from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com\n\t[IPv6:2607:f8b0:4864:20::1030])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65BC66099D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Sep 2022 13:47:54 +0200 (CEST)","by mail-pj1-x1030.google.com with SMTP id\n\td64-20020a17090a6f4600b00202ce056566so12665192pjk.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Sep 2022 04:47:54 -0700 (PDT)","from localhost.localdomain ([49.36.99.120])\n\tby smtp.googlemail.com with ESMTPSA id\n\tx15-20020a170902a38f00b001785dddc703sm3718994pla.120.2022.09.15.04.47.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 15 Sep 2022 04:47:52 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663242475;\n\tbh=3PrOpcMHKuVTmV6dZUUgk0vGdiEauDJiNYP7MTKjSPU=;\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:Cc:\n\tFrom;\n\tb=WcFuONH6SR7DDPv2w5m0UlBiIheRCwzTePUtq/o4z38/XGPyu5hA0i5Bh1l82jssn\n\tvU+XpBiesxSPxPIldOkTaBrM7SK3Iv/qNDzOBnq5396k7nT3m/ewvzE6o9n9SzHkp6\n\thudlqYrr8C6HNGg83NFoH/InfwHXyNyG9a9XfnYhbZg13Xni5Ci4Z+QjOyaOYfQK0O\n\tsmjz58a7MSKZTk+ctfiarADu1QOYUqC2zUI3GOFkZ9xQf4ndGWZUBK/nzc9v/Qgpad\n\t0igqW5nmPztu6H4K5uP9I9/51OZnrb55lFZe1fb6wnwX6zIuGuPYjqaHN86ejnsmUn\n\ttA6Yglv44vasg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date;\n\tbh=61amfx/e5WCv0tdVn2IILwDw2qXiwc/7NBbx0UUGqzY=;\n\tb=qRJ+nyLtbtma9jHa1WKhhHyqTwfwJ7XyPw0Pn1ahoe3MYY8Aynxy6XPXuZ8lzoJEaW\n\tdc0hnyAJY3tRYTgqIW7U9jvHGWf3qxiSOrHk3ROyooQgDFPb8LyGwDW7/Etl5cU6Nd0K\n\thTf3f0zMgJCi1SMV+d591KFSrA7bU+bkqZ5GrZxhUCvIfyPDPpMSN/yPV6k4dx7ACUOW\n\t2Vi33oevB1Kxp7IW+9sFPXhVK5ZkixHkCuaiPNvDad99jqKbahsMHq7fUz/MxM3cfvlo\n\tTfsywfzaSsIyg6hYLLgUs+oxFXYljnCxTstdtrfWC9ZYKMr+oNSSCRH5h7tauFUZFpWt\n\t6oGw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"qRJ+nyLt\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date;\n\tbh=61amfx/e5WCv0tdVn2IILwDw2qXiwc/7NBbx0UUGqzY=;\n\tb=jpkjWOUZTUCh0kSDbUdt1Qw6iScDfCjxEZQw/eDn6mgbTwW6sNB/wZhhEemAuP5X48\n\tHq6NercdZOIlXN3tiNp3vvmbCsm22IedRSUEkFvcXnIoPKZHNuiZycluPXOkzHJ4G7+n\n\t820jvtY1c9//+HegUj/7BPLvRZ7AZHIXcKSsxPQ/MBo4+bOmodlmIgL1iMzhdOwVFX7+\n\tYZ5mquVMzgrxmb94+0+xYthdc0RXb/9A2/vpMwq3cQNpwixPkygHKVRZDjb3yOr58Mtd\n\tSc8v0GFkLqEbNE13VUjjUE6q15d3Hko3v3Zg7kITtZIxVK+nPW9gMAYKkZYI+8sIdqv1\n\tUswQ==","X-Gm-Message-State":"ACrzQf3algHx0Ykvng27sJT60yLKpWQcc06utbhNfoDmfmxo3AzFvOeT\n\tdlfP4nCSe4h7JbrP+9AykfO8BTDdxGJ93g==","X-Google-Smtp-Source":"AMsMyM7kAyUfuufT8z+1Co7h4si1kqEJE5ILa8Y7N2xbMilBq97RVRiX+crewi67HTzDc5kCqifhYQ==","X-Received":"by 2002:a17:902:ea11:b0:176:b283:9596 with SMTP id\n\ts17-20020a170902ea1100b00176b2839596mr3831907plg.69.1663242472466; \n\tThu, 15 Sep 2022 04:47:52 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 15 Sep 2022 17:17:33 +0530","Message-Id":"<20220915114734.115572-2-rishikeshdonadkar@gmail.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220915114734.115572-1-rishikeshdonadkar@gmail.com>","References":"<20220915114734.115572-1-rishikeshdonadkar@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 1/2] gstreamer: Configure the camera\n\tbefore 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":"Rishikesh Donadkar via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.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>"},"content":"Configure the camera before exposing the caps so that the stream configuration\nand valid controls values (and bounds) are available, required to expose the new caps.\ncontrols::FrameDurationLimits is one such example.\n\nSigned-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com>\n---\n src/gstreamer/gstlibcamerasrc.cpp | 19 ++++++++++---------\n 1 file changed, 10 insertions(+), 9 deletions(-)","diff":"diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex 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,\n","prefixes":["libcamera-devel","v5","1/2"]}