[{"id":5246,"web_url":"https://patchwork.libcamera.org/comment/5246/","msgid":"<20200617151437.klycxp73cz3bh7zu@uno.localdomain>","date":"2020-06-17T15:14:37","subject":"Re: [libcamera-devel] [PATCH 10/15] v4l2: v4l2_camera_proxy: Call\n\tstreamoff on reqbufs 0","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Paul,\n\nOn Tue, Jun 16, 2020 at 10:12:39PM +0900, Paul Elder wrote:\n> VIDIOC_REQBUFS with count = 0 should also exhibit the same effects as\n> VIDIOC_STREAMOFF if the stream is on. Although V4L2Camera::streamOff is\n> called in the handler for VIDIOC_REQBUFS in V4L2CameraProxy, there is\n> still some state in V4L2CameraProxy that needs to be reset, so call\n> V4L2CameraProxy::vidioc_streamoff.\n>\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  src/v4l2/v4l2_camera_proxy.cpp | 7 +++++++\n>  1 file changed, 7 insertions(+)\n>\n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 63b4124..45e4656 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -510,6 +510,13 @@ int V4L2CameraProxy::vidioc_reqbufs(int fd, struct v4l2_requestbuffers *arg)\n>  \tmemset(arg->reserved, 0, sizeof(arg->reserved));\n>\n>  \tif (arg->count == 0) {\n> +\t\tif (streaming_) {\n> +\t\t\tint argStreamoff = arg->type;\n> +\t\t\tret = vidioc_streamoff(fd, &argStreamoff);\n\nvidioc_streamoff() calls vcam_->streamOff()\n\n> +\t\t\tif (ret < 0)\n> +\t\t\t\treturn ret;\n> +\t\t}\n> +\n>  \t\tunlock(fd);\n>  \t\treturn freeBuffers();\n\nas well as freeBuffers() does.\n\nIs this intentional ? Shouldn't you call vcam_->freeBuffers() here and\ncall vidioc_streamoff() only if you're streaming as you're doing ?\n\nThanks\n  j\n\n>  \t}\n> --\n> 2.27.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 56D08603BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Jun 2020 17:11:13 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id C2B551BF206;\n\tWed, 17 Jun 2020 15:11:12 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Wed, 17 Jun 2020 17:14:37 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200617151437.klycxp73cz3bh7zu@uno.localdomain>","References":"<20200616131244.70308-1-paul.elder@ideasonboard.com>\n\t<20200616131244.70308-11-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200616131244.70308-11-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 10/15] v4l2: v4l2_camera_proxy: Call\n\tstreamoff on reqbufs 0","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, 17 Jun 2020 15:11:13 -0000"}}]