Show a patch.

GET /api/1.1/patches/2103/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2103,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2103/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2103/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20191004194534.25287-1-martijn@brixit.nl>",
    "date": "2019-10-04T19:45:34",
    "name": "[libcamera-devel] libcamera: pipeline: Add Simple pipeline",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c19c3cf212e2acaa1d085e5348c788343fc9bfc2",
    "submitter": {
        "id": 23,
        "url": "https://patchwork.libcamera.org/api/1.1/people/23/?format=api",
        "name": "Martijn Braam",
        "email": "martijn@brixit.nl"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2103/mbox/",
    "series": [
        {
            "id": 520,
            "url": "https://patchwork.libcamera.org/api/1.1/series/520/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=520",
            "date": "2019-10-04T19:45:34",
            "name": "[libcamera-devel] libcamera: pipeline: Add Simple pipeline",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/520/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2103/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2103/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<martijn@brixit.nl>",
        "Received": [
            "from mail-ed1-x533.google.com (mail-ed1-x533.google.com\n\t[IPv6:2a00:1450:4864:20::533])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1912360BC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  4 Oct 2019 21:45:56 +0200 (CEST)",
            "by mail-ed1-x533.google.com with SMTP id v38so7061515edm.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 04 Oct 2019 12:45:56 -0700 (PDT)",
            "from msi.localhost ([185.54.207.135])\n\tby smtp.gmail.com with ESMTPSA id\n\tu27sm1322780edb.48.2019.10.04.12.45.52\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 04 Oct 2019 12:45:52 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=brixit-nl.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=8+i5+V3+uILTMa+7lZoHP9RsCRvvzbBNIFJus+dUpV0=;\n\tb=Dasu6z7hearJwBgnBeOTnpOls9R5ca61r1Nz8eLJ0ATfK7jCaw5k62anPJJV1dYbyS\n\t7xuu2dfxbDMT9enyrepc/DkWKBKrvmCV4Nl0Sl75fq9BiUXFgsWaRgCtJH5ajkdq1akA\n\t/4AQsA6fkUe6LjT38XBSP/ppJChAwmEyXfRYtAuKHFX0aKyi9T4/HRRT7pg0BW5iJ28R\n\t6oL3WcU4wQdO7jKb4iqYKLCL5aOSLyeWR3sft2gnal6utIpn6fP1tWAIvG45JzjWGlFz\n\tNp0Opv98E3Gc0NHR0KB59wMbNu7vg4QE4KsCJ/dc0Unb4+7m5HJhcx/tD9Y1ZSzBhVh6\n\te8OA==",
        "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=8+i5+V3+uILTMa+7lZoHP9RsCRvvzbBNIFJus+dUpV0=;\n\tb=ibCEhdG6Vq8as8Wb8tuhapmes44TdKw8yhZImVN6IdnwTckllgYkt4kCKqrJlsPnJ/\n\tE1RYixbXBAtyDfEPY3xoDUif+M6RyzTXo3bMNXeop2ymSUMQDqQWw9XC+MkpUTsVHEtF\n\tXCDyfY4Vv9CunlJafuFSu+qac64PwtgCGdLS2htV5OTWXBI06ORz69EG/meOCoKA8p6p\n\tk/K3HKmtKAZnKdVtPoX76+LSf5qAf3uyA6x2zCyxJSbQvAwdiJAxpE+f2mMDFqydOHgH\n\tMoDz5ojCXuK0uvU3RWnze1MIzOIkJabas+C7iBMuJcJk5d0kuEe8k+0vFMqRZbmB0Bmg\n\tWhNA==",
        "X-Gm-Message-State": "APjAAAXhU+6jZDSEknOwgA/vqRpR5L+t8DZcO16s3TR7pq/wasB76mOk\n\tWVC4oxn06G7ps1IYgfRxghKffsdLT0Y=",
        "X-Google-Smtp-Source": "APXvYqyqB9Pap7DfBPhCDxKgZqsuTwo2H1XdGKiZRXDNjN+GqmOprrpBzx9D4tgLNsuaWv7nug/6rw==",
        "X-Received": "by 2002:a17:906:1991:: with SMTP id\n\tg17mr13684952ejd.220.1570218353846; \n\tFri, 04 Oct 2019 12:45:53 -0700 (PDT)",
        "From": "Martijn Braam <martijn@brixit.nl>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Martijn Braam <martijn@brixit.nl>",
        "Date": "Fri,  4 Oct 2019 21:45:34 +0200",
        "Message-Id": "<20191004194534.25287-1-martijn@brixit.nl>",
        "X-Mailer": "git-send-email 2.23.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Sat, 05 Oct 2019 18:37:34 +0200",
        "Subject": "[libcamera-devel] [PATCH] libcamera: pipeline: Add Simple pipeline",
        "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>",
        "X-List-Received-Date": "Fri, 04 Oct 2019 19:45:56 -0000"
    },
    "content": "This add a generic pipeline handler for simple pipelines. It currently\nhandles pipelines where there's only a PHY node and a sensor node and\nthe kernel sets up the graph.\n\nThe current implementation can deal with sunxi sun6i-csi pipelines but\nother simple pipelines can be added to the infos array.\n\nSigned-off-by: Martijn Braam <martijn@brixit.nl>\n---\n src/libcamera/pipeline/meson.build |   1 +\n src/libcamera/pipeline/simple.cpp  | 457 +++++++++++++++++++++++++++++\n 2 files changed, 458 insertions(+)\n create mode 100644 src/libcamera/pipeline/simple.cpp",
    "diff": "diff --git a/src/libcamera/pipeline/meson.build b/src/libcamera/pipeline/meson.build\nindex 0d46622..df95a43 100644\n--- a/src/libcamera/pipeline/meson.build\n+++ b/src/libcamera/pipeline/meson.build\n@@ -1,6 +1,7 @@\n libcamera_sources += files([\n     'uvcvideo.cpp',\n     'vimc.cpp',\n+    'simple.cpp'\n ])\n \n subdir('ipu3')\ndiff --git a/src/libcamera/pipeline/simple.cpp b/src/libcamera/pipeline/simple.cpp\nnew file mode 100644\nindex 0000000..f150d7e\n--- /dev/null\n+++ b/src/libcamera/pipeline/simple.cpp\n@@ -0,0 +1,457 @@\n+\n+#include <algorithm>\n+#include <array>\n+#include <iomanip>\n+#include <memory>\n+#include <vector>\n+\n+#include <linux/media-bus-format.h>\n+\n+#include <libcamera/camera.h>\n+#include <libcamera/request.h>\n+#include <libcamera/stream.h>\n+\n+#include \"camera_sensor.h\"\n+#include \"device_enumerator.h\"\n+#include \"log.h\"\n+#include \"media_device.h\"\n+#include \"pipeline_handler.h\"\n+#include \"utils.h\"\n+#include \"v4l2_subdevice.h\"\n+#include \"v4l2_videodevice.h\"\n+\n+namespace libcamera {\n+LOG_DEFINE_CATEGORY(Simple)\n+\n+struct SimplePipelineInfo {\n+\tstd::string driverName;\n+\tstd::string phyName;\n+\tstd::string v4l2Name;\n+\tunsigned int v4l2PixFmt;\n+\tunsigned int mediaBusFmt;\n+\tunsigned int maxWidth;\n+\tunsigned int maxHeight;\n+};\n+\n+class SimpleCameraData : public CameraData\n+{\n+public:\n+\tSimpleCameraData(PipelineHandler *pipe)\n+\t\t: CameraData(pipe), sensor_(nullptr)\n+\t{\n+\t}\n+\n+\t~SimpleCameraData()\n+\t{\n+\t\tdelete sensor_;\n+\t}\n+\n+\tStream stream_;\n+\tCameraSensor *sensor_;\n+};\n+\n+class SimpleCameraConfiguration : public CameraConfiguration\n+{\n+public:\n+\tSimpleCameraConfiguration(Camera *camera, SimpleCameraData *data, const SimplePipelineInfo *pipelineInfo);\n+\n+\tStatus validate() override;\n+\n+\tconst V4L2SubdeviceFormat &sensorFormat() { return sensorFormat_; }\n+\n+private:\n+\t/*\n+         * The SimpleCameraData instance is guaranteed to be valid as long as the\n+         * corresponding Camera instance is valid. In order to borrow a\n+         * reference to the camera data, store a new reference to the camera.\n+         */\n+\tstd::shared_ptr<Camera> camera_;\n+\tconst SimpleCameraData *data_;\n+\n+\tV4L2SubdeviceFormat sensorFormat_;\n+\n+\tconst SimplePipelineInfo *pipelineInfo_;\n+};\n+\n+class PipelineHandlerSimple : public PipelineHandler\n+{\n+public:\n+\tPipelineHandlerSimple(CameraManager *manager);\n+\n+\t~PipelineHandlerSimple();\n+\n+\tCameraConfiguration *generateConfiguration(Camera *camera,\n+\t\t\t\t\t\t   const StreamRoles &roles) override;\n+\n+\tint configure(Camera *camera, CameraConfiguration *config) override;\n+\n+\tint allocateBuffers(Camera *camera,\n+\t\t\t    const std::set<Stream *> &streams) override;\n+\n+\tint freeBuffers(Camera *camera,\n+\t\t\tconst std::set<Stream *> &streams) override;\n+\n+\tint start(Camera *camera) override;\n+\n+\tvoid stop(Camera *camera) override;\n+\n+\tint queueRequest(Camera *camera, Request *request) override;\n+\n+\tbool match(DeviceEnumerator *enumerator) override;\n+\n+private:\n+\tSimpleCameraData *cameraData(const Camera *camera)\n+\t{\n+\t\treturn static_cast<SimpleCameraData *>(\n+\t\t\tPipelineHandler::cameraData(camera));\n+\t}\n+\n+\tint initLinks();\n+\n+\tint createCamera(MediaEntity *sensor);\n+\n+\tvoid bufferReady(Buffer *buffer);\n+\n+\tMediaDevice *media_;\n+\tV4L2Subdevice *dphy_;\n+\tV4L2VideoDevice *video_;\n+\n+\tCamera *activeCamera_;\n+\n+\tconst SimplePipelineInfo *pipelineInfo_;\n+};\n+\n+SimpleCameraConfiguration::SimpleCameraConfiguration(Camera *camera,\n+\t\t\t\t\t\t     SimpleCameraData *data,\n+\t\t\t\t\t\t     const SimplePipelineInfo *pipelineInfo)\n+\t: CameraConfiguration()\n+{\n+\tcamera_ = camera->shared_from_this();\n+\tdata_ = data;\n+\tpipelineInfo_ = pipelineInfo;\n+}\n+\n+CameraConfiguration::Status SimpleCameraConfiguration::validate()\n+{\n+\tconst CameraSensor *sensor = data_->sensor_;\n+\tStatus status = Valid;\n+\n+\tif (config_.empty())\n+\t\treturn Invalid;\n+\n+\t/* Cap the number of entries to the available streams. */\n+\tif (config_.size() > 1) {\n+\t\tconfig_.resize(1);\n+\t\tstatus = Adjusted;\n+\t}\n+\n+\tStreamConfiguration &cfg = config_[0];\n+\n+\t/* Adjust the pixel format. */\n+\tif (cfg.pixelFormat != pipelineInfo_->v4l2PixFmt) {\n+\t\tLOG(Simple, Debug) << \"Adjusting pixel format\";\n+\t\tcfg.pixelFormat = pipelineInfo_->v4l2PixFmt;\n+\t\tstatus = Adjusted;\n+\t}\n+\n+\t/* Select the sensor format. */\n+\tsensorFormat_ = sensor->getFormat({ pipelineInfo_->mediaBusFmt },\n+\t\t\t\t\t  cfg.size);\n+\tif (!sensorFormat_.size.width || !sensorFormat_.size.height)\n+\t\tsensorFormat_.size = sensor->resolution();\n+\n+\t/*\n+         * Provide a suitable default that matches the sensor aspect\n+         * ratio and clamp the size to the hardware bounds.\n+         *\n+         * \\todo: Check the hardware alignment constraints.\n+         */\n+\tconst Size size = cfg.size;\n+\n+\tunsigned int pipelineMaxWidth = std::min(sensorFormat_.size.width, pipelineInfo_->maxWidth);\n+\tunsigned int pipelineMaxHeight = std::min(sensorFormat_.size.height, pipelineInfo_->maxHeight);\n+\n+\tif (!cfg.size.width || !cfg.size.height) {\n+\t\tcfg.size.width = pipelineMaxWidth;\n+\t\tcfg.size.height = pipelineMaxWidth * sensorFormat_.size.height / sensorFormat_.size.width;\n+\t}\n+\n+\tcfg.size.width = std::min(pipelineMaxWidth, cfg.size.width);\n+\tcfg.size.height = std::min(pipelineMaxHeight, cfg.size.height);\n+\n+\tcfg.size.width = std::max(32U, std::min(4416U, cfg.size.width));\n+\tcfg.size.height = std::max(16U, std::min(3312U, cfg.size.height));\n+\n+\tif (cfg.size != size) {\n+\t\tLOG(Simple, Debug)\n+\t\t\t<< \"Adjusting size from \" << size.toString()\n+\t\t\t<< \" to \" << cfg.size.toString();\n+\t\tstatus = Adjusted;\n+\t}\n+\n+\tcfg.bufferCount = 3;\n+\n+\treturn status;\n+}\n+\n+PipelineHandlerSimple::PipelineHandlerSimple(CameraManager *manager)\n+\t: PipelineHandler(manager), dphy_(nullptr), video_(nullptr)\n+{\n+}\n+\n+PipelineHandlerSimple::~PipelineHandlerSimple()\n+{\n+\tdelete video_;\n+\tdelete dphy_;\n+}\n+\n+/* -----------------------------------------------------------------------------\n+ * Pipeline Operations\n+ */\n+\n+CameraConfiguration *PipelineHandlerSimple::generateConfiguration(Camera *camera,\n+\t\t\t\t\t\t\t\t  const StreamRoles &roles)\n+{\n+\tSimpleCameraData *data = cameraData(camera);\n+\tCameraConfiguration *config = new SimpleCameraConfiguration(camera, data, PipelineHandlerSimple::pipelineInfo_);\n+\n+\tif (roles.empty())\n+\t\treturn config;\n+\n+\tStreamConfiguration cfg{};\n+\tcfg.pixelFormat = pipelineInfo_->v4l2PixFmt;\n+\tcfg.size = data->sensor_->resolution();\n+\n+\tconfig->addConfiguration(cfg);\n+\n+\tconfig->validate();\n+\n+\treturn config;\n+}\n+\n+int PipelineHandlerSimple::configure(Camera *camera, CameraConfiguration *c)\n+{\n+\tSimpleCameraConfiguration *config =\n+\t\tstatic_cast<SimpleCameraConfiguration *>(c);\n+\tSimpleCameraData *data = cameraData(camera);\n+\tStreamConfiguration &cfg = config->at(0);\n+\tCameraSensor *sensor = data->sensor_;\n+\tint ret;\n+\n+\t/*\n+         * Configure the sensor links: enable the link corresponding to this\n+         * camera and disable all the other sensor links.\n+         */\n+\tconst MediaPad *pad = dphy_->entity()->getPadByIndex(0);\n+\n+\tfor (MediaLink *link : pad->links()) {\n+\t\tbool enable = link->source()->entity() == sensor->entity();\n+\n+\t\tif (!!(link->flags() & MEDIA_LNK_FL_ENABLED) == enable)\n+\t\t\tcontinue;\n+\n+\t\tLOG(Simple, Debug)\n+\t\t\t<< (enable ? \"Enabling\" : \"Disabling\")\n+\t\t\t<< \" link from sensor '\"\n+\t\t\t<< link->source()->entity()->name()\n+\t\t\t<< \"' to CSI-2 receiver\";\n+\n+\t\tret = link->setEnabled(enable);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t}\n+\n+\t/*\n+         * Configure the format on the sensor output and propagate it through\n+         * the pipeline.\n+         */\n+\tV4L2SubdeviceFormat format = config->sensorFormat();\n+\tLOG(Simple, Debug) << \"Configuring sensor with \" << format.toString();\n+\n+\tret = sensor->setFormat(&format);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\tLOG(Simple, Debug) << \"Sensor configured with \" << format.toString();\n+\n+\tV4L2DeviceFormat outputFormat = {};\n+\toutputFormat.fourcc = cfg.pixelFormat;\n+\toutputFormat.size = cfg.size;\n+\toutputFormat.planesCount = 2;\n+\n+\tret = video_->setFormat(&outputFormat);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (outputFormat.size != cfg.size ||\n+\t    outputFormat.fourcc != cfg.pixelFormat) {\n+\t\tLOG(Simple, Error)\n+\t\t\t<< \"Unable to configure capture in \" << cfg.toString();\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tcfg.setStream(&data->stream_);\n+\n+\treturn 0;\n+}\n+\n+int PipelineHandlerSimple::allocateBuffers(Camera *camera,\n+\t\t\t\t\t   const std::set<Stream *> &streams)\n+{\n+\tStream *stream = *streams.begin();\n+\n+\tif (stream->memoryType() == InternalMemory)\n+\t\treturn video_->exportBuffers(&stream->bufferPool());\n+\telse\n+\t\treturn video_->importBuffers(&stream->bufferPool());\n+}\n+\n+int PipelineHandlerSimple::freeBuffers(Camera *camera,\n+\t\t\t\t       const std::set<Stream *> &streams)\n+{\n+\tif (video_->releaseBuffers())\n+\t\tLOG(Simple, Error) << \"Failed to release buffers\";\n+\n+\treturn 0;\n+}\n+\n+int PipelineHandlerSimple::start(Camera *camera)\n+{\n+\tint ret;\n+\n+\tret = video_->streamOn();\n+\tif (ret)\n+\t\tLOG(Simple, Error)\n+\t\t\t<< \"Failed to start camera \" << camera->name();\n+\n+\tactiveCamera_ = camera;\n+\n+\treturn ret;\n+}\n+\n+void PipelineHandlerSimple::stop(Camera *camera)\n+{\n+\tint ret;\n+\n+\tret = video_->streamOff();\n+\tif (ret)\n+\t\tLOG(Simple, Warning)\n+\t\t\t<< \"Failed to stop camera \" << camera->name();\n+\n+\tactiveCamera_ = nullptr;\n+}\n+\n+int PipelineHandlerSimple::queueRequest(Camera *camera, Request *request)\n+{\n+\tSimpleCameraData *data = cameraData(camera);\n+\tStream *stream = &data->stream_;\n+\n+\tBuffer *buffer = request->findBuffer(stream);\n+\tif (!buffer) {\n+\t\tLOG(Simple, Error)\n+\t\t\t<< \"Attempt to queue request with invalid stream\";\n+\t\treturn -ENOENT;\n+\t}\n+\n+\tint ret = video_->queueBuffer(buffer);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\tPipelineHandler::queueRequest(camera, request);\n+\n+\treturn 0;\n+}\n+\n+/* -----------------------------------------------------------------------------\n+ * Match and Setup\n+ */\n+\n+int PipelineHandlerSimple::createCamera(MediaEntity *sensor)\n+{\n+\tint ret;\n+\n+\tstd::unique_ptr<SimpleCameraData> data =\n+\t\tutils::make_unique<SimpleCameraData>(this);\n+\n+\tdata->sensor_ = new CameraSensor(sensor);\n+\tret = data->sensor_->init();\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tstd::set<Stream *> streams{ &data->stream_ };\n+\tstd::shared_ptr<Camera> camera =\n+\t\tCamera::create(this, sensor->name(), streams);\n+\tregisterCamera(std::move(camera), std::move(data));\n+\n+\treturn 0;\n+}\n+\n+bool PipelineHandlerSimple::match(DeviceEnumerator *enumerator)\n+{\n+\tconst MediaPad *pad;\n+\n+\tstatic const SimplePipelineInfo infos[1] = {\n+\t\t{ .driverName = \"sun6i-csi\",\n+\t\t  .phyName = \"sun6i-csi\",\n+\t\t  .v4l2Name = \"sun6i-csi\",\n+\t\t  .v4l2PixFmt = V4L2_PIX_FMT_UYVY,\n+\t\t  .mediaBusFmt = MEDIA_BUS_FMT_UYVY8_2X8,\n+\t\t  .maxWidth = 1280,\n+\t\t  .maxHeight = 720 }\n+\t};\n+\n+\tconst SimplePipelineInfo *ptr = infos;\n+\tfor (int i = 0; i < 1; i++, ptr++) {\n+\t\tDeviceMatch dm(ptr->driverName);\n+\t\tdm.add(ptr->phyName);\n+\n+\t\tmedia_ = acquireMediaDevice(enumerator, dm);\n+\t\tif (!media_)\n+\t\t\tcontinue;\n+\n+\t\tPipelineHandlerSimple::pipelineInfo_ = ptr;\n+\n+\t\t/* Create the V4L2 subdevices we will need. */\n+\t\tdphy_ = V4L2Subdevice::fromEntityName(media_, ptr->phyName);\n+\t\tif (dphy_->open() < 0)\n+\t\t\treturn false;\n+\n+\t\t/* Locate and open the capture video node. */\n+\t\tvideo_ = V4L2VideoDevice::fromEntityName(media_, ptr->v4l2Name);\n+\t\tif (video_->open() < 0)\n+\t\t\treturn false;\n+\n+\t\tvideo_->bufferReady.connect(this, &PipelineHandlerSimple::bufferReady);\n+\n+\t\t/*\n+             * Enumerate all sensors connected to the CSI-2 receiver and create one\n+             * camera instance for each of them.\n+             */\n+\t\tpad = dphy_->entity()->getPadByIndex(0);\n+\t\tif (!pad)\n+\t\t\treturn false;\n+\n+\t\tfor (MediaLink *link : pad->links())\n+\t\t\tcreateCamera(link->source()->entity());\n+\n+\t\treturn true;\n+\t}\n+\treturn false;\n+}\n+\n+/* -----------------------------------------------------------------------------\n+ * Buffer Handling\n+ */\n+\n+void PipelineHandlerSimple::bufferReady(Buffer *buffer)\n+{\n+\tASSERT(activeCamera_);\n+\tLOG(Simple, Debug) << \"bufferReady\";\n+\tRequest *request = buffer->request();\n+\tcompleteBuffer(activeCamera_, request, buffer);\n+\tcompleteRequest(activeCamera_, request);\n+}\n+\n+REGISTER_PIPELINE_HANDLER(PipelineHandlerSimple);\n+\n+} // namespace libcamera\n",
    "prefixes": [
        "libcamera-devel"
    ]
}