From patchwork Sat Jan 18 21:31:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 2682 Return-Path: Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3E72360457 for ; Sat, 18 Jan 2020 22:34:06 +0100 (CET) Received: from nicolas-tpx395.localdomain (unknown [IPv6:2002:c0de:c115:0:66fc:8b:2a38:8313]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: nicolas) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 05FFD28A2DB; Sat, 18 Jan 2020 21:34:04 +0000 (GMT) From: Nicolas Dufresne To: libcamera-devel@lists.libcamera.org Cc: Nicolas Dufresne Date: Sat, 18 Jan 2020 16:31:23 -0500 Message-Id: <20200118213123.27096-1-nicolas@ndufresne.ca> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] v4l2: Extend device caps with V4L2_CAP_STREAMING 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: Sat, 18 Jan 2020 21:34:06 -0000 From: Nicolas Dufresne This capability tells the application that mmap() is supported. GStreamer would return an error saying there there is no input/output method supported by this device otherwise. This was tested with: LD_PRELOAD=$(pwd)/build/src/v4l2/v4l2-compat.so GST_DEBUG="v4l2*:7" gst-launch-1.0 v4l2src ! videoconvert ! autovideosink With this patch, GStreamer will reach playing state. It then blocks waiting on poll() which is not implemented yet on our side. Signed-off-by: Nicolas Dufresne Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/v4l2/v4l2_camera_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 3013a3d..e58fd6a 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -179,7 +179,7 @@ void V4L2CameraProxy::querycap(std::shared_ptr camera) sizeof(capabilities_.bus_info)); /* \todo Put this in a header/config somewhere. */ capabilities_.version = KERNEL_VERSION(5, 2, 0); - capabilities_.device_caps = V4L2_CAP_VIDEO_CAPTURE; + capabilities_.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; capabilities_.capabilities = capabilities_.device_caps | V4L2_CAP_DEVICE_CAPS; memset(capabilities_.reserved, 0, sizeof(capabilities_.reserved));