[{"id":23326,"web_url":"https://patchwork.libcamera.org/comment/23326/","msgid":"<20220605124620.jm7y3vz2fsa7tdey@uno.localdomain>","date":"2022-06-05T12:46:20","subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Tomi\n\nOn Mon, May 30, 2022 at 05:27:22PM +0300, Tomi Valkeinen wrote:\n> Add a Python version of simple-cam from:\n>\n> https://git.libcamera.org/libcamera/simple-cam.git\n>\n> Let's keep this in the libcamera repository until the Python API has\n> stabilized a bit more, and then we could move this to the simple-cam\n> repo.\n>\n\nLooks very nice and it could indeed be added to the simple-cam\nrepository (or should we create an example directory in libcamera\nsources ?)\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> ---\n>  src/py/examples/simple-cam.py | 350 ++++++++++++++++++++++++++++++++++\n>  1 file changed, 350 insertions(+)\n>  create mode 100755 src/py/examples/simple-cam.py\n>\n> diff --git a/src/py/examples/simple-cam.py b/src/py/examples/simple-cam.py\n> new file mode 100755\n> index 00000000..2b81bb65\n> --- /dev/null\n> +++ b/src/py/examples/simple-cam.py\n> @@ -0,0 +1,350 @@\n> +#!/usr/bin/env python3\n> +\n> +# SPDX-License-Identifier: BSD-3-Clause\n> +# Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> +\n> +# A simple libcamera capture example\n> +#\n> +# This is a python version of simple-cam from:\n> +# https://git.libcamera.org/libcamera/simple-cam.git\n> +#\n> +# \\todo Move to simple-cam repository when the Python API has stabilized more\n> +\n> +import libcamera as libcam\n> +import selectors\n> +import sys\n> +import time\n> +\n> +TIMEOUT_SEC = 3\n> +\n> +\n> +def handle_camera_event(cm):\n> +    # cm.get_ready_requests() will not block here, as we know there is an event\n> +    # to read.\n> +\n> +    reqs = cm.get_ready_requests()\n> +\n> +    # Process the captured frames\n> +\n> +    for req in reqs:\n> +        process_request(req)\n> +\n> +\n> +def process_request(request):\n> +    global camera\n> +\n> +    print()\n> +\n> +    print(f'Request completed: {request}')\n> +\n> +    # When a request has completed, it is populated with a metadata control\n> +    # list that allows an application to determine various properties of\n> +    # the completed request. This can include the timestamp of the Sensor\n> +    # capture, or its gain and exposure values, or properties from the IPA\n> +    # such as the state of the 3A algorithms.\n> +    #\n> +    # To examine each request, print all the metadata for inspection. A custom\n> +    # application can parse each of these items and process them according to\n> +    # its needs.\n> +\n> +    requestMetadata = request.metadata\n> +    for id, value in requestMetadata.items():\n> +        print(f'\\t{id.name} = {value}')\n> +\n> +    # Each buffer has its own FrameMetadata to describe its state, or the\n> +    # usage of each buffer. While in our simple capture we only provide one\n> +    # buffer per request, a request can have a buffer for each stream that\n> +    # is established when configuring the camera.\n> +    #\n> +    # This allows a viewfinder and a still image to be processed at the\n> +    # same time, or to allow obtaining the RAW capture buffer from the\n> +    # sensor along with the image as processed by the ISP.\n> +\n> +    buffers = request.buffers\n> +    for _, buffer in buffers.items():\n> +        metadata = buffer.metadata\n> +\n> +        # Print some information about the buffer which has completed.\n> +        print(f' seq: {metadata.sequence:06} timestamp: {metadata.timestamp} bytesused: ' +\n> +              '/'.join([str(p.bytes_used) for p in metadata.planes]))\n> +\n> +        # Image data can be accessed here, but the FrameBuffer\n> +        # must be mapped by the application\n> +\n> +    # Re-queue the Request to the camera.\n> +    request.reuse()\n> +    camera.queue_request(request)\n> +\n> +\n> +# ----------------------------------------------------------------------------\n> +# Camera Naming.\n> +#\n> +# Applications are responsible for deciding how to name cameras, and present\n> +# that information to the users. Every camera has a unique identifier, though\n> +# this string is not designed to be friendly for a human reader.\n> +#\n> +# To support human consumable names, libcamera provides camera properties\n> +# that allow an application to determine a naming scheme based on its needs.\n> +#\n> +# In this example, we focus on the location property, but also detail the\n> +# model string for external cameras, as this is more likely to be visible\n> +# information to the user of an externally connected device.\n> +#\n> +# The unique camera ID is appended for informative purposes.\n> +#\n> +def camera_name(camera):\n> +    props = camera.properties\n> +    location = props.get(libcam.properties.Location, None)\n> +\n> +    if location == libcam.properties.LocationEnum.Front:\n> +        name = 'Internal front camera'\n> +    elif location == libcam.properties.LocationEnum.Back:\n> +        name = 'Internal back camera'\n> +    elif location == libcam.properties.LocationEnum.External:\n> +        name = 'External camera'\n> +        if libcam.properties.Model in props:\n> +            name += f' \"{props[libcam.properties.Model]}\"'\n> +    else:\n> +        name = 'Undefined location'\n> +\n> +    name += f' ({camera.id})'\n> +\n> +    return name\n> +\n> +\n> +def main():\n> +    global camera\n> +\n> +    # --------------------------------------------------------------------\n> +    # Get the Camera Manager.\n> +    #\n> +    # The Camera Manager is responsible for enumerating all the Camera\n> +    # in the system, by associating Pipeline Handlers with media entities\n> +    # registered in the system.\n> +    #\n> +    # The CameraManager provides a list of available Cameras that\n> +    # applications can operate on.\n> +    #\n> +    # There can only be a single CameraManager within any process space.\n> +\n> +    cm = libcam.CameraManager.singleton()\n> +\n> +    # Just as a test, generate names of the Cameras registered in the\n> +    # system, and list them.\n> +\n> +    for camera in cm.cameras:\n> +        print(f' - {camera_name(camera)}')\n> +\n> +    # --------------------------------------------------------------------\n> +    # Camera\n> +    #\n> +    # Camera are entities created by pipeline handlers, inspecting the\n> +    # entities registered in the system and reported to applications\n> +    # by the CameraManager.\n> +    #\n> +    # In general terms, a Camera corresponds to a single image source\n> +    # available in the system, such as an image sensor.\n> +    #\n> +    # Application lock usage of Camera by 'acquiring' them.\n> +    # Once done with it, application shall similarly 'release' the Camera.\n> +    #\n> +    # As an example, use the first available camera in the system after\n> +    # making sure that at least one camera is available.\n> +    #\n> +    # Cameras can be obtained by their ID or their index, to demonstrate\n> +    # this, the following code gets the ID of the first camera; then gets\n> +    # the camera associated with that ID (which is of course the same as\n> +    # cm.cameras[0]).\n> +\n> +    if not cm.cameras:\n> +        print('No cameras were identified on the system.')\n> +        return -1\n> +\n> +    camera_id = cm.cameras[0].id\n> +    camera = cm.get(camera_id)\n> +    camera.acquire()\n> +\n> +    # --------------------------------------------------------------------\n> +    # Stream\n> +    #\n> +    # Each Camera supports a variable number of Stream. A Stream is\n> +    # produced by processing data produced by an image source, usually\n> +    # by an ISP.\n> +    #\n> +    #   +-------------------------------------------------------+\n> +    #   | Camera                                                |\n> +    #   |                +-----------+                          |\n> +    #   | +--------+     |           |------> [  Main output  ] |\n> +    #   | | Image  |     |           |                          |\n> +    #   | |        |---->|    ISP    |------> [   Viewfinder  ] |\n> +    #   | | Source |     |           |                          |\n> +    #   | +--------+     |           |------> [ Still Capture ] |\n> +    #   |                +-----------+                          |\n> +    #   +-------------------------------------------------------+\n> +    #\n> +    # The number and capabilities of the Stream in a Camera are\n> +    # a platform dependent property, and it's the pipeline handler\n> +    # implementation that has the responsibility of correctly\n> +    # report them.\n> +\n> +    # --------------------------------------------------------------------\n> +    # Camera Configuration.\n> +    #\n> +    # Camera configuration is tricky! It boils down to assign resources\n> +    # of the system (such as DMA engines, scalers, format converters) to\n> +    # the different image streams an application has requested.\n> +    #\n> +    # Depending on the system characteristics, some combinations of\n> +    # sizes, formats and stream usages might or might not be possible.\n> +    #\n> +    # A Camera produces a CameraConfigration based on a set of intended\n> +    # roles for each Stream the application requires.\n> +\n> +    config = camera.generate_configuration([libcam.StreamRole.Viewfinder])\n> +\n> +    # The CameraConfiguration contains a StreamConfiguration instance\n> +    # for each StreamRole requested by the application, provided\n> +    # the Camera can support all of them.\n> +    #\n> +    # Each StreamConfiguration has default size and format, assigned\n> +    # by the Camera depending on the Role the application has requested.\n> +\n> +    stream_config = config.at(0)\n> +    print(f'Default viewfinder configuration is: {stream_config}')\n> +\n> +    # Each StreamConfiguration parameter which is part of a\n> +    # CameraConfiguration can be independently modified by the\n> +    # application.\n> +    #\n> +    # In order to validate the modified parameter, the CameraConfiguration\n> +    # should be validated -before- the CameraConfiguration gets applied\n> +    # to the Camera.\n> +    #\n> +    # The CameraConfiguration validation process adjusts each\n> +    # StreamConfiguration to a valid value.\n> +\n> +    # Validating a CameraConfiguration -before- applying it will adjust it\n> +    # to a valid configuration which is as close as possible to the one\n> +    # requested.\n> +\n> +    config.validate()\n> +    print(f'Validated viewfinder configuration is: {stream_config}')\n> +\n> +    # Once we have a validated configuration, we can apply it to the\n> +    # Camera.\n> +\n> +    camera.configure(config)\n> +\n> +    # --------------------------------------------------------------------\n> +    # Buffer Allocation\n> +    #\n> +    # Now that a camera has been configured, it knows all about its\n> +    # Streams sizes and formats. The captured images need to be stored in\n> +    # framebuffers which can either be provided by the application to the\n> +    # library, or allocated in the Camera and exposed to the application\n> +    # by libcamera.\n> +    #\n> +    # An application may decide to allocate framebuffers from elsewhere,\n> +    # for example in memory allocated by the display driver that will\n> +    # render the captured frames. The application will provide them to\n> +    # libcamera by constructing FrameBuffer instances to capture images\n> +    # directly into.\n> +    #\n> +    # Alternatively libcamera can help the application by exporting\n> +    # buffers allocated in the Camera using a FrameBufferAllocator\n> +    # instance and referencing a configured Camera to determine the\n> +    # appropriate buffer size and types to create.\n> +\n> +    allocator = libcam.FrameBufferAllocator(camera)\n> +\n> +    for cfg in config:\n> +        ret = allocator.allocate(cfg.stream)\n> +        if ret < 0:\n> +            print('Can\\'t allocate buffers')\n> +            return -1\n> +\n> +        allocated = len(allocator.buffers(cfg.stream))\n> +        print(f'Allocated {allocated} buffers for stream')\n> +\n> +    # --------------------------------------------------------------------\n> +    # Frame Capture\n> +    #\n> +    # libcamera frames capture model is based on the 'Request' concept.\n> +    # For each frame a Request has to be queued to the Camera.\n> +    #\n> +    # A Request refers to (at least one) Stream for which a Buffer that\n> +    # will be filled with image data shall be added to the Request.\n> +    #\n> +    # A Request is associated with a list of Controls, which are tunable\n> +    # parameters (similar to v4l2_controls) that have to be applied to\n> +    # the image.\n> +    #\n> +    # Once a request completes, all its buffers will contain image data\n> +    # that applications can access and for each of them a list of metadata\n> +    # properties that reports the capture parameters applied to the image.\n> +\n> +    stream = stream_config.stream\n> +    buffers = allocator.buffers(stream)\n> +    requests = []\n> +    for i in range(len(buffers)):\n> +        request = camera.create_request()\n> +        if not request:\n> +            print('Can\\'t create request')\n> +            return -1\n> +\n> +        buffer = buffers[i]\n> +        ret = request.add_buffer(stream, buffer)\n> +        if ret < 0:\n> +            print('Can\\'t set buffer for request')\n> +            return -1\n> +\n> +        # Controls can be added to a request on a per frame basis.\n> +        request.set_control(libcam.controls.Brightness, 0.5)\n> +\n> +        requests.append(request)\n> +\n> +    # --------------------------------------------------------------------\n> +    # Start Capture\n> +    #\n> +    # In order to capture frames the Camera has to be started and\n> +    # Request queued to it. Enough Request to fill the Camera pipeline\n> +    # depth have to be queued before the Camera start delivering frames.\n> +    #\n> +    # When a Request has been completed, it will be added to a list in the\n> +    # CameraManager and an event will be raised using eventfd.\n> +    #\n> +    # The list of completed Requests can be retrieved with\n> +    # CameraManager.get_ready_requests(), which will also clear the list in the\n> +    # CameraManager.\n> +    #\n> +    # The eventfd can be retrieved from CameraManager.event_fd, and the fd can\n> +    # be waited upon using e.g. Python's selectors.\n> +\n> +    camera.start()\n> +    for request in requests:\n> +        camera.queue_request(request)\n> +\n> +    sel = selectors.DefaultSelector()\n> +    sel.register(cm.event_fd, selectors.EVENT_READ, lambda fd: handle_camera_event(cm))\n> +\n> +    start_time = time.time()\n> +\n> +    while time.time() - start_time < TIMEOUT_SEC:\n> +        events = sel.select()\n> +        for key, mask in events:\n> +            key.data(key.fileobj)\n> +\n> +    # --------------------------------------------------------------------\n> +    # Clean Up\n> +    #\n> +    # Stop the Camera, release resources and stop the CameraManager.\n> +    # libcamera has now released all resources it owned.\n> +\n> +    camera.stop()\n> +    camera.release()\n> +\n> +    return 0\n> +\n> +\n> +if __name__ == '__main__':\n> +    sys.exit(main())\n> --\n> 2.34.1\n>","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 DE750BD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  5 Jun 2022 12:46:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4139265637;\n\tSun,  5 Jun 2022 14:46:24 +0200 (CEST)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F1B260104\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  5 Jun 2022 14:46:23 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 0A679FF804;\n\tSun,  5 Jun 2022 12:46:21 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654433184;\n\tbh=LqrK55C/89F8VwnZRuy5Bkgrwn0Co2sRiKmKS6S4cho=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=VrYudI/rdvoBTyRbRcK5oCIytlSOYff0UCTLWEndMwLIFsUkSDgWbS6FUE2enzTjl\n\tA+Cl/NrL6hjKWgs8I4h2eT8x4LOblOwupfeSoluON2NfpdDRh4UNNRhrXSh06aE182\n\tR0wx0bGq37ktsPnRI7sd0em3w7vlVynwWCa/KIiHaJXN4YVUMvGXnTo82+Eey2s9WE\n\twBOz9r5Ghmf9zcBgFzVgtBJ2RJN+XwCyocP7083Yx9tWFxIo/KRw5Q/dadeh0eF57J\n\tg94UcZjUJV3WP28j7pSciT1Dhw9gZ8qgpNGHGnLedNtq5HpN4+ffrMlnoKOu8kxktw\n\tXP98eVe5gFLzQ==","Date":"Sun, 5 Jun 2022 14:46:20 +0200","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<20220605124620.jm7y3vz2fsa7tdey@uno.localdomain>","References":"<20220530142722.57618-1-tomi.valkeinen@ideasonboard.com>\n\t<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23334,"web_url":"https://patchwork.libcamera.org/comment/23334/","msgid":"<f3dc567f-59cb-324d-bbbd-db7bf409b831@ideasonboard.com>","date":"2022-06-06T09:00:16","subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 05/06/2022 15:46, Jacopo Mondi wrote:\n> Hi Tomi\n> \n> On Mon, May 30, 2022 at 05:27:22PM +0300, Tomi Valkeinen wrote:\n>> Add a Python version of simple-cam from:\n>>\n>> https://git.libcamera.org/libcamera/simple-cam.git\n>>\n>> Let's keep this in the libcamera repository until the Python API has\n>> stabilized a bit more, and then we could move this to the simple-cam\n>> repo.\n>>\n> \n> Looks very nice and it could indeed be added to the simple-cam\n> repository (or should we create an example directory in libcamera\n> sources ?)\n\nI think examples in libcamera repository makes sense. Why was the \nsimple-cam added to a separate repository originally?\n\n  Tomi","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 E3DD3BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jun 2022 09:00:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B09465633;\n\tMon,  6 Jun 2022 11:00:21 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A09EF633A4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jun 2022 11:00:19 +0200 (CEST)","from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 341DF30A;\n\tMon,  6 Jun 2022 11:00:19 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654506021;\n\tbh=bunmyB/lt8c4K1TNfJXG+aOqfNtId95cUqJwBNV7BXs=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=2eKNdq3V+EAAh0YUJjllMmmj8G5MAfSIqzep3fvLViv3SCqLwT+iMRbCSCxQWdNcQ\n\ttzjBwB6BGg0wKU9r6bHw0MNeP+30EiU71VDDsfq7CIUsm6/MZkifmV2biCxyNnvtT8\n\tDFZth3MKKKsnAELoy+N2+e765FARvv5wmK+UGd6H0GIgCWxxecIa8mkxSKq5wQYrQ0\n\tQSUR9vyuKK0PHu7UvNFvQ1ffcEfu4z1GtGmiyKq1GKqOYyfVXDDKGIJhXiq55AtZlH\n\tek1t4MiA3C+wRKi+STWnuJ8Z3D9tDNmQosmKg+ceXOcyTvCUn3l4Mi6UCYBbfQPro3\n\tMZS5PRSjXJbVw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1654506019;\n\tbh=bunmyB/lt8c4K1TNfJXG+aOqfNtId95cUqJwBNV7BXs=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=WYUMU+9REghiifcTPM95ZGJ6GZU8SFCSEhso8336glwdkBbOwnJXzX0DeGleYHwwj\n\tTOBXKDlQsDBUSa7YlYbHckWeqOQdjJnfREVTGygpJ0e3R7E9Ezvo67JGBVAGo3gIu9\n\tAdo/uYAtKwzSLvAJ0ZFzmREw93fPCi3pB/WraCks="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WYUMU+9R\"; dkim-atps=neutral","Message-ID":"<f3dc567f-59cb-324d-bbbd-db7bf409b831@ideasonboard.com>","Date":"Mon, 6 Jun 2022 12:00:16 +0300","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.9.1","Content-Language":"en-US","To":"Jacopo Mondi <jacopo@jmondi.org>","References":"<20220530142722.57618-1-tomi.valkeinen@ideasonboard.com>\n\t<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>\n\t<20220605124620.jm7y3vz2fsa7tdey@uno.localdomain>","In-Reply-To":"<20220605124620.jm7y3vz2fsa7tdey@uno.localdomain>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","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":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23335,"web_url":"https://patchwork.libcamera.org/comment/23335/","msgid":"<20220606091116.x56rkvtd442dl3h3@uno.localdomain>","date":"2022-06-06T09:11:16","subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Tomi,\n\nOn Mon, Jun 06, 2022 at 12:00:16PM +0300, Tomi Valkeinen wrote:\n> On 05/06/2022 15:46, Jacopo Mondi wrote:\n> > Hi Tomi\n> >\n> > On Mon, May 30, 2022 at 05:27:22PM +0300, Tomi Valkeinen wrote:\n> > > Add a Python version of simple-cam from:\n> > >\n> > > https://git.libcamera.org/libcamera/simple-cam.git\n> > >\n> > > Let's keep this in the libcamera repository until the Python API has\n> > > stabilized a bit more, and then we could move this to the simple-cam\n> > > repo.\n> > >\n> >\n> > Looks very nice and it could indeed be added to the simple-cam\n> > repository (or should we create an example directory in libcamera\n> > sources ?)\n>\n> I think examples in libcamera repository makes sense. Why was the simple-cam\n> added to a separate repository originally?\n>\n\nI don't recall we had any discussion. Simple-cam started as a\nlive-coded example for a conference talk, than it has been made a\n\"real\" application later by Kieran, but I don't remember if we had\ndiscussions about where to keep it.\n\nProbably we considered cam and qcam more useful examples ?\nOne other thing is that if we keep simple-cam in libcamera repository,\nit will have to be updated when the API change, which is good as we\nknow it will be up to date, but is one more thing to maintain on the\nother hand...\n\n>  Tomi","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 8AE91BD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jun 2022 09:11:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D29E265635;\n\tMon,  6 Jun 2022 11:11:19 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::221])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9C70633A4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jun 2022 11:11:18 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 8FAA4240004;\n\tMon,  6 Jun 2022 09:11:17 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654506679;\n\tbh=IX+NuTEdm2noh0Mmiwu6RjBzpyzZ/79A/1u7pOWTF20=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=q495ezn9toORD5fUme5EzfkB5lgR98AbrV5bB+AETE5kVpIIg2aJrnB/cQW9xv0PW\n\tn7NhUJO+t1rGCHUNKPp2fU4Ds3YiXFewJHI0Okk8C2xvb1tsoARzMr+8PTgWfWyxi3\n\tfNK0jNATDQdsztYRug/U5h5WZsiq71U18K9+mDuaQr+OqhjmYUTE1dpyoIFFgWUVN1\n\tLP9D4pQ/6ww1VcyZ1Fp8v3pZ8XYA9lmxic4l5OjZLU0ZrWKOtye54pDbTJU+Z9IBSG\n\tiVdZzq6tgOBO/fnC/Gr5+8LAU4J6xbetnU6xut6IfL2ASCHlf7Ujuy/prrH6kFtERr\n\tk6u/tFCh7MoOw==","Date":"Mon, 6 Jun 2022 11:11:16 +0200","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<20220606091116.x56rkvtd442dl3h3@uno.localdomain>","References":"<20220530142722.57618-1-tomi.valkeinen@ideasonboard.com>\n\t<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>\n\t<20220605124620.jm7y3vz2fsa7tdey@uno.localdomain>\n\t<f3dc567f-59cb-324d-bbbd-db7bf409b831@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<f3dc567f-59cb-324d-bbbd-db7bf409b831@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23339,"web_url":"https://patchwork.libcamera.org/comment/23339/","msgid":"<Yp3kryqHA9I+fP0u@pendragon.ideasonboard.com>","date":"2022-06-06T11:27:43","subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Jun 06, 2022 at 11:11:16AM +0200, Jacopo Mondi wrote:\n> On Mon, Jun 06, 2022 at 12:00:16PM +0300, Tomi Valkeinen wrote:\n> > On 05/06/2022 15:46, Jacopo Mondi wrote:\n> > > On Mon, May 30, 2022 at 05:27:22PM +0300, Tomi Valkeinen wrote:\n> > > > Add a Python version of simple-cam from:\n> > > >\n> > > > https://git.libcamera.org/libcamera/simple-cam.git\n> > > >\n> > > > Let's keep this in the libcamera repository until the Python API has\n> > > > stabilized a bit more, and then we could move this to the simple-cam\n> > > > repo.\n> > >\n> > > Looks very nice and it could indeed be added to the simple-cam\n> > > repository (or should we create an example directory in libcamera\n> > > sources ?)\n> >\n> > I think examples in libcamera repository makes sense. Why was the simple-cam\n> > added to a separate repository originally?\n> \n> I don't recall we had any discussion. Simple-cam started as a\n> live-coded example for a conference talk, than it has been made a\n> \"real\" application later by Kieran, but I don't remember if we had\n> discussions about where to keep it.\n> \n> Probably we considered cam and qcam more useful examples ?\n> One other thing is that if we keep simple-cam in libcamera repository,\n> it will have to be updated when the API change, which is good as we\n> know it will be up to date, but is one more thing to maintain on the\n> other hand...\n\nOne of the reasons we've kept it in a separate repository was to\nshowcase the build system for a standalone libcamera application. That's\nless of a concern for a Python application.","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 5DDAABD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jun 2022 11:27:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9631265635;\n\tMon,  6 Jun 2022 13:27:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 75EF2633A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jun 2022 13:27:48 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DA30A30A;\n\tMon,  6 Jun 2022 13:27:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654514869;\n\tbh=g03yXviR/AM4IUtSGBAW/mPeH8MT1nHoIgOoFz3Eksw=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=cbcUfNWYhtetL6zbFCUwHg09L/CRbPbexElf/awsg+bhO/MWIBwSgfMiyLpiJe68c\n\tTBdKC4H2dXza17djsH+I5QmNjjOqPgjVXdiNHNlsjE1LKimb2JjxM6QpOzP8vGXlbY\n\t8cLntnlx5HPzmFpXMUOw4B+jFQH0rDJCIuURnOvGRKrqdpGQI/9MLKHs6RyG+cJkFu\n\t51mrAkKZWrJyuV50PuR1YnR6dxDoY+n0c1Bk/GQIxFSZtcSBcrccGhmBoED9kUXUiU\n\trAz3grGA1hLGyzoYjBE6eOBl2BtNw8Minu/btUlRv3lvUavYXuF2PjVrzDmCkXgnBh\n\tLwGUe1nUukYmw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1654514868;\n\tbh=g03yXviR/AM4IUtSGBAW/mPeH8MT1nHoIgOoFz3Eksw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=r2/OhZjc7W3ZbvwbNX+0/ztXq+iS9YgVSrtGnJPVMRf6FVRk8//BehxgBPN2WCokV\n\t711An9ZtGoO//g5e6gKf7FCGdtCQGXn1Uk34dQqOMML6NUIAaOzyd+JwXgSrs26EZh\n\tXJNkeFWds8QTyyZOt2a+K5GFKi6YlPhVAu14je2I="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"r2/OhZjc\"; dkim-atps=neutral","Date":"Mon, 6 Jun 2022 14:27:43 +0300","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<Yp3kryqHA9I+fP0u@pendragon.ideasonboard.com>","References":"<20220530142722.57618-1-tomi.valkeinen@ideasonboard.com>\n\t<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>\n\t<20220605124620.jm7y3vz2fsa7tdey@uno.localdomain>\n\t<f3dc567f-59cb-324d-bbbd-db7bf409b831@ideasonboard.com>\n\t<20220606091116.x56rkvtd442dl3h3@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220606091116.x56rkvtd442dl3h3@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23343,"web_url":"https://patchwork.libcamera.org/comment/23343/","msgid":"<Yp3t/hcQmmEVPipA@pendragon.ideasonboard.com>","date":"2022-06-06T12:07:26","subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Mon, May 30, 2022 at 05:27:22PM +0300, Tomi Valkeinen wrote:\n> Add a Python version of simple-cam from:\n> \n> https://git.libcamera.org/libcamera/simple-cam.git\n> \n> Let's keep this in the libcamera repository until the Python API has\n> stabilized a bit more, and then we could move this to the simple-cam\n> repo.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> ---\n>  src/py/examples/simple-cam.py | 350 ++++++++++++++++++++++++++++++++++\n>  1 file changed, 350 insertions(+)\n>  create mode 100755 src/py/examples/simple-cam.py\n> \n> diff --git a/src/py/examples/simple-cam.py b/src/py/examples/simple-cam.py\n> new file mode 100755\n> index 00000000..2b81bb65\n> --- /dev/null\n> +++ b/src/py/examples/simple-cam.py\n> @@ -0,0 +1,350 @@\n> +#!/usr/bin/env python3\n> +\n> +# SPDX-License-Identifier: BSD-3-Clause\n> +# Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> +\n> +# A simple libcamera capture example\n> +#\n> +# This is a python version of simple-cam from:\n> +# https://git.libcamera.org/libcamera/simple-cam.git\n> +#\n> +# \\todo Move to simple-cam repository when the Python API has stabilized more\n> +\n> +import libcamera as libcam\n> +import selectors\n> +import sys\n> +import time\n> +\n> +TIMEOUT_SEC = 3\n> +\n> +\n> +def handle_camera_event(cm):\n> +    # cm.get_ready_requests() will not block here, as we know there is an event\n> +    # to read.\n> +\n> +    reqs = cm.get_ready_requests()\n> +\n> +    # Process the captured frames\n> +\n> +    for req in reqs:\n> +        process_request(req)\n\nThis got me to think a bit more about event handling. libcamera will\nexpose other events (such as frame start, error events, ...). What would\nyou think of replacing get_ready_requests() with a handle_events()\nfunction that would take a set of callbacks for different types of\nevents ? Or we could add handle_request, handle_sof, ... properties to\nCameraManager, to store the event handlers, which would still be called\nby handle_events().\n\n> +\n> +\n> +def process_request(request):\n> +    global camera\n> +\n> +    print()\n> +\n> +    print(f'Request completed: {request}')\n> +\n> +    # When a request has completed, it is populated with a metadata control\n> +    # list that allows an application to determine various properties of\n> +    # the completed request. This can include the timestamp of the Sensor\n> +    # capture, or its gain and exposure values, or properties from the IPA\n> +    # such as the state of the 3A algorithms.\n> +    #\n> +    # To examine each request, print all the metadata for inspection. A custom\n> +    # application can parse each of these items and process them according to\n> +    # its needs.\n> +\n> +    requestMetadata = request.metadata\n> +    for id, value in requestMetadata.items():\n> +        print(f'\\t{id.name} = {value}')\n> +\n> +    # Each buffer has its own FrameMetadata to describe its state, or the\n> +    # usage of each buffer. While in our simple capture we only provide one\n> +    # buffer per request, a request can have a buffer for each stream that\n> +    # is established when configuring the camera.\n> +    #\n> +    # This allows a viewfinder and a still image to be processed at the\n> +    # same time, or to allow obtaining the RAW capture buffer from the\n> +    # sensor along with the image as processed by the ISP.\n> +\n> +    buffers = request.buffers\n> +    for _, buffer in buffers.items():\n> +        metadata = buffer.metadata\n> +\n> +        # Print some information about the buffer which has completed.\n> +        print(f' seq: {metadata.sequence:06} timestamp: {metadata.timestamp} bytesused: ' +\n> +              '/'.join([str(p.bytes_used) for p in metadata.planes]))\n> +\n> +        # Image data can be accessed here, but the FrameBuffer\n> +        # must be mapped by the application\n> +\n> +    # Re-queue the Request to the camera.\n> +    request.reuse()\n> +    camera.queue_request(request)\n> +\n> +\n> +# ----------------------------------------------------------------------------\n> +# Camera Naming.\n> +#\n> +# Applications are responsible for deciding how to name cameras, and present\n> +# that information to the users. Every camera has a unique identifier, though\n> +# this string is not designed to be friendly for a human reader.\n> +#\n> +# To support human consumable names, libcamera provides camera properties\n> +# that allow an application to determine a naming scheme based on its needs.\n> +#\n> +# In this example, we focus on the location property, but also detail the\n> +# model string for external cameras, as this is more likely to be visible\n> +# information to the user of an externally connected device.\n> +#\n> +# The unique camera ID is appended for informative purposes.\n> +#\n> +def camera_name(camera):\n> +    props = camera.properties\n> +    location = props.get(libcam.properties.Location, None)\n> +\n> +    if location == libcam.properties.LocationEnum.Front:\n> +        name = 'Internal front camera'\n> +    elif location == libcam.properties.LocationEnum.Back:\n> +        name = 'Internal back camera'\n> +    elif location == libcam.properties.LocationEnum.External:\n> +        name = 'External camera'\n> +        if libcam.properties.Model in props:\n> +            name += f' \"{props[libcam.properties.Model]}\"'\n> +    else:\n> +        name = 'Undefined location'\n> +\n> +    name += f' ({camera.id})'\n> +\n> +    return name\n> +\n> +\n> +def main():\n> +    global camera\n> +\n> +    # --------------------------------------------------------------------\n> +    # Get the Camera Manager.\n> +    #\n> +    # The Camera Manager is responsible for enumerating all the Camera\n> +    # in the system, by associating Pipeline Handlers with media entities\n> +    # registered in the system.\n> +    #\n> +    # The CameraManager provides a list of available Cameras that\n> +    # applications can operate on.\n> +    #\n> +    # There can only be a single CameraManager within any process space.\n> +\n> +    cm = libcam.CameraManager.singleton()\n> +\n> +    # Just as a test, generate names of the Cameras registered in the\n> +    # system, and list them.\n> +\n> +    for camera in cm.cameras:\n> +        print(f' - {camera_name(camera)}')\n> +\n> +    # --------------------------------------------------------------------\n> +    # Camera\n> +    #\n> +    # Camera are entities created by pipeline handlers, inspecting the\n> +    # entities registered in the system and reported to applications\n> +    # by the CameraManager.\n> +    #\n> +    # In general terms, a Camera corresponds to a single image source\n> +    # available in the system, such as an image sensor.\n> +    #\n> +    # Application lock usage of Camera by 'acquiring' them.\n> +    # Once done with it, application shall similarly 'release' the Camera.\n> +    #\n> +    # As an example, use the first available camera in the system after\n> +    # making sure that at least one camera is available.\n> +    #\n> +    # Cameras can be obtained by their ID or their index, to demonstrate\n> +    # this, the following code gets the ID of the first camera; then gets\n> +    # the camera associated with that ID (which is of course the same as\n> +    # cm.cameras[0]).\n> +\n> +    if not cm.cameras:\n> +        print('No cameras were identified on the system.')\n> +        return -1\n> +\n> +    camera_id = cm.cameras[0].id\n> +    camera = cm.get(camera_id)\n> +    camera.acquire()\n> +\n> +    # --------------------------------------------------------------------\n> +    # Stream\n> +    #\n> +    # Each Camera supports a variable number of Stream. A Stream is\n> +    # produced by processing data produced by an image source, usually\n> +    # by an ISP.\n> +    #\n> +    #   +-------------------------------------------------------+\n> +    #   | Camera                                                |\n> +    #   |                +-----------+                          |\n> +    #   | +--------+     |           |------> [  Main output  ] |\n> +    #   | | Image  |     |           |                          |\n> +    #   | |        |---->|    ISP    |------> [   Viewfinder  ] |\n> +    #   | | Source |     |           |                          |\n> +    #   | +--------+     |           |------> [ Still Capture ] |\n> +    #   |                +-----------+                          |\n> +    #   +-------------------------------------------------------+\n> +    #\n> +    # The number and capabilities of the Stream in a Camera are\n> +    # a platform dependent property, and it's the pipeline handler\n> +    # implementation that has the responsibility of correctly\n> +    # report them.\n> +\n> +    # --------------------------------------------------------------------\n> +    # Camera Configuration.\n> +    #\n> +    # Camera configuration is tricky! It boils down to assign resources\n> +    # of the system (such as DMA engines, scalers, format converters) to\n> +    # the different image streams an application has requested.\n> +    #\n> +    # Depending on the system characteristics, some combinations of\n> +    # sizes, formats and stream usages might or might not be possible.\n> +    #\n> +    # A Camera produces a CameraConfigration based on a set of intended\n> +    # roles for each Stream the application requires.\n> +\n> +    config = camera.generate_configuration([libcam.StreamRole.Viewfinder])\n> +\n> +    # The CameraConfiguration contains a StreamConfiguration instance\n> +    # for each StreamRole requested by the application, provided\n> +    # the Camera can support all of them.\n> +    #\n> +    # Each StreamConfiguration has default size and format, assigned\n> +    # by the Camera depending on the Role the application has requested.\n> +\n> +    stream_config = config.at(0)\n> +    print(f'Default viewfinder configuration is: {stream_config}')\n> +\n> +    # Each StreamConfiguration parameter which is part of a\n> +    # CameraConfiguration can be independently modified by the\n> +    # application.\n> +    #\n> +    # In order to validate the modified parameter, the CameraConfiguration\n> +    # should be validated -before- the CameraConfiguration gets applied\n> +    # to the Camera.\n> +    #\n> +    # The CameraConfiguration validation process adjusts each\n> +    # StreamConfiguration to a valid value.\n> +\n> +    # Validating a CameraConfiguration -before- applying it will adjust it\n> +    # to a valid configuration which is as close as possible to the one\n> +    # requested.\n> +\n> +    config.validate()\n> +    print(f'Validated viewfinder configuration is: {stream_config}')\n> +\n> +    # Once we have a validated configuration, we can apply it to the\n> +    # Camera.\n> +\n> +    camera.configure(config)\n> +\n> +    # --------------------------------------------------------------------\n> +    # Buffer Allocation\n> +    #\n> +    # Now that a camera has been configured, it knows all about its\n> +    # Streams sizes and formats. The captured images need to be stored in\n> +    # framebuffers which can either be provided by the application to the\n> +    # library, or allocated in the Camera and exposed to the application\n> +    # by libcamera.\n> +    #\n> +    # An application may decide to allocate framebuffers from elsewhere,\n> +    # for example in memory allocated by the display driver that will\n> +    # render the captured frames. The application will provide them to\n> +    # libcamera by constructing FrameBuffer instances to capture images\n> +    # directly into.\n> +    #\n> +    # Alternatively libcamera can help the application by exporting\n> +    # buffers allocated in the Camera using a FrameBufferAllocator\n> +    # instance and referencing a configured Camera to determine the\n> +    # appropriate buffer size and types to create.\n> +\n> +    allocator = libcam.FrameBufferAllocator(camera)\n> +\n> +    for cfg in config:\n> +        ret = allocator.allocate(cfg.stream)\n> +        if ret < 0:\n> +            print('Can\\'t allocate buffers')\n> +            return -1\n> +\n> +        allocated = len(allocator.buffers(cfg.stream))\n> +        print(f'Allocated {allocated} buffers for stream')\n> +\n> +    # --------------------------------------------------------------------\n> +    # Frame Capture\n> +    #\n> +    # libcamera frames capture model is based on the 'Request' concept.\n> +    # For each frame a Request has to be queued to the Camera.\n> +    #\n> +    # A Request refers to (at least one) Stream for which a Buffer that\n> +    # will be filled with image data shall be added to the Request.\n> +    #\n> +    # A Request is associated with a list of Controls, which are tunable\n> +    # parameters (similar to v4l2_controls) that have to be applied to\n> +    # the image.\n> +    #\n> +    # Once a request completes, all its buffers will contain image data\n> +    # that applications can access and for each of them a list of metadata\n> +    # properties that reports the capture parameters applied to the image.\n> +\n> +    stream = stream_config.stream\n> +    buffers = allocator.buffers(stream)\n> +    requests = []\n> +    for i in range(len(buffers)):\n> +        request = camera.create_request()\n> +        if not request:\n> +            print('Can\\'t create request')\n> +            return -1\n> +\n> +        buffer = buffers[i]\n> +        ret = request.add_buffer(stream, buffer)\n> +        if ret < 0:\n> +            print('Can\\'t set buffer for request')\n> +            return -1\n> +\n> +        # Controls can be added to a request on a per frame basis.\n> +        request.set_control(libcam.controls.Brightness, 0.5)\n> +\n> +        requests.append(request)\n> +\n> +    # --------------------------------------------------------------------\n> +    # Start Capture\n> +    #\n> +    # In order to capture frames the Camera has to be started and\n> +    # Request queued to it. Enough Request to fill the Camera pipeline\n> +    # depth have to be queued before the Camera start delivering frames.\n> +    #\n> +    # When a Request has been completed, it will be added to a list in the\n> +    # CameraManager and an event will be raised using eventfd.\n> +    #\n> +    # The list of completed Requests can be retrieved with\n> +    # CameraManager.get_ready_requests(), which will also clear the list in the\n> +    # CameraManager.\n> +    #\n> +    # The eventfd can be retrieved from CameraManager.event_fd, and the fd can\n\nI know you renamed this from fd to event_fd recently, but I'm thinking\nabout going back to fd. The rationale is that it needs to be an fd on\nwhich the application can select(), but the fact that it's an event_fd\nis an implementation detail.\n\nThese comments are not to be addressed in this patch, so\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +    # be waited upon using e.g. Python's selectors.\n> +\n> +    camera.start()\n> +    for request in requests:\n> +        camera.queue_request(request)\n> +\n> +    sel = selectors.DefaultSelector()\n> +    sel.register(cm.event_fd, selectors.EVENT_READ, lambda fd: handle_camera_event(cm))\n> +\n> +    start_time = time.time()\n> +\n> +    while time.time() - start_time < TIMEOUT_SEC:\n> +        events = sel.select()\n> +        for key, mask in events:\n> +            key.data(key.fileobj)\n> +\n> +    # --------------------------------------------------------------------\n> +    # Clean Up\n> +    #\n> +    # Stop the Camera, release resources and stop the CameraManager.\n> +    # libcamera has now released all resources it owned.\n> +\n> +    camera.stop()\n> +    camera.release()\n> +\n> +    return 0\n> +\n> +\n> +if __name__ == '__main__':\n> +    sys.exit(main())","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 864B1BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jun 2022 12:07:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E237D65635;\n\tMon,  6 Jun 2022 14:07:33 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ED6D5633A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jun 2022 14:07:31 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4EEF730A;\n\tMon,  6 Jun 2022 14:07:31 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654517253;\n\tbh=OVqMgsUWA1d13vSTObQti0CZdXiIIWbVYShQ/688jao=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ipUU23xWR4lqPjwwn2NuvEvNLHZnHvkSoy4FkmUlE99ordGnFftivacxhIZRRMvPx\n\tdEguLSubcQ6+dEGa/bqK6Ildf/6G5tjoT+MB+P2QeYj8dXPB6RuCcK38N91CbN+Uth\n\tIWaqelkfRC5NmmdmjSf/ktF8BPrN90NM+8NLi54efzv4wBmY7qaKM9qqpW6PNfEE0m\n\t4JNkVMX9uIW5ut8KjBFwfdnx9SkJQ0eDVszFCDv+7kBlhKBJkcyHUrLsyGr7WXABrQ\n\t2nmvHGrUlM9PnMbxnmzhpVk03pkLaynAbezATncbi1gaGf5zIMQm0Zn7Tt0CrrD8Ex\n\tjcoPPLPmEaceg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1654517251;\n\tbh=OVqMgsUWA1d13vSTObQti0CZdXiIIWbVYShQ/688jao=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JxBco6cZw8waX9pDkRg/4wEmTxCPXsge4+Y7+ftX8dwEvBHg3ZLV2OiGuuvaLpgGV\n\tL1aMw2ic4AWCpWBhBozOO2o3nLeaR1xy/2R6mgytSKBn4/f/xCc3qEkkjxWjV1ay4k\n\tUUZ7Kk09nfu9XeqB2jLN5KIrzZVwdQbBR2mJgCxg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"JxBco6cZ\"; dkim-atps=neutral","Date":"Mon, 6 Jun 2022 15:07:26 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<Yp3t/hcQmmEVPipA@pendragon.ideasonboard.com>","References":"<20220530142722.57618-1-tomi.valkeinen@ideasonboard.com>\n\t<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23344,"web_url":"https://patchwork.libcamera.org/comment/23344/","msgid":"<34cae4e1-acb9-c2f1-674f-ef282940beb4@ideasonboard.com>","date":"2022-06-06T12:56:00","subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 06/06/2022 15:07, Laurent Pinchart wrote:\n\n>> +def handle_camera_event(cm):\n>> +    # cm.get_ready_requests() will not block here, as we know there is an event\n>> +    # to read.\n>> +\n>> +    reqs = cm.get_ready_requests()\n>> +\n>> +    # Process the captured frames\n>> +\n>> +    for req in reqs:\n>> +        process_request(req)\n> \n> This got me to think a bit more about event handling. libcamera will\n> expose other events (such as frame start, error events, ...). What would\n> you think of replacing get_ready_requests() with a handle_events()\n> function that would take a set of callbacks for different types of\n> events ? Or we could add handle_request, handle_sof, ... properties to\n> CameraManager, to store the event handlers, which would still be called\n> by handle_events().\n\nI think that makes sense. Not sure if it'd be properties or giving the \ncallbacks in parameters, but something like that. Let's break the API \nagain! ;)\n\nWe probably want to have the order of events preserved, so we need a \nsingle queue of events. So maybe get_events() instead of \nget_ready_requests(), and on top we might have handle_events() which \ngets the events and calls the handler based on the event type.\n\n>> +    # --------------------------------------------------------------------\n>> +    # Start Capture\n>> +    #\n>> +    # In order to capture frames the Camera has to be started and\n>> +    # Request queued to it. Enough Request to fill the Camera pipeline\n>> +    # depth have to be queued before the Camera start delivering frames.\n>> +    #\n>> +    # When a Request has been completed, it will be added to a list in the\n>> +    # CameraManager and an event will be raised using eventfd.\n>> +    #\n>> +    # The list of completed Requests can be retrieved with\n>> +    # CameraManager.get_ready_requests(), which will also clear the list in the\n>> +    # CameraManager.\n>> +    #\n>> +    # The eventfd can be retrieved from CameraManager.event_fd, and the fd can\n> \n> I know you renamed this from fd to event_fd recently, but I'm thinking\n\nIt was 'efd' before, not 'fd'.\n\n> about going back to fd. The rationale is that it needs to be an fd on\n> which the application can select(), but the fact that it's an event_fd\n> is an implementation detail.\n\nNote that 'event_fd' does not refer to it being a Linux eventfd, but \nrather it being an fd that it used to wait for events.\n\nI'm not strictly against the change, though, but 'fd' sounds a bit vague \nto me.\n\n  Tomi","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 19657BD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jun 2022 12:56:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 45D2665635;\n\tMon,  6 Jun 2022 14:56:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D9A1633A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jun 2022 14:56:03 +0200 (CEST)","from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A23B230A;\n\tMon,  6 Jun 2022 14:56:02 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654520164;\n\tbh=xrUCJx1jqN/fzaGXq5PajnQOtt+9hZhOMrM1YO2BAko=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=hmZ4iuvWJVI4gVk21CHolxmVeEGLFQFuT1R4p+dkqE+Ik1v2uqMjCWfqj+qAU5TDg\n\tNZKJBnQb7itaLxXEcc27Nmbe+/LioZP+HazsY70lpsAPjFF2Hqwbbs9FpYR9TtIfQO\n\t07NGLyI5ctY/yhnfYYMYpkROB7WueJWlVuHvi4t2PdWcNkKtTCHRgkJVg83hNV83UX\n\tTdw7uNfGb+e0JPGBXAb6j9MLfwGob3neWpi9Ucaoih6c4B6d+EYGk3Wb6MEFh5sj9M\n\tjm+Tj1CSu1AkFgw40W8dXZenww3q6UG9mb+TEDXJiykjYH/sCRFDwPscDLhuUk51Uz\n\tkcUMB8OQa1nAA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1654520162;\n\tbh=xrUCJx1jqN/fzaGXq5PajnQOtt+9hZhOMrM1YO2BAko=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=AzZVQyKwsIvBxk1TQyflVxp1JH3JuS4VlFJLpBrFXf8tGTNvC3opinp4EQVFdWY4V\n\tGwVF6bR0HTVuPwyTJFQtu8f7Fy7ctBfKupXrQv+NPxtzPTX9eVTJyDMAFRaX+07lP2\n\tsnczDZ4zjVDp2clWl7G22vZFukdzFAWdP+ZLtkK4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"AzZVQyKw\"; dkim-atps=neutral","Message-ID":"<34cae4e1-acb9-c2f1-674f-ef282940beb4@ideasonboard.com>","Date":"Mon, 6 Jun 2022 15:56:00 +0300","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.9.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20220530142722.57618-1-tomi.valkeinen@ideasonboard.com>\n\t<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>\n\t<Yp3t/hcQmmEVPipA@pendragon.ideasonboard.com>","In-Reply-To":"<Yp3t/hcQmmEVPipA@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","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":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23358,"web_url":"https://patchwork.libcamera.org/comment/23358/","msgid":"<YqEJhLCbPTKfBJqo@pendragon.ideasonboard.com>","date":"2022-06-08T20:41:40","subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nOn Mon, Jun 06, 2022 at 03:56:00PM +0300, Tomi Valkeinen wrote:\n> On 06/06/2022 15:07, Laurent Pinchart wrote:\n> \n> >> +def handle_camera_event(cm):\n> >> +    # cm.get_ready_requests() will not block here, as we know there is an event\n> >> +    # to read.\n> >> +\n> >> +    reqs = cm.get_ready_requests()\n> >> +\n> >> +    # Process the captured frames\n> >> +\n> >> +    for req in reqs:\n> >> +        process_request(req)\n> > \n> > This got me to think a bit more about event handling. libcamera will\n> > expose other events (such as frame start, error events, ...). What would\n> > you think of replacing get_ready_requests() with a handle_events()\n> > function that would take a set of callbacks for different types of\n> > events ? Or we could add handle_request, handle_sof, ... properties to\n> > CameraManager, to store the event handlers, which would still be called\n> > by handle_events().\n> \n> I think that makes sense. Not sure if it'd be properties or giving the \n> callbacks in parameters, but something like that. Let's break the API \n> again! ;)\n\n:-)\n\n> We probably want to have the order of events preserved, so we need a \n> single queue of events. So maybe get_events() instead of \n> get_ready_requests(), and on top we might have handle_events() which \n> gets the events and calls the handler based on the event type.\n\nSounds good.\n\n> >> +    # --------------------------------------------------------------------\n> >> +    # Start Capture\n> >> +    #\n> >> +    # In order to capture frames the Camera has to be started and\n> >> +    # Request queued to it. Enough Request to fill the Camera pipeline\n> >> +    # depth have to be queued before the Camera start delivering frames.\n> >> +    #\n> >> +    # When a Request has been completed, it will be added to a list in the\n> >> +    # CameraManager and an event will be raised using eventfd.\n> >> +    #\n> >> +    # The list of completed Requests can be retrieved with\n> >> +    # CameraManager.get_ready_requests(), which will also clear the list in the\n> >> +    # CameraManager.\n> >> +    #\n> >> +    # The eventfd can be retrieved from CameraManager.event_fd, and the fd can\n> > \n> > I know you renamed this from fd to event_fd recently, but I'm thinking\n> \n> It was 'efd' before, not 'fd'.\n> \n> > about going back to fd. The rationale is that it needs to be an fd on\n> > which the application can select(), but the fact that it's an event_fd\n> > is an implementation detail.\n> \n> Note that 'event_fd' does not refer to it being a Linux eventfd, but \n> rather it being an fd that it used to wait for events.\n> \n> I'm not strictly against the change, though, but 'fd' sounds a bit vague \n> to me.\n\nYou're right, let's keep event_fd.","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 C8E6BBD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Jun 2022 20:41:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 147AD65633;\n\tWed,  8 Jun 2022 22:41:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 220F065632\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Jun 2022 22:41:47 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 361906CF;\n\tWed,  8 Jun 2022 22:41:46 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654720909;\n\tbh=AVTW7kou0Ehvg63zC6qkrQZUs6fm5zJz63PV4QNS1YI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=tQ96wfhxYqc2aUd5WwN8K/B2LHoLoeEZwtqSy9+qZ2ccWG93dAdBpEGeDOXEf2zb3\n\tcAI+RJwVDPalUa1SPVRe26KsN5HdYm0HipRyGCKkyqt9HKhF0Xwu3V41Qfjrgc5hfH\n\tw+BSZUXat1RkYU6TyZUsVT8szY+sgvYfE5A6S4xHGAtg3GpcjFHUMN6KA8xlIj5R0d\n\tqkKBjpUbRlCPuBBGJduC9eMSsopq30zi8eCrzdA9JU4Ji+Vb7dCCpAQLi6uxslX/b5\n\tqxdxKyz5lNdicyUax1pv5RcrYdZbJDFJGjtRus3L4BYKUZv9lmfXpPz4mjT3mOuEJk\n\t6CFRY2AsiVWHw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1654720906;\n\tbh=AVTW7kou0Ehvg63zC6qkrQZUs6fm5zJz63PV4QNS1YI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AXk3nQT23LV78OXcShJpeglUrPaStjxGHwmyITMiTYx0v4x36sY0z4os0ue+wvbbY\n\twOF7oGp7YhNPPtQeFUY/m9KZmLFSIj+79LhTHuCIhyZjSuRHMtZ7MGtBxidyUAJapm\n\tAYSnhfeUAm0/CL1Edq/7OzGvKFG7y/zu1n+If04Q="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"AXk3nQT2\"; dkim-atps=neutral","Date":"Wed, 8 Jun 2022 23:41:40 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<YqEJhLCbPTKfBJqo@pendragon.ideasonboard.com>","References":"<20220530142722.57618-1-tomi.valkeinen@ideasonboard.com>\n\t<20220530142722.57618-17-tomi.valkeinen@ideasonboard.com>\n\t<Yp3t/hcQmmEVPipA@pendragon.ideasonboard.com>\n\t<34cae4e1-acb9-c2f1-674f-ef282940beb4@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<34cae4e1-acb9-c2f1-674f-ef282940beb4@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 16/16] py: examples: Add\n\tsimple-cam.py","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]