Patch Detail
Show a patch.
GET /api/patches/12502/?format=api
{ "id": 12502, "url": "https://patchwork.libcamera.org/api/patches/12502/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12502/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210607170100.797671-1-vedantparanjape160201@gmail.com>", "date": "2021-06-07T17:01:00", "name": "[libcamera-devel,v1] gstreamer: Added virtual functions needed to support request pads", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "1efc81261652f2dc33e4b228d37ba31cb895fa06", "submitter": { "id": 85, "url": "https://patchwork.libcamera.org/api/people/85/?format=api", "name": "Vedant Paranjape", "email": "vedantparanjape160201@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12502/mbox/", "series": [ { "id": 2107, "url": "https://patchwork.libcamera.org/api/series/2107/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2107", "date": "2021-06-07T17:01:00", "name": "[libcamera-devel,v1] gstreamer: Added virtual functions needed to support request pads", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2107/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12502/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12502/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 676B4C3206\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 7 Jun 2021 17:01:21 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D082268926;\n\tMon, 7 Jun 2021 19:01:20 +0200 (CEST)", "from mail-pf1-x429.google.com (mail-pf1-x429.google.com\n\t[IPv6:2607:f8b0:4864:20::429])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A4F3602A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 7 Jun 2021 19:01:19 +0200 (CEST)", "by mail-pf1-x429.google.com with SMTP id u126so9570514pfu.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 07 Jun 2021 10:01:19 -0700 (PDT)", "from localhost.localdomain ([1.186.76.76])\n\tby smtp.googlemail.com with ESMTPSA id\n\tg8sm8961506pgo.10.2021.06.07.10.01.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 07 Jun 2021 10:01:16 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"pV9c3lKG\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=VW5sARprOQoK3MFFk125r2N4vbB4Ve9yU9uVFS7oaEc=;\n\tb=pV9c3lKG3f3fhflqJNAjvbf+lm/muBw0NeL1WvL3VaSkdshWYuFP0ONeDtaX6Mzwus\n\tFYwxIzoQieRNG3TH9dVX2hrSndpKHGCAt5IC6H7GribvnleDqJdTgFf+fMgwcuedfQP0\n\tn/Iz1PUbOYCKJcmoPL1s/pwym48VGCX5/n4OEQOU05D1fdGNIvCu0DTDYu83YjhFtn2P\n\tzzqZncrgVT4bK8KGbBvFjgAwsw+KkdWwEBzMmuzLMvyvR/a3jNija28eakFfAJkZTADe\n\tyRn/KAA8USYwinXbWotajrEZegQ1BAycronfVTStKs5+cZ4XnPNoSPH0TvM/phFfqILy\n\tZASw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=VW5sARprOQoK3MFFk125r2N4vbB4Ve9yU9uVFS7oaEc=;\n\tb=HPV7oDGdaEIrlK+5U2nAsSzNVzyjDgHfp7HwW2r7dIIoCx7iByYL5ULOLuROOIuMpt\n\tbIQ2aBWJ37bnvSjS8Tw+mOfF4kugVBMQeILZJImUpA8NlRW26VdYOEX+IOH8pklmyXdQ\n\tQWY8DXzhBWzSruxV7k8Qnyul/UurdJv2pnADseI4OPR3VRe9pY2/oHNf5HFK4k+AHQPl\n\t2tpK+UQgUx7Vqxrs4tZ7u+leD7eZcw9zGbWCCxYmwg2Eh7DbrqAWfoZD5lRhmd1firjn\n\teGMf+E79kbMppRZ8lsWWOL2b1m4JXbD8FVkmVZf6OE1Mm+ZgC70U+s/gTXwNjKRmk4Hs\n\t4q0Q==", "X-Gm-Message-State": "AOAM533WxF6ajW3qaTjSQH79ISiGEzLUNQMiX5XLlcp909f5GWpJQlZb\n\thvK3gSn2cuYTEY6gCwWTD+rFhQkDT5nCwg==", "X-Google-Smtp-Source": "ABdhPJyC4MJ5sdbBc5bKuHkHrzkpYBHWy4vdWNad8ybcUa5Vw7gPmvH1WTLkG8167MFNrGG54pzTMA==", "X-Received": "by 2002:a62:8491:0:b029:2e9:c618:fa32 with SMTP id\n\tk139-20020a6284910000b02902e9c618fa32mr17923475pfd.15.1623085277205; \n\tMon, 07 Jun 2021 10:01:17 -0700 (PDT)", "From": "Vedant Paranjape <vedantparanjape160201@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 7 Jun 2021 22:31:00 +0530", "Message-Id": "<20210607170100.797671-1-vedantparanjape160201@gmail.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v1] gstreamer: Added virtual functions\n\tneeded to support request pads", "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>", "Cc": "Vedant Paranjape <vedantparanjape160201@gmail.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Using request pads needs virtual functions to create new request pads and\nrelease the allocated pads.\n\nIt defines the functions gst_libcamera_src_request_new_pad() and\ngst_libcamera_src_release_pad() which handle, creating and releasing\nrequest pads. It also assigned these functions to their callback\nhandlers in GstLibcameraSrcClass.\n\nThis doesn't enable request pad support in gstreamer element. This is\none of the series of changes needed to make it work.\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n src/gstreamer/gstlibcamerasrc.cpp | 53 +++++++++++++++++++++++++++++++\n 1 file changed, 53 insertions(+)", "diff": "diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex ccc61590..f0a4fbf0 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -640,6 +640,57 @@ gst_libcamera_src_init(GstLibcameraSrc *self)\n \tself->state = state;\n }\n \n+static GstPad*\n+gst_libcamera_src_request_new_pad(GstElement *element, GstPadTemplate *templ,\n+\t\t\t\t\tconst gchar *name, [[maybe_unused]] const GstCaps *caps)\n+{\n+\tGstLibcameraSrc *self = GST_LIBCAMERA_SRC(element);\n+\tg_autoptr(GstPad) pad = NULL;\n+\n+\tpad = gst_pad_new_from_template(templ, name);\n+\tif (G_IS_INITIALLY_UNOWNED (pad))\n+\t{\n+\t\tg_object_ref_sink(pad);\n+\t}\n+\t\n+\t{\n+\t\tGLibLocker lock(GST_OBJECT(self->state));\n+\t\tself->state->srcpads_.push_back((GstPad*)g_object_ref(&pad));\n+\t}\n+\n+\tif (!gst_element_add_pad(element, pad))\n+\t{\n+\t\tGST_ELEMENT_ERROR (element, STREAM, FAILED,\n+\t\t\t(\"Internal data stream error.\"), (\"Could not add pad to element\"));\n+\t\t{\n+\t\t\tGLibLocker lock(GST_OBJECT(self->state));\n+\t\t\tself->state->srcpads_.pop_back();\n+\t\t}\n+\t\treturn NULL;\t\t\n+\t}\n+\n+\treturn (GstPad*)g_steal_pointer(&pad);\n+}\n+\n+static void\n+gst_libcamera_src_release_pad(GstElement *element, GstPad *pad)\n+{\n+\tGstLibcameraSrc *self = GST_LIBCAMERA_SRC(element);\n+\t\n+\tGST_DEBUG_OBJECT (self, \"Pad %\" GST_PTR_FORMAT \" being released\", pad);\n+\n+\t{\n+\t\tGLibLocker lock(GST_OBJECT(self->state));\n+\t\tauto iterator = std::find(self->state->srcpads_.begin(), self->state->srcpads_.end(), pad);\n+\t\tif (iterator != self->state->srcpads_.end())\n+\t\t{\n+\t\t\tg_object_unref(self->state->srcpads_[std::distance(self->state->srcpads_.begin(), iterator)]);\n+\t\t\tself->state->srcpads_.erase(iterator);\n+\t\t}\n+\t}\n+\tgst_element_remove_pad(element, pad);\n+}\n+\n static void\n gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n {\n@@ -650,6 +701,8 @@ gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n \tobject_class->get_property = gst_libcamera_src_get_property;\n \tobject_class->finalize = gst_libcamera_src_finalize;\n \n+\telement_class->request_new_pad = gst_libcamera_src_request_new_pad;\n+\telement_class->release_pad = gst_libcamera_src_release_pad;\n \telement_class->change_state = gst_libcamera_src_change_state;\n \n \tgst_element_class_set_metadata(element_class,\n", "prefixes": [ "libcamera-devel", "v1" ] }