From 323a53c2329fe70a063b2d479b19385d10e0a559 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Sat, 4 Jul 2020 18:00:36 +0900 Subject: v4l2: v4l2_camera_proxy: Use stream config in tryFormat For handling try_fmt, the values should be filled in by validating the stream configuration, and not by recalculating them or manually checking against the cached list of formats and sizes. Add a new V4L2Camera::validateConfiguration() function to validate a configuration and use it to obtain size, format, stride, and frameSize values. If the format negotiation fails, return error from try_fmt and s_fmt. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera_proxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/v4l2/v4l2_camera_proxy.h') diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h index e9626942..f06b5b87 100644 --- a/src/v4l2/v4l2_camera_proxy.h +++ b/src/v4l2/v4l2_camera_proxy.h @@ -41,7 +41,7 @@ private: bool validateMemoryType(uint32_t memory); void setFmtFromConfig(StreamConfiguration &streamConfig); void querycap(std::shared_ptr camera); - void tryFormat(struct v4l2_format *arg); + int tryFormat(struct v4l2_format *arg); enum v4l2_priority maxPriority(); void updateBuffers(); void freeBuffers(); -- cgit v1.2.1