From patchwork Sat Jul 17 18:28:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 13033 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8345BC0109 for ; Sat, 17 Jul 2021 18:29:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C03B268516; Sat, 17 Jul 2021 20:29:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="paL3IZBu"; dkim-atps=neutral Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 574DF6027B for ; Sat, 17 Jul 2021 20:29:13 +0200 (CEST) Received: by mail-pg1-x533.google.com with SMTP id u14so13717631pga.11 for ; Sat, 17 Jul 2021 11:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jba7hdzU6saWWlm150Xex6/yi4b4iC/zK83JsjffSQ0=; b=paL3IZBue6DYWRKZAHl7MGg2tEBvqQLKqzJTIkjg0W0gEZK41+UUuuW/o2/CJqfDjQ SxTkTO1LJQLleAwvKSI8pcL1a9/RyrfVLPFR54BE+MvSoPvUxPaFpMe3GIMzeXRsllOp fzmbRCIT3CeYygNiRufcTYfz5JqtIW8hPX0qWifIZ5oovwuhQVgeeDAbmZeVY4cJOwqv MFWru1X1HPrjvfQSGLspRZVaOzFH7Nmp81h92Od3MuFjQlkfYr1lKneo+laCx13qLEew 2Dx+iCEPuom1IJO1Ilz3ELejKf9xVAlEp+2Vs8qBvKmZ9QfkUyUWtyvo8F7bvkNS65XM mW/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jba7hdzU6saWWlm150Xex6/yi4b4iC/zK83JsjffSQ0=; b=l4gVTSxMPqw6gEC66Z4nx5ORc20U8A7qRfNfIMxjU5nf8w25Y3gQkt4BHNMfFZDbJ9 gPk1kmRefDB+eb/QWbebzEF8lLkPZvFmQbyTud/ipAMZXZIdUfAIybBeW+jFIIQI1cTo jFHTiWKr4fH7vxTj7lVqO3pEPQiiS+t3HXsGDYYSd7WCCDNnTuFi2HJIkqCQ4t+kBcxy 4h4Ds+0vQATNKoBZYGO5+SfF3p54oNxn6HpgRYxlGJJGOfzeP5U0Yjlu2pExBUWZKC3Y SB7hybahuu+QmjXW9LRkVkOMJnLucQw4yOdmQo65wCEhePWKuguyX42FUejLKcH99kuH bPcQ== X-Gm-Message-State: AOAM533YhffAbm4Ddfvw/YdywegzkopDcjikCuZWDI3zxGh5/aSrtq9z 18+qoZyZpAdOnjETPl0U1bqzWbjnlgUQHm4i X-Google-Smtp-Source: ABdhPJzUjEjHhleoU2qVdQkc39NBbZyNDutO9uT2yppDjenXoia9UuqJ1ZlCUnEqEtkUr64YcCvDgw== X-Received: by 2002:a63:383:: with SMTP id 125mr16254953pgd.208.1626546551420; Sat, 17 Jul 2021 11:29:11 -0700 (PDT) Received: from localhost.localdomain ([1.186.166.91]) by smtp.googlemail.com with ESMTPSA id b19sm11633028pjh.29.2021.07.17.11.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 11:29:11 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Sat, 17 Jul 2021 23:58:50 +0530 Message-Id: <20210717182850.737833-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1] gstreamer: Store group_id in GstLibcameraSrcState X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This patch adds group_id in GstLibcameraSrcState, since group_id is something which should be same for all the pads, it can be reused later. Signed-off-by: Vedant Paranjape --- src/gstreamer/gstlibcamerasrc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index ea53c2b5..ad3c692f 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -113,6 +113,7 @@ struct GstLibcameraSrcState { std::unique_ptr config_; std::vector srcpads_; std::queue> requests_; + guint group_id_; void requestCompleted(Request *request); }; @@ -360,7 +361,9 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread, GST_DEBUG_OBJECT(self, "Streaming thread has started"); - guint group_id = gst_util_group_id_next(); + if (state->group_id_ == 0) { + guint group_id = gst_util_group_id_next(); + } gint stream_id_num = 0; StreamRoles roles; for (GstPad *srcpad : state->srcpads_) { @@ -636,6 +639,7 @@ gst_libcamera_src_init(GstLibcameraSrc *self) state->srcpads_.push_back(gst_pad_new_from_template(templ, "src")); gst_element_add_pad(GST_ELEMENT(self), state->srcpads_[0]); + state->group_id_ = 0; /* C-style friend. */ state->src_ = self;