From patchwork Tue Jul 20 17:35:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 13063 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 19F55C322B for ; Tue, 20 Jul 2021 17:36:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C78366852A; Tue, 20 Jul 2021 19:36: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="SzKuJh7N"; dkim-atps=neutral Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C952168521 for ; Tue, 20 Jul 2021 19:36:14 +0200 (CEST) Received: by mail-pj1-x1029.google.com with SMTP id p4-20020a17090a9304b029016f3020d867so13741pjo.3 for ; Tue, 20 Jul 2021 10:36:14 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=hk0FDmlWPCvHCNDSgXUbYjreQYjOCPgDYaZf1XT8LW8=; b=SzKuJh7NUuMSW7srn2LOG7a8ZCjbcuF0FZ8R3a9VnfmZOplhkBCYLuZell2e3R0xQs fKQk0cC3ckJDOw7vNkpNUh8355WzDwReOzVuf27NKliHZWbQD7B+XSnNUArjXQa4y7wb uSQenTP61LK0GnPin3/rW35IKkvbfqSQm2PrOL5Ubl4aYH9bya8QhaS3BA19bFsPscCM v1jWp+ENcGykIwAoo1ZQXivS6F4Oa0p/ANtgJ2wU4gwIjFiLHDJNQaLV890dJKlPVL8S vnRlfOfTanID0bhhFNqAg6XYiWV+W4v7eZYpjx8R8bPbzyeO6q+HXUN0L2AQA6V+SFkT WilQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hk0FDmlWPCvHCNDSgXUbYjreQYjOCPgDYaZf1XT8LW8=; b=JfCM7eHgefSL3ar9mQcAVOctF4S8jOIe6UjpeJZWm6/oge+aH6oD3gHErQaVTOqJ6c yETWCFnmPbB2S0PaC8884JPYXeW1x9vva9TMOzjCXNF4H3NZTxxydTeNWrrY24e4nwpK uTDX5CcVfvf5PeXJFpd5zit1wu8cmcdVjmkaMs3FLmBvS0l7BOq0hZhbwCnRp39oT0T2 UdyTA+O5fjFbcbjipWtRu30QLUEisV8ox2Iz18wGaq1T41Fc+C3qebDxAnUBM7GHgePF YVNvdP9g/VfMCGjkmOgxqTEU4URTYNj/Vurgd6xbVXoL910B/B9pv/V9Z3r/bvUCQkr1 bX8g== X-Gm-Message-State: AOAM530cRbWVt5D0clrOp2uHqzix486jgQuPxtTTtE9VpLEwizJr3odv tmjW/fXMthtVTUw7tdvbGYpXSzObqv2/cQ== X-Google-Smtp-Source: ABdhPJx1/u+dgeSbuRG3oxQ/WaNIKgCjUQmAxnQGm45qZAM3W6rR87QTCKUKmIM4Hu7YmwEvngLDOQ== X-Received: by 2002:a17:90a:2f63:: with SMTP id s90mr36035988pjd.168.1626802573068; Tue, 20 Jul 2021 10:36:13 -0700 (PDT) Received: from localhost.localdomain ([1.186.165.221]) by smtp.googlemail.com with ESMTPSA id cp8sm8271113pjb.27.2021.07.20.10.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 10:36:12 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Tue, 20 Jul 2021 23:05:48 +0530 Message-Id: <20210720173548.313901-2-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210720173548.313901-1-vedantparanjape160201@gmail.com> References: <20210720173548.313901-1-vedantparanjape160201@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v1 2/2] gstreamer: Replace code to push the stream start with factored out function 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" Update functional code in gst_libcamera_src_task_enter(), which creates stream id and pushes the stream start with the refactored function gst_libcamera_pad_push_stream_start(). Signed-off-by: Vedant Paranjape --- src/gstreamer/gstlibcamerasrc.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index b18f1efb..bb8ea07a 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -361,15 +361,10 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread, GST_DEBUG_OBJECT(self, "Streaming thread has started"); - gint stream_id_num = 0; StreamRoles roles; for (GstPad *srcpad : state->srcpads_) { /* Create stream-id and push stream-start. */ - g_autofree gchar *stream_id_intermediate = g_strdup_printf("%i%i", state->group_id_, stream_id_num++); - g_autofree gchar *stream_id = gst_pad_create_stream_id(srcpad, GST_ELEMENT(self), stream_id_intermediate); - GstEvent *event = gst_event_new_stream_start(stream_id); - gst_event_set_group_id(event, state->group_id_); - gst_pad_push_event(srcpad, event); + gst_libcamera_pad_push_stream_start(srcpad, state->group_id_); /* Collect the streams roles for the next iteration. */ roles.push_back(gst_libcamera_pad_get_role(srcpad));