[{"id":4021,"web_url":"https://patchwork.libcamera.org/comment/4021/","msgid":"<20200316074329.GJ4732@pendragon.ideasonboard.com>","date":"2020-03-16T07:43:29","subject":"Re: [libcamera-devel] [PATCH] cam: Create stream names after\n\tconfiguring the camera","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Mon, Mar 16, 2020 at 03:01:09AM +0100, Niklas Söderlund wrote:\n> The stream in the stream configuration is not filled in before we\n> configure the camera, move the generating and caching of names after the\n> configuration.\n> \n> Without this fix writing multiple streams to disk overwrites the frames\n> as the filenames are not unique.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/cam/capture.cpp | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp\n> index b62a9b24b2169b05..55fa2dabcee97f21 100644\n> --- a/src/cam/capture.cpp\n> +++ b/src/cam/capture.cpp\n> @@ -30,18 +30,18 @@ int Capture::run(EventLoop *loop, const OptionsParser::Options &options)\n>  \t\treturn -ENODEV;\n>  \t}\n>  \n> +\tret = camera_->configure(config_);\n> +\tif (ret < 0) {\n> +\t\tstd::cout << \"Failed to configure camera\" << std::endl;\n> +\t\treturn ret;\n> +\t}\n> +\n>  \tstreamName_.clear();\n>  \tfor (unsigned int index = 0; index < config_->size(); ++index) {\n>  \t\tStreamConfiguration &cfg = config_->at(index);\n>  \t\tstreamName_[cfg.stream()] = \"stream\" + std::to_string(index);\n>  \t}\n>  \n> -\tret = camera_->configure(config_);\n> -\tif (ret < 0) {\n> -\t\tstd::cout << \"Failed to configure camera\" << std::endl;\n> -\t\treturn ret;\n> -\t}\n> -\n>  \tcamera_->requestCompleted.connect(this, &Capture::requestComplete);\n>  \n>  \tif (options.isSet(OptFile)) {","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 9B3EA60417\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Mar 2020 08:43:35 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2679D2D6;\n\tMon, 16 Mar 2020 08:43:35 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1584344615;\n\tbh=g09q7srSi3u9tVdrHRHpBm3/6W7OXiXbgkYS89Agggk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=n5fgXaUSIaNAKeziNKKbPgv3hMLzkF4SQGJYraCBjaBp3DfKMT4ESgEw9+IzCTKhp\n\tEL2vCJoSQuBdSg9P1mbZEvVt7az1nBQrxmAgMHidvh5wHYjjXeJ1l/Bpc8j7fSctO3\n\twYn7OspkK/GMLxkVPaK34WSw+h1ypgfWtZXcuBA4=","Date":"Mon, 16 Mar 2020 09:43:29 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200316074329.GJ4732@pendragon.ideasonboard.com>","References":"<20200316020109.2466468-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200316020109.2466468-1-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] cam: Create stream names after\n\tconfiguring the camera","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":"Mon, 16 Mar 2020 07:43:35 -0000"}},{"id":4066,"web_url":"https://patchwork.libcamera.org/comment/4066/","msgid":"<20200318032244.GA2856559@oden.dyn.berto.se>","date":"2020-03-18T03:22:44","subject":"Re: [libcamera-devel] [PATCH] cam: Create stream names after\n\tconfiguring the camera","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi,\n\nI have now pushed this patch to master.\n\nOn 2020-03-16 03:01:09 +0100, Niklas Söderlund wrote:\n> The stream in the stream configuration is not filled in before we\n> configure the camera, move the generating and caching of names after the\n> configuration.\n> \n> Without this fix writing multiple streams to disk overwrites the frames\n> as the filenames are not unique.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/cam/capture.cpp | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp\n> index b62a9b24b2169b05..55fa2dabcee97f21 100644\n> --- a/src/cam/capture.cpp\n> +++ b/src/cam/capture.cpp\n> @@ -30,18 +30,18 @@ int Capture::run(EventLoop *loop, const OptionsParser::Options &options)\n>  \t\treturn -ENODEV;\n>  \t}\n>  \n> +\tret = camera_->configure(config_);\n> +\tif (ret < 0) {\n> +\t\tstd::cout << \"Failed to configure camera\" << std::endl;\n> +\t\treturn ret;\n> +\t}\n> +\n>  \tstreamName_.clear();\n>  \tfor (unsigned int index = 0; index < config_->size(); ++index) {\n>  \t\tStreamConfiguration &cfg = config_->at(index);\n>  \t\tstreamName_[cfg.stream()] = \"stream\" + std::to_string(index);\n>  \t}\n>  \n> -\tret = camera_->configure(config_);\n> -\tif (ret < 0) {\n> -\t\tstd::cout << \"Failed to configure camera\" << std::endl;\n> -\t\treturn ret;\n> -\t}\n> -\n>  \tcamera_->requestCompleted.connect(this, &Capture::requestComplete);\n>  \n>  \tif (options.isSet(OptFile)) {\n> -- \n> 2.25.1\n>","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DDCCD6041A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Mar 2020 04:22:47 +0100 (CET)","by mail-lf1-x144.google.com with SMTP id j15so19128337lfk.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Mar 2020 20:22:47 -0700 (PDT)","from localhost (h-200-138.A463.priv.bahnhof.se. [176.10.200.138])\n\tby smtp.gmail.com with ESMTPSA id\n\t18sm3508648ljv.30.2020.03.17.20.22.44\n\tfor <libcamera-devel@lists.libcamera.org>\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 17 Mar 2020 20:22:45 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=p7U8xmvWiUax28UHVz9P4fEnOsTe/APBS0VWyA6qDCA=;\n\tb=RXVhQKWkZPdOnkwPCczKBNyxXKuOTHstuGJZ1kFPfZPCXOeKCeS/oDegfrNzsWM2Fe\n\tijzhd/Np3ixczi9TWU+RZZyJOutBkB4gAWA7WdfLgykhP33uy5Yzyeq63Kz9cHjfaMUW\n\tISQnayI11tfb9HpDVVv5QtoR4Dk2fp5iXLwHQUbPJwJSuWqgvrNPEg6rzKCvXQgC/U28\n\t8r1TmMkvQ1GDy41m4FjWG3o6uNkBFMoXy/l/SRkUlDYj083GRlqM7f9bDsO0jAsEZPFZ\n\tOGl+7rZYPKx/diCi26WJggNcb1qhDJvNVLMNR84QZvxvEiP2oD3CSsAzojbsbpwYNDY5\n\tHeQg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=p7U8xmvWiUax28UHVz9P4fEnOsTe/APBS0VWyA6qDCA=;\n\tb=CIhRGZiFKIxz35X6/NFYNWGYmw2zBEbPI7iNa7xWrZW8chowlIJut42cuJRi1EQnKj\n\tL6fEzcGws0oHuQhghQkgA/022YtrC0d530+o798N2FiFXLah+wQhsqgYFda3ZMATT1qm\n\tgnudzy7ylBnoEa7fPhlSmwLcuAzDFfTaezwbTuzqRLO0qtMkX3HG9pS2lTKnvTddeLs7\n\tj4mXcNbJjerOrz8t5sSu+uWvCb6Z9NcfcI3mJfuL9aS03/24PSS7MZg24YtogchZgjc5\n\tJHWnenmWPXhdnVhh0CxuXAb/qNJMC+SQFrCsuGrpXgRYYyrwNheqEYv//9fSkEXsyZsm\n\tOXGw==","X-Gm-Message-State":"ANhLgQ1/0tT+hnVgr/1NJ02MQQKhUqsqunZV7c9hQfE5K1oOBk8J1n6E\n\tYsCrMSz5nscw1g4S09h3Zqhb05kLVls=","X-Google-Smtp-Source":"ADFU+vu+gRz/CvK6JeYIhnL3ABqf09OYAxRc2Pj/EzcOozlKscSMJdq/Jx8dLImvN7jU8RqaOji4Tw==","X-Received":"by 2002:a19:1c3:: with SMTP id 186mr1496425lfb.88.1584501766693; \n\tTue, 17 Mar 2020 20:22:46 -0700 (PDT)","Date":"Wed, 18 Mar 2020 04:22:44 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200318032244.GA2856559@oden.dyn.berto.se>","References":"<20200316020109.2466468-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200316020109.2466468-1-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH] cam: Create stream names after\n\tconfiguring the camera","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":"Wed, 18 Mar 2020 03:22:48 -0000"}}]