From patchwork Mon Feb 4 18:55:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 501 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 19BB260B2D for ; Mon, 4 Feb 2019 19:55:32 +0100 (CET) X-Halon-ID: 70d16a75-28ae-11e9-a58a-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from localhost.localdomain (unknown [81.164.19.127]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 70d16a75-28ae-11e9-a58a-005056917f90; Mon, 04 Feb 2019 19:55:29 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 4 Feb 2019 19:55:20 +0100 Message-Id: <20190204185521.23471-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204185521.23471-1-niklas.soderlund@ragnatech.se> References: <20190204185521.23471-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] libcamera: streams: extend stream configuration with buffer count X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2019 18:55:32 -0000 The camera needs to be configured with the number of buffers to use to satisfy the application use-case. While it's free for the application to request any number of buffers the pipeline needs to take the Linux drivers constraints into consideration. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- include/libcamera/stream.h | 2 ++ src/libcamera/stream.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index 4b24dd841dd64b64..890678360ee87fd7 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -17,6 +17,8 @@ struct StreamConfiguration { unsigned int width; unsigned int height; unsigned int pixelFormat; + + unsigned int bufferCount; }; } /* namespace libcamera */ diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index b0b4efe39c81e747..5ebdce9acdbd3560 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -73,4 +73,9 @@ namespace libcamera { * format described in V4L2 using the V4L2_PIX_FMT_* definitions. */ +/** + * \var StreamConfiguration::bufferCount + * \brief Number of buffers to allocate for the stream + */ + } /* namespace libcamera */ From patchwork Mon Feb 4 18:55:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 502 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 931FC60DB7 for ; Mon, 4 Feb 2019 19:55:33 +0100 (CET) X-Halon-ID: 71689809-28ae-11e9-a58a-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from localhost.localdomain (unknown [81.164.19.127]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 71689809-28ae-11e9-a58a-005056917f90; Mon, 04 Feb 2019 19:55:30 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 4 Feb 2019 19:55:21 +0100 Message-Id: <20190204185521.23471-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204185521.23471-1-niklas.soderlund@ragnatech.se> References: <20190204185521.23471-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] libcamera: pipeline: uvcvideo: set a default format X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2019 18:55:34 -0000 Pick a default format for the UVC one stream in a UVC camera. This is just a starting point to define a good default format for the UVC camera it's expected to evolve over time as the capabilities of the library grows. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/uvcvideo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index 821e4c2189caabd0..ad4d45d0698519b6 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -60,7 +60,11 @@ PipelineHandlerUVC::streamConfiguration(Camera *camera, StreamConfiguration config{}; - LOG(UVC, Info) << "TODO: Return a good default format"; + LOG(UVC, Debug) << "Retrieving default format"; + config.width = 640; + config.height = 480; + config.pixelFormat = V4L2_PIX_FMT_YUYV; + config.bufferCount = 4; configs[&stream_] = config;