From patchwork Tue Jun 16 13:12:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 4054 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4FC2B603C4 for ; Tue, 16 Jun 2020 15:13:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mC5v9Btv"; dkim-atps=neutral Received: from jade.flets-east.jp (unknown [IPv6:2400:4051:61:600:2807:bdfa:f6a:8e53]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D9E94F9; Tue, 16 Jun 2020 15:13:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1592313199; bh=2CS7/Khg/CLRDpVz0F3dcbSNJwsFYdeHXv0NRP0c4ao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mC5v9Btveo+SGhgcY073lkTc/a/KrZfN0S2KLAJDhJ1Vpy27LeOlw+ecElRGxzkLN BupM9WxgCJaM+3Girq20cht4xrNoD2IjNezYIzUTlozhnxNUHRHmGUQrRXhMOmsOXQ g5tHBiVhd7NQsCmHLvny3uTZkQaOO0X1V5WpG0TM= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 16 Jun 2020 22:12:39 +0900 Message-Id: <20200616131244.70308-11-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616131244.70308-1-paul.elder@ideasonboard.com> References: <20200616131244.70308-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/15] v4l2: v4l2_camera_proxy: Call streamoff on reqbufs 0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2020 13:13:19 -0000 VIDIOC_REQBUFS with count = 0 should also exhibit the same effects as VIDIOC_STREAMOFF if the stream is on. Although V4L2Camera::streamOff is called in the handler for VIDIOC_REQBUFS in V4L2CameraProxy, there is still some state in V4L2CameraProxy that needs to be reset, so call V4L2CameraProxy::vidioc_streamoff. Signed-off-by: Paul Elder --- src/v4l2/v4l2_camera_proxy.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 63b4124..45e4656 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -510,6 +510,13 @@ int V4L2CameraProxy::vidioc_reqbufs(int fd, struct v4l2_requestbuffers *arg) memset(arg->reserved, 0, sizeof(arg->reserved)); if (arg->count == 0) { + if (streaming_) { + int argStreamoff = arg->type; + ret = vidioc_streamoff(fd, &argStreamoff); + if (ret < 0) + return ret; + } + unlock(fd); return freeBuffers(); }